Archive for the 'Linux/Unix' Category
May 8th, 2008
cp to copy from Current to previous directory
It took me a couple of minutes to figure out the syntax for command to copy files from the current folder in linux to the directory or folder one level up, so here is it
cp -r . ../
the imax | 10:36 pm | Linux/Unix | No Comments
March 18th, 2008
SecureCRT a nice piece of terminal software
I had a requirement in which I wanted to open SSH sessions with multiple hosts from Windows , execute some commands and than save the output in a log file. I was looking for some software to automate this and found SecureCRT . It has some very nice logging and automation abilities, with the ability to over write a log file or to just append to it, similarly there is also the macros feature and you just give the required commands once and than afterwards just rerun the macro by a single click.
At startup you can select multiple connections to connect and don’t have to individually login to each host , this is a real blessing If you have to connect to 20+ hosts at a time
the imax | 9:16 pm | Linux/Unix | No Comments
March 18th, 2008
LPI 201 Exam
Just want to share that I took the 1st exam of the LPIC 2 series i.e. the LPI 201 paper last week and have fortunately passed it . Now just one more exam to go in the LPI series , hopefully I will also take it in 3-4 months.
This time to paper was not very difficult as after clearing the level one exams I had an idea of what to expect .
the imax | 9:04 pm | Linux/Unix | No Comments
December 24th, 2007
Using Intel D102GGC with Linux
I happened to have the Intel D102GGC board since last year (with a SATA hard drive) and was unable to successfully install any Linux distribution including RHEL and SuSe 10 on it and I had practically give up the hope of using Linux under this motherboard and had turned to using Vmware for experimenting and learning Linux.
Yesterday I gave one last try by upgrading my BOIS to the latest version available at the Intel website for D102GGC board, it turned out that the version I had running that was dated back to 2005 and there were many updates available to it.
After upgrading the BIOS I one again tried to install RHEL 4 and this time everything worked out flawlessly and finally RHEL is now running fine on my system.
Please note that I also had to pass acpi=off parameter to kernel to successfully boot, other than this it was just click and forward
the imax | 6:15 am | Linux/Unix | No Comments
December 22nd, 2007
How to Stop non root users from shutting down Linux
If your users have KDE to logon to the system and you want to disable the visual buttons of shutdown and restart for non root users than use the following steps
Go to start menu > control center >system administration > login manager > shutdown
and select allow shutdown local to root only, this will prevent other non root users from messing around and shutting down your system.
Users may also open a terminal and bring the system down from the shutdown command (or many
of its alias like reboot/halt)so you may also need to adjust the execute permissions on these files.
the imax | 6:13 am | Linux/Unix | No Comments
December 19th, 2007
Passed LPI Level 1 Certification
A few months (or more than just a few ) back in February I had posted about passing the LPI 101 exam, which is the 1st exam that you need to pass in order to obtain the LPI Level 1 certification. The second exam required for LPI Level 1 cert is exam 102. A few days back I also passed this exam, so I am now a proud LPI certificated professional.
I will now look for going ahead and gaining the LPIC level 2 certification , unfortunately is appears that there is not enough study books or material available to specifically prepare for the LPI 2 certification. The only Book available is O Reilly LPI Linux Certification in a Nutshell , which I have not found to be very useful . The best book was LPIC I Exam Cram 2 by Que Publishing but there isn’t any LPIC 2 book in this series.
For anyone looking to prepare for the level 1 certification I will strongly recommend the Exam Cram book from Que or if you are already a advanced user of Linux than the O Reilly LPI Linux Certification book is fine as it will quickly get you through all the objectives and important commands used in the exam without emphasizing much on the underlying concepts .
the imax | 7:02 am | Linux/Unix | No Comments
September 16th, 2007
SuSE Live DVD and VMware
Continuing my experiments with SusE and vmware , I downloaded SuSe 10.2 live DVD to play it via VMware, however it was not working and whenever I selected to boot Gnome or KDE it gave and error that “at least 512MB is required”
I turned out that the Vmware virtual machine that I create for Suse had allocated 256MB of RAM whereas 512MB is required for the Live CD, I increased the RAM size from 256 to 512 and the live version started working properly , though too slow at times.
the imax | 6:04 pm | Linux/Unix | No Comments
September 12th, 2007
Asterisk and VMware disk detection problem
I have downloaded asterisk (trixbox) CD and have tried installing it via VMware on my Windows XP but asterisk is failing to detect the virtual drive of Vmware and installation is not successful , I wonder if someone has successfully installed asterisk on vmware in Windows?
EDIT: It is working now, you just need to select IDE drive instead of SCSI in the virtual machine, this parameter is not modifiable so you will need to create a new virtual machine having IDE option for disk drive.
the imax | 5:04 pm | Linux/Unix | No Comments
June 11th, 2007
Way to unzip files from SSH Telnet FTP ?
Yes you can unpack a tar archive which has gz / bz or any other UNIX native form of compression from SSH or telnet but if you upload a zipped archive to your server than uncompressing/extracting it is not always simple and sometimes not even possible.
The only way that I have found is via PHP, but for that the server must support PHP unzip function, you make a simple php script that tells the sever to unzip the archive.
You cannot unzip directly from SSH unless you have the unzip package installed, which most of the server don’t have.
Unzip or extracting from FTP is not possible as FTP is only a file transfer protocol and is very restricted in what it can do.
the imax | 2:12 am | Linux/Unix | No Comments
June 7th, 2007
How to specify a file as input for grep or awk ?
Now that is a very basic thing! But it is not that simple when you are doing it for the 1st time and you don’t have much knowledge of scripting.
Suppose you want to write a script that counts that in how many lines the name of certain fruit came in a file
From command line you can do this by
grep –c apples datafile.txt
Now if you many things that you need to count then you will have to type the above commands for each of them but this can be also done through a small script but the question is that if I have many different data files than how I run the same script on all of them? The answer is in $1, $1 is the 1st parameter given from the command line to the script (which would be the name of data file in our case
#!/bin/bash
grep -c apples $1
grep -c mango $1
grep -c orange $1
save the above script in a file ‘myscript’ set execute permissions and than for any datafile you can all the script by
./myscript datafile