Linux / Unix Tips and Tricks

This blog contains Linux / Unix Tips and Tricks, collected during my work as a Unix System Administrator.
They are here for my own reference, but they might help you as well !

Solaris 10: Enable Samba for Windows File Sharing

len | 23 December, 2008 09:44

Today I got a question about users that want to access some FIX logfiles on a Solaris 10 server.
Of course you can give them (restricted) ssh access so they could access the files using WinSCP,
but I thought it would be easier to enable SAMBA for them so they could access the logfiles using their Windows Explorer.  (More)

Changing Veritas device owner for raw device

len | 18 December, 2008 20:03

Today I had to set the owner/group for a Veritas raw device. You can set it on Unix using chown, but the settings will be lost after a reboot. To properly set the ownership on a veritas raw device you need the following command:

vxedit set user=username group=groupname mode=modenumber volumename

So in my case I did a

vxedit set user=informix group=informix mode=0660 rootdbs

 

Perl: how to install a Perl module locally

len | 16 December, 2008 11:05

Today I wanted to install a Perl module in my home directory. Here's how to do it: (More)

VMware Server: Managing virtual machines from the command line

len | 15 December, 2008 16:54

Sometimes it's handy to be able to manage your Virtual Machines on the Command Line.
So if you are stuck in traffic and only have an SSH login available on your mobile phone,
here are the commands to manage your Virtual Machine:

Listing configured Virtual Machines:

$ vmware-cmd -l
/var/lib/vmware/Virtual Machines/Server-01/Windows 2000 Server.vmx
/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx
 

Get the state of a Virtual Machine:

$ vmware-cmd "/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx" getstate

Start (or resume) a Virtual Machine:

$ vmware-cmd "/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx" start

Stop a Virtual Machine:

$ vmware-cmd "/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx" stop

Reset a Virtual Machine:

$ vmware-cmd "/var/lib/vmware/Virtual Machines/Server-01/RedHat5.vmx" reset

 

Setting your X environment

len | 15 December, 2008 14:15

Most Unix sysadmins are hardcore Command Line gurus. However, sometimes you may need to run a graphical application on Unix.
The graphical environment on Unix is called the X Window System (or X or X11). Unlike most other graphical systems, X is designed to be used over the network. (More)

Replacing text in multiple files

len | 15 December, 2008 07:42

Here's a perl oneliner that does text search & replace over multiple files. Make sure you create a backup before using it !

 (More)

Linux: How to extract a single file from a RPM package

len | 12 December, 2008 12:20

I once got myself in the situation where I had no option but to retrieve a missing file from a rpm package. I didn't want to install the whole rpm, but only extract the missing file. Here's an example how to extract the original httpd.conf from the httpd package: (More)

Solaris: Determinate to which package a file belongs

len | 12 December, 2008 11:45

I had an issue with software which was complaining about the version of /usr/lib/libCstd.so.1
So I wanted to know to which package this particular file belongs, in order to see if there are any updates available for this package. Here's how to do it:

 (More)

fsck: Filesystem has unsupported features

len | 12 December, 2008 10:49

Last month I have migrated several physical Linux servers to VMWare using this excellent howto: Virtualize a Server with Minimal Downtime

After migrating an old RedHat 9 server to VMWare, I got an error saying fsck.ext3: Filesystem has unsupported features.
This is because RedHat 9 does not understand the new file system features created with the Knoppix boot CD. Luckily, the unsupported file system features can be easily removed. Here is how I did it:

 (More)

How do I copy data from one system to another

len | 11 December, 2008 21:34

Suppose you want to copy a directory structure from one machine to the other.
You could create an archive (using tar or cpio), copy over the archive and extract it.
But there's a better way to do it by combining tar and ssh.
 (More)

 
Accessible and Valid XHTML 1.0 Strict and CSS
Powered by LifeType - Design by BalearWeb