Skip to content

Instantly share code, notes, and snippets.

httpry -i eth0 -s
# net
tcpdump -nnn -s 0 -i eth0 -A '(tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)'
# sql
tcpdump port 3306 -s 65535 -x -n -q -tttt > /root/tcpdump.out
pt-query-digest --type=tcpdump /root/tcpdump.out | less
socat TCP-LISTEN:80,fork TCP:127.0.0.1:8000
# !!!! this unit cantbe started as gives me error. I think something wrong with command line syntax ssh key is treated as parameter..
[Unit]
Description=Dokku in Docker
After=etcd.service
After=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill dokku
ExecStartPre=-/usr/bin/docker rm dokku
# swith to sudo
sudo -i
# create swap
touch /2GiB.swap
chattr +C /2GiB.swap
fallocate -l 2048m /2GiB.swap
chmod 600 /2GiB.swap
mkswap /2GiB.swap
@kacinskas
kacinskas / GIT log
Created August 14, 2014 08:53
git log --pretty=format:"%h %cd %s" --graph --since=1.days
$ git log --pretty=format:"%h %cd %s" --graph --since=1.days
more at: http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History
@kacinskas
kacinskas / gist:f375df067ee860af7560
Last active August 29, 2015 14:02
Script to generate animation sprite sheet from images
#/usr/bin/bash
rows='6'
frameW='300'
frameH='300'
fileName='sheet.png'
echo "Generator of sprite sheet"
# read rows
# 95 - 9 is commpression level, 5 is adaptive compression type
mogrify -resize 150% -quality 95 *.png
@kacinskas
kacinskas / gist:6623323
Created September 19, 2013 13:15
MySQL duplicate db
CREATE DATABASE duplicateddb;
mysqldump -h host -u admin -p originaldb | mysql -h host -u backup -ppassword duplicateddb;
@kacinskas
kacinskas / new_gist_file
Created July 17, 2013 06:55
Fix Skype and other applications missing 32bit libraries errors on 64bit xubuntu
$ sudo nano /etc/ld.so.conf.d/lib32.conf
#add line:
/usr/lib/i386-linux-gnu/mesa/
#save
$ ldconfig -v