#vim /etc/sysconfig/network Use something like HOSTNAME=testarossa.maranello.local to overwrite the default name and domain of the server. e.g. NETWORKING=yes HOSTNAME=testarossa.maranello.local To avoid rebooting issue the following : hostname testarossa.maranello.local That will set it for the current session.
Tag: Linux
Monitoring connections
To monitor TCP and UDP connections the following command is very useful: netstat -t -u to have a continuous update use the watch command: watch netstat -t -u There is a much stronger tool for real time analysis called iptraf. It is quite self explanatory : at command line run iptraf This tool has many functions…
Fixing Warning: RPMDB altered outside of yum
What does it mean? The yum message “Warning: RPMDB altered outside of yum.” or, as the yum message said for a few months, “Warning: RPMDB has been altered since the last yum transaction.” means some application has altered the rpm database (installed or removed a package) without going through the Yum APIs. This is almost…
Setting up NTP server
Setting up NTP is very important for a host of application especially clusters and applications like DBs requiring all the servers to be critically time-wise synced. Install NTP on Red Hat and CentOS 6 $ yum install ntp $ chkconfig ntpd on $ ntpdate pool.ntp.org $ service ntpd start Install NTP on Ubuntu $ apt-get…
Setup default gateway with route command Linux
Display default route The following three commands display the current routing table: # route Output: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 ra0 default dsl-router 0.0.0.0 UG 0 0 0 ra0 # /sbin/route Output: Kernel IP routing table Destination Gateway Genmask Flags Metric…
Installing iostat in CentOS with yum
Iostat is a very powerful tool for monitoring the throughput of your storage subsystems. Especially to locate bottle necks and pinpoint possible upgrade scenarios. Not immediately visible here is how to install it on Centos 5.x and 6.x. We shall use the whatprovides tool in yum to locate the packages that provide iostat
Installing vim editor.
To install vim [root@testarossa-00-0c-29-47-8f-35 ~]# yum whatprovides vim-enhanced Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.crazynetwork.it * epel: fr2.rpmfind.net * extras: mirror.crazynetwork.it * updates: mirror.crazynetwork.it 2:vim-enhanced-7.0.109-7.el5.i386 : A version of the VIM editor which includes : recent enhancements. Repo : base Matched from: [root@testarossa-00-0c-29-47-8f-35 ~]# yum install vim-enhanced-7.0.109-7.el5.i386 Loaded plugins: fastestmirror…
VIM cheat sheet
< The list of Vim commands > Working with files Vim command Action :e filename Open a new file. You can use the Tab key for automatic file name completion, just like at the shell command prompt. :w filename Save changes to a file. If you don’t specify a file name, Vim saves as the file name…
List interfaces and IPs neatly
The following command gives a neat list of the Devices and their IPs / details without all the gruesome details. ifconfig | egrep "Link|inet" A sample result would be: [root@testarossa-00-0c-29-47-8f-35 vm]# ifconfig | egrep "Link|inet" eth0 Link encap:Ethernet HWaddr 00:0C:29:47:8F:2B inet addr:192.168.47.135 Bcast:192.168.47.255 Mask:255.255.255.0 eth1 Link encap:Ethernet HWaddr 00:0C:29:47:8F:35 inet addr:192.168.1.71 Bcast:192.168.1.255 Mask:255.255.255.0 lo Link…
Dsabling SElinux In Centos
Sometimes and with some DB platforms especially when you are testing and want to reduce the number of variables during development, testing etc.. you don not want SELinux watching your back. While it is a must to enable SELinux in hardened production systems it can be quite a pain to handle. Sometimes it needs disabling…