codeif.com
修复mac os x升级 10.10后不能启动Charles
http://www.codeif.com/post/fix-charles-can-not-startup
修复mac os x升级 10.10后不能启动Charles. Mac os x升级到10.10后, 启动Charles报下面的错:. Dyld: lazy symbol binding failed: Symbol not found: CGContextSetAllowsAcceleration Referenced from: /Library/Java/JavaVirtualMachines/1.6.0 31-b04-413.jdk/Contents/Libraries/libawt.jnilib Expected in: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices dyld: Symbol not found: CGContextSetAllowsAcceleration Referenced from: /Library/Java/JavaVirtualMachines/1.6.0 31-b04-413&#...
codeif.com
Python使用cProfile pstats dot进行性能分析
http://www.codeif.com/post/python-cprofile-pstats-dot
CProfile, pstats 是python标准库. Gprof2dot 是一个开源python脚本, 在这里 https:/ code.google.com/p/jrfonseca/wiki/Gprof2Dot. Test2py, 使用cProfile进行性能分析, 输出一个profile的二进制文件: out.pstat. 用 pstats 分析第一步中的profile文件,得到相关统计, out.pstats. Python test2.py ./gprof2dot.py -f pstats out.pstats bitmap desc.txt. Dot -Tpng -o out.png bitmap desc.txt.
codeif.com
修改ipython提示符的颜色
http://www.codeif.com/post/ipython-color-setting
找到文件 ipython config.py. Set the color scheme (NoColor, Linux, or LightBG). # c.TerminalInteractiveShell.colors = 'LightBG' c.TerminalInteractiveShell.colors = 'Linux'.
codeif.com
ubuntu下安装dnsmasq
http://www.codeif.com/post/ubuntu-install-dnsmasq
Sudo apt-get install dnsmasq. Sudo /etc/init.d/dnsmasq restart. Sudo service dnsmasq restart. Ps aux grep dnsmasq. Ps aux grep dnsmasq nobody 1245 0.0 0.0 35240 1528? S 10:40 0:00 /usr/sbin/dnsmasq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -r /var/run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new. 是dnsmasq用到的dns, 我们运营商提供的dns,例如. Nameserver 180.76.76.76 nameserver 114.114.114.114.
codeif.com
python发送email
http://www.codeif.com/post/python-send-email
参考: http:/ blog.csdn.net/dbanote/article/details/8924686. 因为163的邮箱开通smtp还需要绑定手机, 所以这里使用qq的邮箱, 最简单的代码如下 进入QQ邮箱, 开启stmp服务, 可能需要设置独立密码, 下面会用到. 邮箱服务地址和端口看: http:/ kf.qq.com/faq/120322fu63YV130422nqIrqu.html. Coding: utf-8 -*- import smtplib server = smtplib.SMTP('smtp.qq.com', 25) server.login('qq或者qq@qq.com', '邮箱独立密码') msg = ' nHello! Server.sendmail('from@qq.com', 'to@qq.com', msg). Msg需要 n开头, 否则看不到正文. 如果使用ssl的加密方式, 参考: http:/ stackoverflow.com/questions/64505/sending-mail-from-python-using-smtp. Coding: u...
codeif.com
mac下安装pyv8
http://www.codeif.com/post/mac-install-pyv8
安装说明: https:/ code.google.com/p/pyv8/wiki/HowToBuild#Boost. Src/Exception.h:6:16: fatal error: v8.h: 没有那个文件或目录. PyV8 use boost: python for interoperability, so, download the latest boost version and build the library. 所以安装boost, 安装方法参见: http:/ stackoverflow.com/questions/104322/how-do-you-install-boost-on-macos. Src/Exception.h:16:10: fatal error: 'boost/python.hpp' file not found.
codeif.com
修复ubuntu下public key is not available错误
http://www.codeif.com/post/fix-ubuntu-public-key-is-not-available
修复ubuntu下public key is not available错误. Sudo apt-get source nginx Reading package lists. Done Building dependency tree Reading state information. Done NOTICE: 'nginx' packaging is maintained in the 'Git' version control system at: git:/ anonscm.debian.org/collab-maint/nginx.git WARNING: The following packages cannot be authenticated! Sudo apt-key adv - keyserver keyserver.ubuntu.com - recv-keys 40976EAF437D05B5 sudo apt-key adv - keyserver keyserver.ubuntu.com - recv-keys 3B4FE6ACC0B21F32.
codeif.com
sublime下安装markdown的插件
http://www.codeif.com/post/sublime-install-markdown-plugin
使用sublime编写预览markdown文件, 以下操作在sublime2有效, sublime3没有验证, mac中将ctrl换为command就可以了. 默认的配色方案可能不高亮, 换为 Color Scheme - Sunburse. Import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed packages path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http:/ sublime.wbond.net/' pf.replace(' ','%20') .read(). Ctrl shif p 调出命令面板. 输入install, 选择install package. 装完 MarkdownBuild 插件后, 按CTRL b就可以在默认浏览器中预览md结尾的文件了.
codeif.com
iphone删除所有照片
http://www.codeif.com/post/ios-delete-all-photos
使用的mac电脑删除, iphone连上mac后, 打开 Image Capture(图像捕捉), 推荐用Alfred打开. 然后Command a 全选,电脑点击左下角的红叉标识, 就可以删除所有照片了.
codeif.com
新mac软件安装记录
http://www.codeif.com/post/new-mac-software
Chrome http:/ www.google.com/chrome/. Firefox https:/ www.mozilla.org/en-US/firefox/new/. Alfred, 官网 http:/ www.alfredapp.com/. ITerm2 http:/ iterm2.com/. Brew http:/ brew.sh/. Sudo easy install pip. Sudo pip install virtualenv sudo pip install virtualenvwrapper. Virtualenvwrapper默认安装在安装在/usr/local/bin, 打开: /usr/local/bin/virtualenvwrapper.sh 可以看到安装步骤, Setup. Sublime http:/ www.sublimetext.com/2. Charles http:/ www.charlesproxy.com/. Mou 一款md5编辑器 http:/ mouapp.com/. Sudo pip install mercurial.