Jun 25

It couldn’t get much easier then this. Assuming that your SAN is on 192.168.168.168 and that your lun doesn’t need CHAP authentication, give these commands a run.

iscsiadm add discovery-address 192.168.168.168:3260
iscsiadm list target
devfsadm -i iscsi

Now you can run format and access that disk,
enjoy!

Jun 12

For better or worse, vmware server puts a file onto your harddrive that it uses for memory of a virtual machine. Anyone that has ever had a server that has had to dig into swap knows how much your machine will drag when hard drives are substituted for memory.  Since vmware puts the memory file on disk by default, you are essentially always hitting the drive for most memory operations.  On my workstation (dual quad core with 16 gig of RAM and a 4 disc RAID 5 array) my machine would come to a crawl everytime a VM got busy due to high IO waits.  To fix that, we’re going to mount /tmp as tmpfs (a RAM backed file system that uses physical memory as the disc instead of a hard drive, wicked fast) and tell vmware to store all of it’s memory files in that directory.  This is a two step process. The first is to add the following line into /etc/fstab and then reboot

tmpfs        /tmp        tmpfs    size=12000000k 0 0

Replace the size parameter with the amount of memory that you would like to dedicate to VMs.
Now stop vmware and add the following line to the bottom of /etc/vmware/config

mainMem.useNamedFile=FALSE

Reboot and restart your wicked fast VMs!

Jun 11

FUSE and sshfs are two amazingly useful pieces of tech that exist in the linux kernel. The idea of FUSE is to allow file system drivers to exist in user space instead of requiring kernel support. sshfs allows you to mount a remote file system using ssh and access it just like you would any other file system. I use it, for example, to mount my remote website provider to do backups and copy files around. Good stuff. So here are the three little commands that you’ll need to run in order to use sshfs in Ubuntu. This has been ripped from various sources on the internet, so props to the authors.
Install sshfs

sudo apt-get install sshfs

Add your users to the fuse user group where $USER is your userid

sudo adduser $USER fuse

Mount something where $USER is your remote userid and $REMOTEHOST is the remote system you want to mount.

sshfs $USER@$REMOTEHOST:/files /mnt/files

Unmount it when you’re done

fusermount -u /mnt/files

Really neat to play with and the remote nodes don’t have to be linux. They can be solaris, AIX, etc

Jun 10

Regardless of the motivation, sometimes you need an encrypted space to hide stuff and things. Linux has some fairly advanced disk encryption abilities provided by the dm-crypt module. dm-crypt is part of the device mapper suite that is more commonly associated with LVM. I’m assuming that you want to encrypt the first partition of your sdb disk for this tip and that you want to use AES encryption.
First, create the encrypted device.

cryptsetup -y create vault /dev/sdb1

You’ll be prompted to enter a passphrase twice. Next, put a file system on that device.

mkfs.ext3 /dev/mapper/vault

and lastly, mount it and use it!

dmsetup remove /dev/mapper/vault

Subsequent mounts will prompt you for a password. It really was just that simple. Enjoy!

Jun 6

sometimes, you need to take your mp3s another direction, so when you need to go from mp3 to wav, use mpg123 like so

mpg123 -w name_of_wav.wav name_of_mp3.mp3

« Previous Entries