starting phantomjs server:
/usr/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs ~/Code/highchart-export/highcharts-convert.js -host 127.0.0.1 -port 3005
testing command:
AutoIT + Firefox + mozrepl + FF.au3 | |
Browser ownage! be it browser testing, game bot building. | |
http://www.autoitscript.com/autoit3/ | |
http://www.mozilla.com/firefox/ | |
http://github.com/bard/mozrepl/wikis/home | |
http://thorsten-willert.de/Themen/AutoIt-FF.au3/ |
$c = "样本平均价"; | |
foreach(mb_list_encodings() as $en){ | |
echo $en.' '; | |
echo bin2hex(mb_convert_encoding($c, $en)); | |
echo "\r\n"; | |
} |
http://ghita.org/tipoftheday/xamp-with-memcache-on-windows | |
http://www.leonardaustin.com/technical/how-to-install-memcached-on-xampp-on-windows-7 | |
1. Locate you working php.ini (you can always check the correct path by looking at the phpinfo()) | |
2. Make all the configs from the article above. | |
3. Download php_memcache.dll from http://windows.php.net/downloads/pecl/snaps/memcache/3.0.6/. For me php_memcache-3.0.6-5.4-ts-vc9-x86.zip worked, because I'm using PHP 5.4. Put it in \php\ext |
git config --global user.name "John Doe" | |
git config --global user.email johndoe@example.com | |
git config --global credential.helper 'cache --timeout=3600' |
GRANT ALL PRIVILEGES ON ats_prod.* TO 'username'@'localhost' IDENTIFIED BY 'password'; | |
create database <database_name> character set UTF8 collate utf8_bin |
# bashrc collection | |
alias sshprod="ssh user@host -p 22" |
Using phantom js to render a html page into pdf/image.
sudo apt-get install phantomjs
fixing
QXcbConnection: Could not connect to display
Yes, see the ControlMaster and ControlPath options.
You can start the master connection with:
mkdir ~/.ssh/ctl
ssh -nNf -o ControlMaster=yes -o ControlPath="$HOME/.ssh/ctl/%L-%r@%h:%p" user@host
And then use rsync with:
rsync -e "ssh -o 'ControlPath=$HOME/.ssh/ctl/%L-%r@%h:%p'" ...
Install certbot
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo certbot --authenticator standalone --installer nginx -d www.example.com --pre-hook "service nginx stop;sleep 5;" --post-hook "service nginx start;sleep 5;"
Auto renew cronjob