Category Archives: Software

在Mac里安装单独的python

mac已经自带了python了,版本也还比较新。如果想自己控制python的版本的话,可以用brew来安装单独的python.

brew install python

brew安装的命令会在/usr/local/bin里面,如果系统自带了一些工具在/usr/bin里,那么brew安装的可能无法被使用到。所以需要将/usr/local/bin放到 /usr/bin前面去

brew doctor会提供修复的命令:

Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
    echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc

修改之后source ~/.zshrc就可以使用最新版的python了

➜  python --version
Python 2.7.11
➜  which python
/usr/local/bin/python

 

 

enable xtrafinder to work under OS X 10.11 El Capitan

据说是OSX 10.11开启了一个System Integrity Protection的功能,所以Xtrafinder就无法正常工作了。

解决的方法,就是部分关闭SIP的功能,具体看:

How to modify System Integrity Protection

You must boot into the Recovery OS. You do this by restarting your machine, and holding COMMAND + R until the Apple logo appears.

Then select Terminal from the Utilities menu. It looks like this:

In the window that opens, type csrutil enable --without debug and press return.

This turns off the part of SIP that XtraFinder needs to run, and OS X complains that it is an unsupported configuration.

Now type reboot and press return to restart your machine.

 

mac下的文件比较工具

Kaleidoscope

据说是可以媲美windows下beyond compare的工具,不过够贵,69.99$

http://www.kaleidoscopeapp.com/

VisualDiffer

据说也不错,Mac app store有,才4.99$, 便宜多了

http://visualdiffer.com/

Beyond Compare

Windows下面的工具,现在移植到了Mac下,处于beta中,应该也不错吧

http://www.scootersoftware.com/beta.php

 

 

windows下在git中修改文件的大小写

git mv -f File.TXT file.txt

然后commit就可以了

不过建议还是直接更改一下git config:

Add ignorecase = false to [core] in .git/config;

 

Windows下git文件可执行属性的处理

在使用openshift的过程中,.openshift\action_hooks\下面的脚本,在deploy的时候没有自动执行。研究了半天,才发现是windows平台下,文件的可执行属性没有加上,所以到了server端之后,这些脚本都没有成功的执行,解决的方法如下:

D:\workspaces\hrm\.openshift\action_hooks>git update-index --chmod=+x build

D:\workspaces\hrm\.openshift\action_hooks>git update-index --chmod=+x deploy

D:\workspaces\hrm\.openshift\action_hooks>git commit -a -m "update permission"
[master 69a5e52] update permission
 0 files changed
 mode change 100644 => 100755 .openshift/action_hooks/build
 mode change 100644 => 100755 .openshift/action_hooks/deploy

D:\workspaces\hrm\.openshift\action_hooks>git push

这样action_hooks下面的脚本就可以正确的被执行了

use python lint in Sublime Text

1. install SublimeLinter

2. install SublimeLinter-PEP8

3. install pep8 on your system:

pip install pep8

 

4. configure SublimeLinter, add “pep8” path of your system

        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": [
                "C:\\Python27\\Scripts\\pep8.exe"
            ]
        },

5. configure other lint option, such as ignore E501

        "linters": {
            "pep8": {
                "@disable": false,
                "args": [],
                "excludes": [],
                "ignore": "E501",
                "max-line-length": null,
                "select": ""
            }
        },

 

skype chat commands and roles

skype的chat group建立起来之后,还有很多的命令可以使用,比较有用的命令包括:

1. /get creator ==> 获取当初创建这个群的人,然后这个人可以踢人了等

2. /setrole 给某个人设置角色,决定是不是可以发言等

详细的参见

https://support.skype.com/en/faq/FA10042/what-are-chat-commands-and-roles

比较有

Here is a list of all common commands and their descriptions:

