Posts

Resolving Dual Display problem with ATI Cards in ubuntu

Open the AMD Catalyst Control Center by using the following command: $ sudo amdcccle Navigate to the Display Manager, where you will see your connected monitors. Click on the monitor you want to configure for dual display. Go to the Multiple Screen tab. Select your preferred display mode. Apply the changes and restart your system.

Passing password to ssh connection on the commmand line

~$ sudo apt-get install sshpass You can now use sshpass to provide the password in the command line as follows: ~$ sshpass -p 'mypasswd' ssh user_name@myserver.com -p 1600 Here, -p 1600 specifies that the SSH connection will be made on port 1600 of the server.

Nagios on ubuntu

Here’s the HTML version of the rewritten content: ```html In this Scenario We have two machines: one running Ubuntu Server 10.04, which will be used for Nagios monitoring, and another running Ubuntu 10.10, serving as a remote host to be monitored. Both machines have a minimal installation. On the Nagios Server Install Required Packages: root@nagios-ubuntu:~# apt-get -y install ssh php5-gd gcc make build-essential libgd2-xpm-dev libssl-dev Create a User for Nagios: root@nagios-ubuntu:~# useradd -m nagios root@nagios-ubuntu:~# passwd nagios When a new user is created, a group with the same name is typically assigned. However, it's good practice to create a dedicated Nagios group and add the Nagios user to both this group and the www-data (Apache2) group: root@nagios-ubuntu:~# groupadd nagios root@nagios-ubuntu:~# usermod -G nagios nagios root@nagios-ubuntu:...

Adding Virtual nic's to *nix

Sometimes, we need to add virtual NICs to our *nix machine. To do this, copy the eth0 configuration file from /etc/sysconfig/network-scripts/ : [root@test ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1 Edit the ifcfg-eth0:1 file and remove the "HWADDR" line: [root@test ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0:1 After editing, the file should look like this: DEVICE=eth0:1 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 IPADDR=192.168.56.102 GATEWAY=192.168.56.1 TYPE=Ethernet USERCTL=no IPV6INIT=no PEERDNS=yes You can then use the ifup command to bring the virtual NIC up: [root@test ~]# ifup eth0:1 In Debian and other Debian-based distributions: Open the interfaces configuration file: root@debian:~# vim /etc/network/interfaces The file will look like this: auto eth0 iface eth0 inet static address 192.168.56.101 netmask 255.255.255.0 Ad...

Playing with Apache TomCat

Apache Tomcat, often referred to simply as Tomcat, should not be confused with the Apache web server. While they are frequently used together, they are separate entities. Apache Tomcat is an open-source servlet container developed by the Apache Software Foundation, implementing the Java Servlet and JSP specifications to provide a "pure Java" HTTP web server environment for Java applications. Installing Apache Tomcat on Linux First, download the latest stable version of the JDK. For this guide, we will use JDK 7. Installing Java SE Development Kit 7 Download JDK 7: [root@centos garbage]# wget http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.rpm Install JDK 7: [root@centos garbage]# rpm -ivh jdk-7-linux-i586.rpm Verify the installation: [root@centos garbage]# java [root@centos garbage]# java -version java version "1.7.0" Java(TM) SE Runtime Environment (build 1.7.0-b147) Java HotSpot(TM)...

Demonstrating your play ground

Sometimes you may want to share what you're doing in the terminal with others. To do this, switch to the shell you want to display and use the following command: # shell_name -i |& tee /tmp/show For example: # bash -i |& tee /tmp/show Others can then view your terminal activities by typing: $ tail -f /tmp/show

Viewing directory listing

In Linux/Unix, there are times when you might want to view only the directory listings, excluding files. You can achieve this with the following command: -bash-3.00# ls -l | egrep ^d