If you wish to change the time of your Linux based system by keeping your current time zone intact, then run the following command with necessary modifications to get it done.
date -s “26 Feb 2010 18:52:00″
I ran into a problem today, my team member asked me to password protect a directory in such a way that when someone access it via Web URL, it should first ask for password. Once user is validated then it should lead him/her to the actual web page.
Guess what is the most easy way to do it, I followed the following method and it worked perfectly. Since Apache is the web server and usually it is handling hundreds of websites on a single server so it is not a wise way to make changes in its configuration file often. We will achieve it via .htaccess.
Now go into the directory in which you wish to apply this restriction and create a .htaccess file (off-course if this does not exist already) and add the following lines with necessary modifications ( The only modification will be that you will need to change the path of the root directory of your applicaton).
AuthType Basic
AuthName “Admin”
AuthUserFile “/var/www/html/MYAPP/passwd”
require valid-user
Now create a file with name passwd at /var/www/html/MYAPP/ path and add the username and password in the following formate:
admin:K1/BaQTbqe0Eo
where admin is the username and the encrypted value after: is the password.
Restart apache service and you will be seeing the login prompt appearing on application launch.
Today morning, I was stunned to see the Google Buz loaded into my Gmail accout. Upon exploring I figured it as a great thing. Let me list down the key features of Google Buzz:
- Auto-following
- Rich, fast sharing experience
- Public and private sharing
- Inbox integration
- Just the good stuff
Symfony is the collection of classes written in PHP and it is the most commonly used PHP Framework. Here are the steps to install it in Linux ( The following instructions should work on all Linux distros, I followed them on Fedora Core).
First of all make sure that Pear is already installed, open the terminal and download the go-pear file by running the following command:
wget http://pear.php.net/go-pear
Once the go-pear is downloaded, run the following command to install Pear to your system.
php go-pear
Then follow the onscreen instructions and you are done with the Pear installation in some time. Once the Pear installation is completed, then it is the piece of cake to install symfony. ( Sometimes symfony may also require the ‘dom’ extension to be loaded).
CD Ripping with Linux doesn’t have to be the labor intensive task that it once was. No longer do we have the days of writing a hundred character command to rip a CD with the perfect options. Here are some utilities aimed at making your life of ripping your collection of CD’s to a digital format you can actually use.
Whenever you need to use scp to copy files, it asks for passwords. Same with rsync as it (by default) uses ssh as well. Usually scp and rsync commands are used to transfer or backup files between known hosts or by the same user on both the hosts. It can get really annoying the password is asked every time. I even had the idea of writing an expect script to provide the password. Of course, I didn’t. Instead I browsed for a solution and found it after quite some time. There are already a couple of links out there which talk about it. I am adding to it…
Lets say you want to copy between two hosts host_src and host_dest. host_src is the host where you would run the scp, ssh or rsyn command, irrespective of the direction of the file copy!
- On host_src, run this command as the user that runs scp/ssh/rsync
$ ssh-keygen -t rsa
This will prompt for a passphrase. Just press the enter key. It’ll then generate an identification (private key) and a public key. Do not ever share the private key with anyone! ssh-keygen shows where it saved the public key. This is by default ~/.ssh/id_rsa.pub:
Your public key has been saved in <your_home_dir>/.ssh/id_rsa.pub.
Ngrep is one of the most commonly used network sniffing tool which is used to capture traffic on network interfaces. It is most commonly used with in the VoIP (Voice Over IP) industry. Lets see how we can install it with couple of minutes.
First of all make sure that you are in the directory where you download packages, I always prefer /usr/src, and run the following command to download its RPM.
wget ftp://ftp.muug.mb.ca/mirror/fedora/linux/updates/11/x86_64/ngrep-1.45-6.1.fc11.x86_64.rpm
Once the download is complete, you can easily install the rpm by running the following command:
VPN (Vitual Private Network) is very much in the market now. VPN is fix to many problems with respect to network and many IT professionals are using it to overcome various issues. Lets see how we can create our own VPN in Linux using PoPTop (pptp) Protocol.
PoPTop is a utility which creates VPN. Simply run the following command to install poptop (pptp) on Linux based system:
yum install pptp
Once the installation is over, you will find its configuration files located in the /etc directory. There are four configurations which we need to take care in order to work with pptp. Here are they:
- /etc/modules.conf
- /etc/pptp.conf
- /etc/ppp/options.pptp
- /etc/ppp/chap-secrets
Lets see what each file contains and what settings are required in these configuration files.
/etc/pptp.conf
It contains the default configurations of the pptp, like the executable name ctc. The default settings of this file work and no change is required except any exceptional situation.
/etc/modules.conf
It contains the list of the installed modules w.r.t to poptop. So the default configurations of this file should be kept untouched.
/etc/ppp/chap-secrets
This is the one file which should be changed, here you actually create the users for accessing this VPN. Here you specify the username and password and then these username and password can be used to connect to this VPN. Here is my chap-secrets file. I have created one user with name aun and raza12 and here are contents of my chap-secrets file:
Logrotate is the linux’s utility which lets you rotate or remove the large log file. If you monitor log files of mailserver or system logs then you might have noticed that after some particular time, old log file is renamed and compressed to something like .old etc. This is because most of the server level logs are configured to be compressed via logrotate utility.
While monitoring your Linux server, you found that any particular process is causing load, what you will do? Kill the process to get rid of it.. Good but it is always better to identify the root cause of problem. Find out from which directory this process is running.