Jan
21
2009
2

Windows 7 Beta running on Fedora 10 KVM

I was interested to know if the Windows 7 Beta was bootable in Fedora 10 w/ KVM/libvirt setup.  I was surprised that it was a fairly quick and flawless install.  In fact I was happy to finally see a Microsoft product worth getting excited for.

Installing Windows 7

The install was painless with no driver errors, crashes and just one reboot.  Woot.  Installs faster on Linux hypervisor than an ordinary machine!  Or at least it seemed like it.

Ugly default desktop with KDE 4.0 like widgets

So far my overall assesment is that the interface seems to be getting steadily worse since Windows XP, but performence wise it seems waaaaaay faster than Vista.  Also let me point out you can change the Desktop Theme to something that looks XP’ish.

It installed quickly and easily, detected all my drivers and seems to be faster on a limited resources VM then on my Intel 2.6 GHZ Vista system.  We’ll see as I use it further…

My fear is that I’m getting some stripped down Beta that is really fast but gets slower as we get closer to release.  If any of you have experiences you wish to share about Windows 7 and VM’s send me a post!

-Matt

Written by mattb in: Linux,Xen | Tags: , , , , , , , ,
Oct
15
2008
0

Simple Bash script that copy’s a directory of files and renames them with a Time Stamp

NOTE: I myself am a novice with BASH. I hate scripting, but hey, it’s necessary part of most sysadmin jobs. I came across several hurdles (like changing a name and adding a time stamp in the same loop). I hope this document helps. Please click on my adds, they help pay for the hosting. Thanks and enjoy.

-Matt

—————————————————————–

In this scenario I have a customer that I did a custom Asterisk(Open Source PBX) installation for.  They want the capability to backup all voicemails for management to review.  So naturally I made a cron job that copied Asterisk voicemails to a web directory that was htaccess protected.   It seemed to work except I forgot that asterisk copies messages in the format ‘msg001.wav’.

The problem is that if a user erases the messages in his/her mailbox, then the next new incoming voicemail is named ‘msg001’ again. Next, the voicemail gets copied to the web directory and overwrites the original ‘msg001’.  So my challenge is to create a cron job, that copies the new messages and then renames them on the fly with a new name and an appended time stamp.

Every minute the script copies Asterisk voicemail accounts to another arbitrary directory.   Two loops are run on the contents of that directory matching the pattern ‘5???/mess*'(or in Asterisk syntax 5XXX/mess.).  In the case of my customer their VM boxes are all 5XXX(5001,5002,etc..).  The first loops adds a time stamp from when the voicemail was originally created.  The second loop strips ‘message??’ and replaces it with ‘voicemail_’. The result being something like: ‘voicemail_2008-09-15-03:14:09.wav’. I have to change the messages part because if I dont the first loop will add a second time stamp to previously stamped files.

At the end of the script we want to delete the message00?.txt file, because it is not relevent to simply downloading voicemail and may confuse some users. Also we have to change the owner/group to apache so the web server has permission to host the files.

The voicemail are protected with ‘.htaccess’ file, but with some additional work we could make user access based on PAM, LDAP, or MySQL.

Avaya sells voicemail auditing servers for $40,000 per server. But with the Open Source Asterisk PBX and a simple BASH script we can create a comparable system for under $1,000. However this script can be re-purposed for copying and renaming files for any task. Take care.

-Matt

script:

#!/bin/bash



#set -x



# Variable containing array
#==========================================================================



DIRECTORY1=”/var/spool/asterisk/voicemail/default/????”
DIRECTORY2=”/var/www/html/voicemail/”
AUDIT=”/var/www/html/voicemail/????/INBOX/msg*.wav”
MSGFILES=”/var/www/html/voicemail/????/INBOX/msg????.txt”



# copy files to web directory
cp -ruvp $DIRECTORY1 $DIRECTORY2



#rename those files with a time stamp
for i in $AUDIT ;



do mv $i $i$(date -r $i +%F-%T).wav ;



done



#——————————————————



#strip the ‘messages’ part of the name and replace w/ ‘voicemail’
for i in $AUDIT ;



do mv “$i” “${i/msg????.wav/voicemail_}” ;



done



# remove any msg????.txt files



rm -rf $MSGFILES



chown -R apache $DIRECTORY2
chgrp -R apache $DIRECTORY2

With Apache, Asterisk and this simple BASH script we have just created a web accessible way to check and back up voicemail!