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
tail /var/log/squid/access.log -f -n999 | perl -p -e 's/^([0-9\.]*)/"[".localtime($1)."]"/e' |
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
seqid=0 | |
for i in `vzlist -o ctid -H` | |
do | |
((sequid++)) | |
vzctl exec $i "echo \"$sequid \`hostname -f\` \`lsb_release -a 2>/dev/null | grep Description | sed -r 's#.*:[ \t]+##g'\` \`cat /proc/cpuinfo | grep 'physical id' | uniq | wc -l\` CPU; \`free -h | grep Mem | awk '{print \$2}'\` RAM; \`df -hT | grep '/\$' | awk '{print \$3}'\` HDD \`ip -o -4 a s | grep brd | sed -r 's#.* ([0-9\.]{7,})/.*#\1#' | tr -s '\n' ' '\` \`netstat -tlpn | grep '^tcp\|^udp' | cut -d/ -f2 | sort -u | tr -s '\n' ' ' | sed 's#zabbix_agentd ##; s#exim4 ##; s#postgres#PostgreSQL#; s#config.ru ##; s#master#Postfix#; s#apache#Apache#; s#mysqld#MySQL#'\`\"" | |
done |
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
Convert old latin1 DB to a new UTF8 one: | |
DBS="db1 db2" | |
for dbname in $DBS | |
do | |
mysqldump "${dbname}" > "${dbname}"latin1.sql | |
cat "${dbname}"latin1.sql | sed "s#CHARSET=latin1#CHARSET=utf8#" | iconv -f iso8859-1 -t utf8 > "${dbname}"utf8.sql | |
done | |
==== | |
Change in /etc/mysql/my.cnf: |
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
/var/log/nginx/*.log { | |
daily | |
dateext | |
dateformat .%Y-%m-%d | |
missingok | |
rotate 365 | |
compress | |
delaycompress | |
notifempty | |
create 0640 www-data adm |
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
e=$(psql -lAt | head -n1 | cut -d\| -f1); psql -c "SELECT pg_database.datname, pg_database_size(pg_database.datname), pg_size_pretty(pg_database_size(pg_database.datname)) FROM pg_database ORDER BY pg_database_size DESC;" -d ${e} |
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
apt-get install curl | |
curl -sSL https://get.rvm.io | bash -s stable | |
source /etc/profile.d/rvm.sh | |
rvm reload | |
rvm --default 2.1.2 | |
rvm list | |
rvm install 2.1.2 | |
rvm list | |
gem install bundler |
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
apt-get install devscripts build-essential | |
apt-get build-dep golang-go | |
wget http://ftp.de.debian.org/debian/pool/main/g/golang/golang_1.3-1.dsc | |
wget http://ftp.de.debian.org/debian/pool/main/g/golang/golang_1.3.orig.tar.gz | |
wget http://ftp.de.debian.org/debian/pool/main/g/golang/golang_1.3-1.debian.tar.xz | |
dpkg-source -x golang_1.3-1.dsc | |
cd golang-1.3/ | |
debuild -us -uc |
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
#!/bin/bash | |
apt-get -y install build-essential checkinstall fakeroot curl | |
src=$(mktemp -d) && cd $src | |
wget -N http://nodejs.org/dist/node-latest.tar.gz | |
tar xzvf node-latest.tar.gz && cd node-v* | |
./configure | |
fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install | |
dpkg -i node_* | |
wget https://www.npmjs.org/install.sh -O- | bash |
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
#!/bin/bash | |
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2 | |
#!/bin/bash | |
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2" | |
#!/bin/bash | |
convert in.jpg \( +clone -blur 0x20 \) -compose Divide_Src -composite -normalize -level 10%,90% -deskew 40% -unsharp 0x5+2+0 out.jpg |
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
#!/bin/bash | |
FFN="$1" | |
filename=`basename "$FFN"` | |
encoding=$(uchardet "$FFN") | |
enc=`echo $encoding | sed 's#^x-mac-#mac#'` | |
cat "$FFN" | perl -pe 's/\r\n/\n/g' | perl -pe 's/\n\r/\n/g' | perl -pe 's/\r/\n/g' > "$FFN.out" | |
iconv -f $enc -t UTF-8 "$FFN.out" |