1. fallocate -l 512M /swapfile
2. chmod 600 /swapfile
3. mkswap /swapfile
4. swapon /swapfile
5. Edit fstab file
/swapfile none swap defaults 0 0
Monthly Archives: December 2012
Set timezone in Ubuntu
1. dpkg-reconfigure tzdata
2. sudo apt-get install ntp
Enable PPTP penetration ability in Router
Add “ip_nat_pptp” into /etc/modules
PPTP client behind NAT
1. modprobe ip_nat_pptp
2. iptables -t nat -I PREROUTING -p gre -d natserveripaddress -j DNAT –to pptp-client-ip-address
Reference: http://bbs.chinaunix.net/thread-2194117-1-1.html
socat
Server side socat tcp4-listen:5353,reuseaddr,fork UDP:nameserver:53
Client side: socat -T15 udp4-recvfrom:53,reuseaddr,fork tcp:localhost:5353
http://zarb.org/~gc/html/udp-in-ssh-tunneling.html
ssh tunneling
ssh -f user@personal-server.com -L 2000:personal-server.com:25 -N
The -f tells ssh to go into the background just before it executes the command. This is followed by the username and server you are logging into. The -L 2000:personal-server.com:25 is in the form of -L local-port:host:remote-port. Finally the -N instructs OpenSSH to not execute a command on the remote system
This essentially forwards the local port 2000 to port 25 on personal-server.com over, with nice benefit of being encrypted. I then simply point my E-mail client to use localhost:2000 as the SMTP server and we’re off to the races.
Convert PDF to JPG
convert -colorspace RGB -interlace none -density 300×300 -quality 100 file.pdf file.jpg
Reference: http://www.linuxquestions.org/questions/linux-software-2/how-to-convert-pdf-to-jpg-910611/