Linux Scroll

Just another site

Monthly Archives: May 2010

ISP block port 25. Redirect port 587 to port 25 in linux firewall.

For Shorewall:

$ vi /etc/shorewall/rules

DNAT net loc:%Local IP%:25 tcp 587 - %Public IP%


$ iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 587 -j REDIRECT --to-ports 25

$ /etc/init.d/iptables save
$ /etc/init.d/iptables restart

Fix Ubuntu 64 bit VLC Player No Video Output

To do:

Tools > Preferences > Video > Output

Select OpenGL video output

Ubuntu sudo without password


$ sudo visudo


%username%     ALL=(ALL) ALL

%username% ALL=NOPASSWD: ALL

Save and exit.

Convert between RPM, DEB, TGZ, PKG,SLP packages

Install alien:

$ sudo apt-get -y install alien

Convert the package to deb:

$ alien -d package.rpm

Convert all package to deb:

$ alien -d *.rpm

Convert the package to rpm:

$ alien -r package.rpm

Convert the package to tgz:

$ alien -t package.tgz

Convert the package to solaris pkg:

$ alien -p package.pkg

Convert the package to slp:

$ alien --to-slp package.slp

Linux clear cache

You can clear memory cache in linux:

As root:

$ sync
$ echo 3 > /proc/sys/vm/drop_caches


Create a script to run as commnad.
In Terminal:

$ sudo cat <> /user/sbin/clearcache     (No space inside <>)
> #!/bin/sh
> # The script to clear memory cache.
> sync
> echo 3 > /proc/sys/vm/drop_caches
> eof
$ sudo chmod +x /user/sbin/

Save and Close

In terminal:

$ sudo clearcache

Check processor spec in linux

Use cpuinfo:

$ cat /proc/cpuinfo

Use dmidecode:

$ dmidecode -s processor-family

$ dmidecode -s processor-manufacturer
$ dmidecode -s processor-version
$ dmidecode -s processor-frequency