If you get the error
Could not find the Linux kernel header files – the directories
/lib/modules/2.6.18-128.el5/build/include and /usr/src/linux/include
do not exist.
Then you need to install the following packages.
yum install kernel sources
yum install kernel-devel
yum install gcc
Create the following link
ln -s /usr/src/kernels/2.6.18-92.1.18.el5-i686 /usr/src/linux
And now you should be able to run.
sh VBoxLinuxAdditions-x86.run
Source of this tip – http://forums.virtualbox.org/viewtopic.php?f=6&t=16721
When copying a folder in centos, it interactively asks if you want to overwrite a file, the -f flag does not work. Simple solution, use \cp.
find / -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’
or
find / -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’ > filelist.txt
To put the results in a text file.
Found here, a good resource for command line stuff – http://snippets.dzone.com/posts/show/1491
Twitter is a cool way to find great resources. Shell fu is following me so I checked out their site, sounded good. Great resource, lots of useful and advanced shell scripts and command line tips.
Check it out at http://www.shell-fu.org/
Follow me on twitter at http://www.twitter.com/howtolinux
Follow shell-fu on twitter at http://twitter.com/shellfu
You can push x server gui’s from a remote server to your local machine. This is how to send an x server gui from a remote centos machine to your vista machine.
Install Cygwin, choose the default installation package for X11 (follow the documentation).
Once installed, start the xserver with
sh /usr/bin/startxwin.sh
see - http://x.cygwin.com/docs/ug/using.html#using-starting-sh
This will create a xserver icon in the bottom right corner of your taskbar. Right click this icon and select Applications and choose xterm. Once this fires up, connect to your remote server with ssh.
In the xterm session, type;
ssh -X user@sshserver.com
Once logged into the remote server you can start your apps within the ssh session and they are piped to you cygwin xserver.
The reason I care, I was trying to get a Jmeter gui running locally for a remote server.
I have used this SSH client for the last 6 months and can heartily recommend it.
http://www.bitvise.com/tunnelier
Below are the features directly ripped from their site;
I have been a big fan of the unleashed guides every since I purchased Mac OS X Tiger Unleashed
. I loved this book as it was both great for beginners but had some reallly good advanced sections that allowed me to learn some great stuff on mac os x.
So, naturally, when I was looking for a guide to Centos, I purchased another unleashed book. As you probably know, Red Hat Enterprise Linux (RHEL) and Centos are basically the same product, minus the proprietary Redhat pieces and non GPL pieces that are not legally available for free. CentOS takes the GPL portions and repackages them as CentOS. This logically led me to Red Hat Enterprise Linux 5 Administration Unleashed
. I found this to be a decent book that is great starting point for using Centos, though not as advanced as I would have liked.
Anyone have any suggestions for an advanced system admin book for Centos?
Categories: Apache, Centos 5.2, Command Line, General, General Command Line, Mysql, Networking, Open Source, RHEL5, Security, Snort, Zenoss Tags: Centos
SCP is a usefull tool for moving files from one machines to another, if they are large collections of files don’t for get to tar them
tar -cvf mytarfile.tar mydir/
This will copy ‘filename’ from the current directory to /opt/vsites. The username must have permissions to do this on the remote computer.
scp filename username@remote.machine.com:/opt/vsites
This will copy all the files from a remote directory /opt/vsites/ that the username has read permission for. It will copy them into the current directory.
scp “username@remote.machine.com:/opt/vsites/*” .
Use -P if you use a non-standard port for ssh.
scp -P 3322 “username@remote.machine.com:/opt/vsites/*” .