Enable apt-X on OSX Yosomite for bluetooth headphones

So I noticed that my Sony MDR-1RBT is not working on aptX codec, did some searches and here are the steps to get aptX codec capability. 1. Download the io tool: https://developer.apple.com/downloads/index.action?name=bluetooth%20explorer 2. Bluetooth Explorer -> Tool -> Audio Options: Force use of aptX 3. Reconnect your bluetooth headphone To enable aptX on the headphone, press volume + and power for two seconds when powering on. The blue indicator will blink 3 times when on aptX mode. Read More

PHP can not connect RDS MySQL on an Amazon EC2 RHEL box

So I decided to use Amazon RDS for my blog. It’s fairly simple to set up RDS, but somehow I couldn’t get PHP to connect to RDS. Wordpress kept throwing this error: “Error establishing a database connection”. So I thought maybe my RDS security group settings are not correct? I opened the RDS instance to 0.0.0.0/0 and I was able to connect using mysql cli anywhere, including the RHEL box, but WP still gave me the same error. I then tried php mysql connection to RDS on another linux box and it worked! OK, so that means somehow php mysql connection is not working on the RHEL box, what can be causing the problem? After a few Google searches, one post drew my attention, Read More

Git – How to avoid typing your password repeatedly

There are at least three ways to avoid typing your password repeatedly when using git. First solution requires to use KDE wallet, second solution doesn’t require additional tools and third is not the safest one. First way – use KDE wallet To store passwords in the KDE wallet you need to install ksshaskpass package: $ sudo apt-get install ksshaskpass Then configure git to use it: $ git config –global core.askpass /usr/bin/ksshaskpass Alternatively you can use GIT_ASKPASS environmental variable: $ export GIT_ASKPASS=`which ksshaskpass` Use secure protocol: $ git clone –verbose https://[email protected]/git/personal_repo.git Second way – Read More

解决rTorrent下载中文资源文件名乱码的问题

解决办法: 1. 修改rTorrent配置文件,我的配置文件位置是在 /opt/etc/rtorrent.conf ,在最后一行加上一句: encoding_list = zh_CN.UTF-8 这个并没有解决我的问题,文件名依然乱码,后来查资料才发现需要改挂载参数。 2. 因为我是SAMBA挂载的NAS,在挂载的时候需要加一个参数iocharset=utf8: mount -t cifs //192.168.1.2/ShawnHDD /tmp/ -o rw,iocharset=utf8,username=shawn,passwo rd=password 参考资料:http://ubuntuforums.org/showthread.php?t=288534 Read More

PPTPD源码安装 Install PPTPD from source code

今天花了一晚上倒腾VPN服务器,因为是用的CENTOS,没法直接apt-get install pptpd,虽然网上有RPM包,但最后还是选择了源码安装,过程中碰到很多问题,在此总结一下: 1. make install后默认没有安装服务,需要自行创建/etc/rc.d/init.d/pptpd,写入代码如下: [crayon-55bbcab8a80bb340918395/] 2. 将pptpd安装为服务并随机启动: [crayon-55bbcab8a80c4547979028/] 3. 客户端链接的时候很可能提示错误,这是因为通过yum install ppp安装的组件版本与pptpd所支持的版本不一致,解决办法,修改/etc/pptpd.options,注释掉logwtmp即可。这个问题折磨我好久!=-=! 4. Read More

EMACS快速入门

简介 emacs 是Unix上的编辑器佼佼者,在命令列上打个”emacs”就好了,一上来只是提示, 你要先开个新档并且给档名才会到这个档的编辑缓冲区(buffer)。另外如果不想用 window模式,例如有时网络很慢,或者没有X的显示允许权,可以用emacs -nw启动 terminal模式。 其实在X下他也有选单(menu)可以用,不需要背命令,背那些热键(Hotkey),虽然我 有一些朋友就这样用,不过我还是要说这样无法发挥他应有的功能。由于来往两个 模式太麻烦,所以我们有热键这个东西,在文字输入模式下,按个热键就可以完成 Read More