Wednesday, March 28, 2012

Check CentOS version

To check the version of CentOS,
cat /etc/*release*
Hope this helps.

Monday, February 13, 2012

Installing Ninja-IDE on openSUSE

Ninja-ide Is Not Just Another IDE for Python. If you get errors like below on installing the Fedora Package on openSUSE :
# rpm -ivh ninja-ide-2.0_beta3-2.noarch.rpm
error: Failed dependencies:
PyQt4 is needed by ninja-ide-2.0_beta3-2.noarch



Then, do this:
# rpm -ivh --nodeps ninja-ide-2.0_beta3-2.noarch.rpm



It is PythonQt4 for openSUSE.

Sunday, November 6, 2011

Change the default SSH port on Linux

OpenSSH server uses TCP Port 22 by default.Since, it is a common target for hackers and brute-forces, it is a good practice to change the port to something higher.Let's assume that we want to change the port to 2222, then as root,

nano /etc/ssh/sshd_config


Edit the line which says Port 22 to Port 2222.

Do remember that the port should not be in use by another program or service.Now,restart SSH server via

service ssh restart


You may want to setup your IPtables rules or other firewall rules to allow incoming TCP packets in port 2222.In case you are using ufw ,you would do ,

ufw allow 2222/tcp

Tuesday, November 1, 2011

Setup Static IP Address on Debian 6 (Squeeze)

During installation, Debian uses DHCP by default.You should disable DHCP feature for primary network interface by editing /etc/network/interfaces
By default, it looks like following:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo
inet loopback


# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp



We should make this look like:


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo
inet loopback


# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.1
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1



You may not need to enter network and broadcast details.
Now, restart service by 
/etc/init.d/networking restart