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
## Windows: http://en.cze.cz/Images-to-video | |
## MacOSX & Linux below | |
clipdir=/tmp/clip/ | |
rm -fr $clipdir && mkdir $clipdir | |
# crop&resize 3x4 frames to 16x9 1280x720 | |
for i in *.JPG ; do convert -verbose $i -strip -resample 72x72 -crop x1386+0+100 -resize 1280x $clipdir/$i ; done | |
#:> cmds.lst && for i in *.JPG ; do echo convert -verbose $i -strip -resample 72x72 -crop x1386+0+100 -resize 1280x $clipdir/$i >> cmds.lst ; done |
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
SELECT E'{| border=1 cellspacing=0 cellpadding=5\n|+\n|тип || relation || size || чей toast || mantainer || планы\n|-\n' || array_to_string(ARRAY( | |
SELECT '|' || C.relkind || | |
'||' || nspname || '.' || C.relname || | |
'||' || pg_size_pretty(pg_relation_size(C.oid)) || | |
'||' || COALESCE(T.relname, '-') || | |
'||' || '/author/' || | |
'||' || '/wtf?/' || E'\n|-' | |
/*SELECT C.relkind, nspname || '.' || C.relname AS "relation", |
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
-- DROP FUNCTION table_sync(regclass, regclass); | |
CREATE OR REPLACE FUNCTION table_sync(in_source regclass, in_destination regclass) | |
RETURNS void AS | |
$BODY$DECLARE | |
_pk name[]; | |
_data name[]; | |
_all name[]; | |
_pk_ident text; |
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
diff --git a/database.php b/database.php | |
index 95cdf2b..de5ef19 100755 | |
--- a/database.php | |
+++ b/database.php | |
@@ -400,6 +400,27 @@ | |
echo "</div>"; | |
} | |
+ | |
+ function clientResolve($addr) { |
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
#!/usr/bin/env python | |
import urllib2, argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-H', required=True) | |
parser.add_argument('-U', default='admin') | |
parser.add_argument('-P', default='password') | |
args = parser.parse_args() | |
fields = "an_rxbs an_txbs bgn_rxbs bgn_txbs lan_rxbs lan_txbs".split(' ') |
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
zcat /var/log/nginx/prod.*.access.log-2012051[567].gz | grep autocomplete | perl -nle 'm|(\d+)/.../....:(\d+):.* "([0-9.]+)" "ostrovok.ru" "ajax"| and print "$1$2 $3"' | awk '{a[$1]++;b[$1]=b[$1]+$2}END{for (i in a) printf("%s\t%10.2f\n", i, b[i]/a[i])} ' | sort |
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
ps auxw | awk '{ g[$11 " " $12] += $6 } END { for (i in g) { print g[i] "\t" i }}' | sort -bgr |
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 f in /proc/*/fd/ ; do ls -U1 $f | wc -l ; done | sort -gr | head -n1 | |
lsof | awk '{ a[$3]++ } END { for(i in a) print a[i] "\t" i }' | sort -bgr |
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
apt-get install unzip python-pip | |
pip install https://github.com/sripathikrishnan/redis-rdb-tools/zipball/master | |
KEYS=$(redis-cli info | perl -nle '/^db.:keys=([0-9]+)/ and print $1' | awk '{ a+=$1 } END { print a }') | |
rdb -c memory /var/lib/redis/dump.rdb | perl -nle '/^(\d+),.*,(\d+),(\d+)$/ and print $1, " ", $2' | pv -ltpe -s $KEYS | gzip -1 > memory.csv.gz | |
zcat memory.csv.gz | awk '{ c[$1]++; a[$1] += $2} END { for(i in a) print "db:" i "\t" int(a[i]/1024/1024) "Mb\t" c[i] " keys\t" int(a[i]/c[i]) " b/key" }' |
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
#!/usr/bin/env python | |
import sys | |
import argparse | |
def self_check(): | |
from subprocess import check_output, check_call | |
from StringIO import StringIO | |
ls_r = StringIO(check_output(['ls', '-1RU'])) |
OlderNewer