This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install php5-fpm | |
sudo /etc/init.d/php-fpm start | |
top | |
sudo tail -f /var/log/php5-fpm.log | |
tab tab | |
sigkill |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For upload problems. | |
nginx.conf | |
http block | |
client_max_body_size 5m; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function syscall($command){ | |
$result = ''; | |
if ($proc = popen("($command)2>&1","r")){ | |
while (!feof($proc)) $result .= fgets($proc, 1000); | |
pclose($proc); | |
//return nl2br($result); | |
return $result; | |
} | |
return ''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function randomAddOn () { | |
return '' + (Math.floor(Math.random()*1000*((new Date()).getSeconds()))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
limit_a=`cat limit` | |
limit=${limit_a[0]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -e "yfollowers" ] | |
then | |
NAMES=`cat yfollowers` | |
for value in $NAMES | |
do | |
if [[ $value =~ \<screen_name\>([0-9a-zA-Z_]*)\<\/screen_name\> ]];then | |
i=1 | |
n=${#BASH_REMATCH[*]} | |
while [[ $i -lt $n ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = 'hello world'; | |
$source_url = 'https://domain.com/chart?chid=' . md5(uniqid(rand(), true)); | |
// params (http_build_query will later urlencode) | |
$qrcode = array( | |
'cht' => 'qr', | |
'chs' => '177x177', | |
'chl' => $data); | |
// send the request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see man page, args may vary | |
# to force conversion, use -c also | |
iconv -t ISO-8859-1 -f UTF-8 < utf.txt > asc.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show EXIF data | |
exiftool image.jpg | |
# first install exiftool, then use "-All=" to wipe all EXIF data from JPG | |
# this will modify image.jpg and create backup file image.jpg_original | |
exiftool -All= image.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.howtogeek.com/115051/become-a-vi-master-by-learning-these-30-key-bindings/ | |
Mode Switching | |
As a short recap, vi is a modal editor – there’s an insert mode and a standard command mode. In insert mode, vi functions similar to a normal text editor. In command mode, you take advantage of these key bindings. | |
i – Enter insert mode. | |
Escape – Leave insert mode. If you’re already in command mode, Escape does nothing, so you can press Escape to ensure you’re in command mode. | |
Moving the Cursor | |
Vi uses the hjkl keys to move the cursor in command mode. Early computer systems didn’t always have arrow keys, so these keys were used instead. One advantage of these keyboard shortcuts is that you don’t have to move your fingers from the home row to use them. |