Skip to content

Instantly share code, notes, and snippets.

View kaelzhang's full-sized avatar
👻
♡╰̩̩̩̩̩̍̍●̩̩̩̩̩̩̩̻̍̍̍̍̍̍̍̊ᴗ̩̩̩̩̩̩̩̩̩̩̪̺̍̍̍̍̍̍̍̍̍̍̆̑●̩̩̩̩̩̩̩̻̍̍̍̍̍̍̍̊╯̩̩̩̩̩̍̍̍̍̍♡

Kael kaelzhang

👻
♡╰̩̩̩̩̩̍̍●̩̩̩̩̩̩̩̻̍̍̍̍̍̍̍̊ᴗ̩̩̩̩̩̩̩̩̩̩̪̺̍̍̍̍̍̍̍̍̍̍̆̑●̩̩̩̩̩̩̩̻̍̍̍̍̍̍̍̊╯̩̩̩̩̩̍̍̍̍̍♡
View GitHub Profile
@kaelzhang
kaelzhang / sendmail-fix
Created April 27, 2013 16:24
Error on mac: sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file or directory
sudo mkdir -p /Library/Server/Mail/Data/spool
sudo /usr/sbin/postfix set-permissions
sudo /usr/sbin/postfix start
@kaelzhang
kaelzhang / node-mysql-wrapper.md
Last active December 18, 2015 16:59
Node-mysql wrapper: use this trick to prevent program exiting caused by failure of node-mysql, and disable `connect` and `end` methods which might cause unexpected errors. "Error: Cannot enqueue Handshake after already enqueuing a Handshake".
system_profiler -detailLevel mini | grep "Model Identifier:"
sudo su -
kextstat | grep IOPlatformPluginFamily
cd /System/Library/Extensions/IOPlatformPluginFamily.kext/
cd Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/
cd Contents/Resources/
ls | wc -l
echo "/bin/rbash" >> /etc/shells
cp /bin/bash /bin/rbash
useradd -s /bin/rbash <ssh-user>
passwd <ssh-usr>
echo "export PATH=/home/<ssh-user>" > /home/<ssh-user>/.bash_profile
@kaelzhang
kaelzhang / wordpress-nginx-php-fpm.conf
Last active December 20, 2015 02:19
Nginx configuration for wordpress + php + php-fpm
upstream php-fpm {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name <domain>;
root /<server-root>;
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/

Git ssh config

嘛,最近 github 间歇式被墙,尼玛一到晚上加班的时候就给我抽风啊,完全没法干活了。

所以稍微整理了一下 ssh 设置。

首先,你还是需要一台国外的可以 ssh 的机器,或者 ssh 帐号的,否则,下面就不用看了 =。=

步骤

@kaelzhang
kaelzhang / install.sh
Last active August 29, 2015 13:59
Compile and install couchdb 1.5.1 on Centos 6.4
#!/bin/bash
# Please run as root privilege
yum -y install libicu-devel curl-devel ncurses-devel libtool libxslt fop java-1.6.0-openjdk java-1.6.0-openjdk-devel unixODBC unixODBC-devel openssl-devel
# The rpm package on this site lacks of RSA V4 Signature, so we have to compile erlang from source code.
wget https://packages.erlang-solutions.com/erlang/esl-erlang-src/otp_src_R16B03-1.tar.gz
wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
@kaelzhang
kaelzhang / module.js
Created August 4, 2014 02:15
Node.js File Module
a.js
var b = require('./b')
b.b; // undefined
exports.a = 1;
@kaelzhang
kaelzhang / systemstats.sh
Created August 9, 2014 04:21
Resolving systemstats CPU Usage Issues
sudo launchctl stop com.apple.systemstatsd
sudo launchctl stop com.apple.systemstats.periodic
sudo launchctl stop com.apple.systemstats.analysis
mkdir /Users/Shared/oldsysstats
sudo mv /private/var/db/systemstats/* /Users/Shared/oldsysstats