Command Description
/add [Skype Name] Adds a contact to the chat. For instance:/add alex_cooper1 will add that member to the chat.
/alertson [text] Allows you to specify what needs to appear in a chat for you to be notified. For example,/alertson London will only alert you when the word “London” appears in the chat.
/alertsoff Disable message notifications.
/clearpassword Removes the password security.
/find [text] Finds specific text in a chat. For example,/find Charlie will return the first instance of the word “Charlie” in the chat.
/get allowlist Details people with access to the chat.
/get banlist Details people banned from the chat.
/get creator Details the person who created the chat.
/get guidelines See the current chat’s guidelines.
/get options Details active options for current chat – see /set options below for a list of the options available.
/get password_hint Get the password hint.
/get role Details your role in the chat.
/get uri Creates a URL link that other people can use to join the group chat.
/golive Starts a group call with other participants of the chat.
/info Details number of people in chat and maximum number available.
/kick [Skype Name] Eject chat member. For instance,/kick alex_cooper1 will eject that member from the chat.
/kickban [Skype Name] Ejects chat member and prevents them from rejoining chat. For instance,/kickban alex_cooper1 will eject that member from the chat and ban them from rejoining.
/leave Leave current group chat.
/me [text] Your name will appear followed by any text you write. For instance, /me working from home will cause the phrase “working from home” to appear next to your name in the chat. You can use this to send a message about your activities or status.
/set allowlist [[+|-]mask] .. Sets the members allowed in the chat. For instance, /set allowlist +alex_cooper1 will allow that member to join the chat.
/set banlist [[+|-]mask] .. Sets which members are banned from the chat. For instance, /set banlist +alex_cooper1will ban that member from the chat./set banlist -alex_cooper1 will allow them to rejoin it.
/set guidelines [text] Set a chat’s guidelines. For instance, /set guidelines No spoilers! These can be returned to be viewed in the chat by the command /get guidelines.
/set options [[+|-]flag] Sets options for this chat. For example: /set options -JOINING_ENABLED switches off the JOINING_ENABLED option, while /set options +JOINERS_BECOME_APPLICANTS will switch on the JOINERS_BECOME_APPLICANTS option.
The available flags are listed below:
HISTORY_DISCLOSED – Joiners can see the conversation that took place before they joined. The limit that they can see is either 400 messages or two weeks of time, depending on which is reached first.
JOINERS_BECOME_APPLICANTS – New users can join the chat, but cannot post or receive messages until authorized by a CREATOR or MASTER (see the table below for more information on roles).
JOINERS_BECOME_LISTENERS – New users can receive messages but cannot post any until promoted to the USER role.
JOINING_ENABLED – New users can join the chat.
TOPIC_AND_PIC_LOCKED_FOR_USERS – Only a user with a CREATOR role will be able to change the topic text or accompanying picture for the chat.
USERS_ARE_LISTENERS – Users with a USER role will be unable to post messages.
/set password [text] Create a password (no spaces allowed).
/set password_hint [text] Create the chat’s password hint text.
/setpassword [password] [password hint] Create a password and password hint for the chat.
/setrole [Skype Name] MASTER | HELPER | USER | LISTENER Allows you to set a role to each chat member. A description of roles is given in the table below.
/topic [text] Changes the chat topic.
/undoedit Undo the last edit of your message.
/whois [Skype Name] Provides details about a chat member such as current role.

Chat roles depend on whether you started the chat or were assigned a role by the chat creator or host:

Role Description
Creator The member who created the chat. There can be only one creator per chat. Only the creator can promote other members to masters.
Master Also known as chat hosts. Masters cannot promote other people to masters.
Helper A semi-privileged member. Helpers will not be affected by the USERS_ARE_LISTENERS option. Helpers cannot promote or demote other members.
User A member who can post messages into the chat.
Listener A member who can see messages but not post into the chat.
Applicant A member waiting for acceptance into the chat. Note: once accepted into the chat, members cannot be demoted to applicants.

 

在outlook里搜索邮件

outlook里搜索邮件一直是一件很费力的事情。于是我只好想不同的办法来解决这个问题。

1. 多年前,google desktop和baidu disk search还在的时候,可使用这两个工具,在本地搜索文件和邮件。但是不知道基于什么考虑,google和baidu都放弃了这两个产品。baidu还有disk.baidu.com的页面存在,google连官方下载的地址都没有了。

