Skip to content

Instantly share code, notes, and snippets.

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/
@kai101
kai101 / highcharts_export_phantomjs.markdown
Last active September 7, 2015 07:13
highchart export-module ERROR: the options variable was not available or couldn't be parsed

ERROR: the options variable was not available or couldn't be parsed

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:

@kai101
kai101 / gist:6c114fa1c70bda500997
Created November 12, 2015 02:44
Check Hex Chinese character Encoding.
$c = "样本平均价";
foreach(mb_list_encodings() as $en){
echo $en.' ';
echo bin2hex(mb_convert_encoding($c, $en));
echo "\r\n";
}
@kai101
kai101 / gist:7782658
Created December 4, 2013 05:10
How to install php memcache on windows 8
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
@kai101
kai101 / setup.sh
Created September 27, 2017 03:50
git setup username and remember credential
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"
@kai101
kai101 / readme.md
Created January 30, 2018 02:24
How to install phantomjs 17.10

Using phantom js to render a html page into pdf/image.

sudo apt-get install phantomjs

fixing

QXcbConnection: Could not connect to display
@kai101
kai101 / readme.md
Last active February 13, 2018 01:19
Rsync over shared connection.

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'" ...
@kai101
kai101 / readme.md
Last active March 2, 2018 04:18
Fix certbot braking updates for early 2018

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