This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
$ch = curl_init($post_url); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('data1'=>'val','data2'=>'val2'))); | |
$data_str = curl_exec($ch); | |
curl_close($ch); | |
file_put_contents($path_to_xml_data,$data_str); |
This file contains hidden or 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
$ch = curl_init('http://domain.com?'.http_build_query(array('type'=>'stuffIndex','request'=>'getIt'))); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$resp = curl_exec($ch); | |
curl_close($ch); | |
$d = json_decode($resp,true); | |
if ($d && isset($d['akey'])) { | |
} |
This file contains hidden or 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
Pull to web host | |
git init | |
git remote add origin [email protected]:username/domain.git . | |
git pull origin master | |
http://nvie.com/posts/a-successful-git-branching-model/ | |
branches: |