2. windows search. outlook 2013之前,直接用windows search也能检索outlook的结果,效果也还可以。但是到了outlook2013,windows search被outlook禁用了!microsoft这帮人不知道脑子是不是进水了!难道不知道用户需要的是一个能够搜索全部内容的工具,而不是搜索A到应用A,  搜索B到应用B么?并且outlook 2013自己的 search结果实在是太差,速度慢就不说了

3. 于是只好找第三方的搜索工具,还真有,引用一个评测:

评测员们通过测试对Outlook的插件Xobni和Lookeen做出一系列总结。

我们在测试微软Outlook的一些插件的时候,决定针对业内闪亮新星Xobni和另外一款软件Lookeen做一个小测试,评比一下它们的表现。针对两款软件的Outlook的搜索功能,我们分别进行了3组测试,包含邮件,附件,联系人,约会和任务的搜索(multiple pst不包括在这次测试中)。从表现上看,它们都有效地为邮件建立索引,关注新收到或者发出的邮件,它们搜索结果大致相同,速度也类似。从价格上看,两款软件的价格相差很小,大约10美金。下面是从人性化和个人选择上做出的评比总结:

Xobni- 整个模块融入Outlook,并且为用户提供很炫的界面,我们的不少工作人员都因此为这款软件加分。Xobni的卓越功能还包括分析和有条理地显示联系信息,往来对话以及传送的文件。缺点是它的融入让本来已经很繁琐的Outlook窗口更加密集。

Lookeen – 搜索结果可以直接显示在Outlook窗口中,也可以单独打开(更好的显示效果)。它的界面跟Xobni比起来相对简陋,在分析功能上也没有Xobni完善。但是从单纯的搜索功能上看,准确性比Xobni略高(Xobni在测试中遗漏一项结果,Lookeen没有遗漏),是一个很实惠的产品。

测试结束时,我们从工作人员中得到许多不同的观点,但是大多数人倾向于使用Xobni的免费版本并且期望可以升级到专业版。Lookeen的支持者相对少一些,在价格相差不大的情况下,选择专业版Xobni的用户多一些。

现在的方案是使用Lookeen来搜索邮件。附带一个baidu网盘的下载地址:

http://pan.baidu.com/share/link?shareid=222701&uk=2939454615

Chrome的隐藏设置

chrome://appcache-internals
chrome://blob-internals
chrome://bookmarks
chrome://cache
chrome://chrome-urls
chrome://crashes
chrome://credits
chrome://dns
chrome://downloads
chrome://extensions
chrome://flags
chrome://flash
chrome://gpu-internals
chrome://histograms
chrome://history
chrome://ipc
chrome://media-internals
chrome://memory
chrome://net-internals
chrome://view-http-cache
chrome://newtab
chrome://plugins  ==> 如果不期望chrome自己打开pdf文件,可以在这里设置
chrome://print
chrome://profiler
chrome://quota-internals
chrome://sessions
chrome://settings
chrome://stats
chrome://sync-internals
chrome://tasks
chrome://tcmalloc
chrome://terms
chrome://tracing
chrome://version
chrome://workers
chrome://conflicts

For debugging purposes only (use with caution, they crash or hang Chrome)

chrome://crash/
chrome://kill/
chrome://hang/
chrome://shorthang/
chrome://gpuclean
chrome://gpucrash
chrome://gpuhang

给wordpress增加mobile版本

wordpress现在已经成为一个非常流行的CMS系统了,本人的blog也是用的wordpress. 可是wordpress在mobile平台上显示的效果并不是很好。解决这个问题现在很简单了,因为有了WPTouch.

http://wordpress.org/extend/plugins/wptouch/

http://www.bravenewcode.com/wptouch-pro

这是一个wordpress的plugin, 有免费和收费两个版本。安装的方法很简单,直接在plugin处搜索WPTouch,然后安装就好了。安装之后,如果检测到user agent是mobile平台,就会使用mobile的themes,效果很不错。看下图的比较(chrome打开):

blog with WPTouch

原始的效果:

blog without WPTouch