Sunday, May 12, 2013

debian 7.0 64-bit and firefox

If you want to install Firefox (32-bit) on Debian 7.0 (64-bit), you have to install the 2 packages:
  • ia32-libs
  • ia32-libs-gtk

Tuesday, April 30, 2013

debian start-stop-daemon issue

Fresh installed debian, you may find empty (exit 0;) /sbin/start-stop-daemon file which causes you be unable to start sshd, for example.  To resolve this:

apt-get install --reinstall dpkg

Friday, April 26, 2013

how to change default kernel selection at boot time - linux

สุดท้ายแก้ไขไปพลางด้วยการ vi /etc/default/grub ใส่ DEFAULT="1>2" ตามด้วย update-grub ใช้ kernel 3.5.0-26 ไปก่อนดีกั่ว

Friday, April 19, 2013

how to record desktop screen in linux

ffmpeg -f x11grab  -s 1680x1050 -r 25 -i :0.0 -sameq live_streaming_issue.mpg

Tuesday, April 16, 2013

how to limit number of connections to server per second with iptables

# 2 hits per second per ip address

iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds 1 --hitcount 2 -j DROP

iptables -A INPUT -p tcp --dport 443 -i eth0 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 443 -i eth0 -m state --state NEW -m recent --update --seconds 1 --hitcount 2 -j DROP


Sunday, March 31, 2013

how to change your dm-crypt passphrase

  1. Assuming your encrypted partition is /dev/sda5 (crypttab would say sda5_crypt)
  2. add new key: cryptsetup luksAddKey /dev/sda5
  3. reboot and test
  4. remove old key: cryptsetup luksRemoveKey /dev/sda5

Reference


Friday, March 29, 2013

how to mount read/write ntfs in macosx

Well .. i was facing same problem and i've found a solution that works perfectly for me and i can write on NTFS:

1- Install OSXFUSE == > The most important part is to check the compatibility layer within installation otherwise it wont work
2- Install fuse_wait pkg
3- Install ntfs-3g 2010.10.2 and remove the MacFuse from the customized installation (if you couldn't, just after installation, go to preference and remove the MacFuse)
4- Reboot your macbook, et Voila .. it'll work

i've got this info from this link
https://github.com/osxfuse/osxfuse/wiki/NTFS-3G

Hope that would help

Cheers, Soha

how to migrate VirtualBox

  1. delete all snapshots
  2. file > virtual media manager
  3. edit VirtualBox.xml

Saturday, March 23, 2013

how to limit number of connections to our server per period of time with iptables

sample - allow 2 hits once every 3 seconds

iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds 3 --hitcount 2 -j DROP