February 6, 2013

OVMCLI: Standardize the Naming of Virtual Disks

Today we are going over a script I wrote to utilize the ovmcli to rename all virtual disks to follow a understandable standard, in this case we will take the vmname and append a disk identifier to it.  The first disk (slot 0) will be appended with “_system.img” with all subsequent being appended with “_dataX.img” where X is the slot number.  This is a pretty […]
February 4, 2013

OVMCLI: Standardize the Case of VM Names

So I have been working with the OVM CLI lately to try and fill in some holes in my knowledge and provide for some easily reproducible procedures, usually around consistency of the environment when performing frequent tear downs and upgrades.  So expect to see more OVM related scripts going forward. Today we are going over a fairly simple script.  I like to use all lower […]
August 2, 2012

Bash: Automatically Mount File Systems on Volume Group if Present

Update 09/16/2015 – I have published an updated article for this here: http://blog.allanglesit.com/2012/08/bash-automatically-mount-file-systems-on-volume-group-if-present/ In my laptop I have a solid state disk, and frankly I am way past addicted to solid state disks, but what you get in performance you lose in capacity.  As such I have had to be creative with how I can have the capacity and the performance that I need.  Lately the […]
May 29, 2012

Bash: Programmatically Add Entries in fstab

So I have found that it is rather easy to add entries into /etc/fstab while maintaining relatively legible scripts and making the changes with minimal user interaction… METHOD ONE This option is the simplest, we simply echo the line into the file as we want it to appear, then based on the >> it is added as the last line in the file.  This is […]
May 1, 2012

Bash: A Better Way to Sed

So I frequently find myself in a situation where I need to modify files on a fairly programmatic basis, so sed has become a friend of mine for a lot of these situations.  So lets start with some basic sed… If I have a file.. And I want to replace “teststring” with “productionvalue” then I could use sed. This is all well and good, but […]
April 30, 2012

Bash: Duplicate Logical Volume Configuration for a Volume Group

I recently ran into a situation where I needed to create a large number of Logical Volumes for a server replacement situation.  I could have done some manual data input, but why not take the opportunity to quickly write a script to do the hard work for me? For my situation this was a server that pulls data from other servers in order to optimize […]
January 12, 2012

Mass Extraction and Creation of Tarballs

I have been working on creating a bunch of debootstrap images lately, and I ended up doing a whole bunch of work creating tarballs and did it wrong.  So I took the time to sort out an easy way to fix them all with two commands. The Core of My Problem So what started this is I forgot to “stand” in the directory I was […]
August 10, 2011

Bash: Using Temporary SSH Keys Within A Script

Every once and a while you will have the need to make multiple ssh calls to remote systems within a bash script.  Normally you would simply have the user enter their password multiple times, or have a requirement for SSH keys to be configured prior to running the keys.  This is widely accepted as the way to do it, however if that were the best […]
August 9, 2011

Bash: Using pv to Display Progress of dd

One of the biggest weaknesses of dd is that it has no way to display progress on its actions.  You can send a signal to the process which will pause, display statistics, and resume the process however this takes up alot of your terminal screen if you are doing any sort of long running copy.  Enter pv.  Pv allows us to monitor the progress of […]
+1 (844) 368-2747