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 -i | |
cd | |
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y | |
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz | |
tar xzvf ImageMagick-6.8.9-1.tar.gz | |
cd ImageMagick-6.8.9-1/ | |
./configure --prefix=/opt/imagemagick-6.8 && make | |
checkinstall |
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
#include <stdio.h> | |
#include <string.h> | |
/* | |
gcc compile with -fno-stack-protector to disable "stack Smashing Protection" | |
*/ | |
int main(void) | |
{ | |
char buff[6]; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char const *argv[]) | |
{ | |
int i; | |
for(i=0; i<2; i++){ | |
fork(); | |
printf("-"); | |
} |
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
#coding:utf-8 | |
# http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console | |
import sys | |
import time | |
i = 0 | |
while i<100: | |
time.sleep(0.3) | |
i += 1 | |
#sys.stdout.write("\r{}".format(i)) |
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
#!/bin/bash | |
convert $1 -channel A -blur 1x65000 -level 50x100% \ | |
-channel rgba $2 |
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
import os | |
import inspect | |
import atexit | |
from functools import wraps | |
class OneProcess(object): | |
def __init__(self): | |
self.caller_file_name = inspect.getouterframes( |
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
#!/bin/bash | |
BACKUP_DB="xx" | |
DUMP_CMD="/usr/bin/mongodump" | |
HOST="127.0.0.1" | |
PORT="27017" | |
TIMESTAMP=`date +%F-%H%M` | |
BACKUP_DIR="/opt/data/backup" | |
cd $BACKUP_DIR | |
BACKUP_NAME_PREFIX="app-db" |
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
proxy_cache_path /data/nginx/cache/ levels=1:2 keys_zone=one:10m max_size=10g; | |
proxy_cache_key "$host$request_uri"; | |
upstream google_jp { | |
server 173.194.38.216:80; | |
server 173.194.38.215:80; | |
server 173.194.38.217:80; | |
server 173.194.38.218:80; | |
} | |
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
import os | |
import sys | |
import random | |
# more info | |
# http://trac.edgewall.org/export/10770/trunk/contrib/htpasswd.py | |
# We need a crypt module, but Windows doesn't have one by default. Try to find | |
# one, and tell the user if we can't. | |
try: |
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
#!/bin/bash | |
welcome=( | |
'佛祖保佑 永无BUG' | |
'你好啊单身狗' | |
'壮士,干了这碗鸡汤!' | |
'上线了吗?' | |
'法海,你的头发怎么那么长!' | |
'少壮不努力,长大做挨踢.' | |
'佛祖,我好烦.' |