Archive

Archive for the ‘Command Line’ Category

How To Install Suns VirtualBox tools on a Centos Virtual Machine

July 22nd, 2009 No comments

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

Categories: Centos 5.2, Command Line, VirtualBox Tags:

How To Turn Off Overwrite Request on when you copy in Centos

July 15th, 2009 No comments

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.

How to Find Large Files using Linux Command Line

May 7th, 2009 No comments

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

Great Site For Scripting and Command Line

February 26th, 2009 No comments

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

Categories: Command Line Tags: , , ,

How to Setup SSH X Forward from a Remote Centos Server to Vista

February 17th, 2009 No comments

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.

The Best SSH Client for Vista

February 13th, 2009 No comments

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;

  • one of the most advanced graphical SFTP clients;
  • state-of-the-art terminal emulation with support for the bvterm, xterm, and vt100 protocols;
  • support for corporation-wide single sign-on using SSPI (GSSAPI) Kerberos 5 and NTLM user authentication, as well as Kerberos 5 host authentication;
  • support for RSA and DSA public key authentication with comprehensive user keypair management;
  • powerful SSH port forwarding capabilities, including dynamic forwarding through integrated SOCKS and HTTP CONNECT proxy;
  • powerful command-line parameters which make Tunnelier highly customizable and suitable for use in specific situations and controlled environments;
  • an advanced, scriptable command-line SFTP client (sftpc);
  • a scriptable command-line remote execution client (sexec) and a command-line terminal emulation client (stermc);
  • an FTP-to-SFTP bridge allowing you to connect to an SFTP server using legacy FTP applications;
  • WinSSHD remote administration features;
  • single-click Remote Desktop forwarding.

A Good Centos System Administration Book

February 3rd, 2009 No comments

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?

How to Copy a File To and From a Remote Server Using SCP

December 20th, 2008 No comments

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/*” .