JB's Blog

/au/SysAdmin

Archive for the ‘Technical’ Category

What you don’t want to see on a Monday morning….

without comments

Kernel fault.

What you dont want to see

Written by JB Hewitt

March 29th, 2011 at 3:01 pm

Posted in Linux,sysadmin

Need to delete old emails – archivemail to the rescue

with one comment

I have a few customers who have massive Spam traps and Catch-all email accounts.  These accumulate an enormous amount of email, and like any good tree need to be pruned.

I was going to write a small PHP script, or some crazy sieve scripts but of course someone has been there, done that, and compiled the source already for me.

An easy solution is to use archivemail - http://archivemail.sourceforge.net/

archivemail  --delete --days=60 imaps://spambox:hereismyawesomepassword@lansmash.com/INBOX

 

Archivemail will let you delete emails older than a date or time and works with IMAP, POP3, etc

Written by JB Hewitt

September 9th, 2010 at 12:08 pm

Posted in Linux

HowTo add a USB device permanently with VirtualBox 3.0+

with 13 comments

So I was having a little trouble adding a USB device permanently to a Virtual Machine guest with VirtualBox. The trick is to use the VBoxManage command to add a USB filter into the Machine’s configuration which will automagically attach whenever the VM is run.

First, find a list of all usb devices on the host, remembering to run these commands as the user your VirtualBox machine is under. In this example we’ll be using a Canon MX7600 printer as a test USB device.

$ VBoxManage list usbhost

UUID:               6bac41f4-cc44-40e4-a726-4d9655a49f63
VendorId:           0x04a9 (04A9)
ProductId:          0x171c (171C)
Revision:           1.3 (0103)
Manufacturer:       Canon
Product:            MX7600 series
SerialNumber:       102787
Address:            /proc/bus/usb/007/004
Current State:      Captured

Now we use the details of the USB device to filter adding into our VirtualBox machine. In this case our VirtualMachine name is winxp.

The usbfilter command requires four options at a minimum.

VBoxManage usbfilter        add
--target ||global
--name
--action ignore|hold (global filters only)
[--active yes|no] (yes)
[--vendorid ] (null)
[--productid ] (null)
[--revision ] (null)
[--manufacturer ] (null)
[--product ] (null)
[--remote yes|no] (null, VM filters only)
[--serialnumber ] (null)
[--maskedinterfaces ]

So armed with this info let’s add our device.

VBoxManage usbfilter add 0 –target winxp –name canonmx7600 –action hold –active yes –vendorid 04A9 –productid 171C –revision 0103 –manufacturer Canon –product “MX7600 series” –serialnumber 102787

Written by Blade

January 27th, 2010 at 11:39 am

TightVNC and Vista

with 36 comments

TightVNC is a great opensource remote administrating program.

For Vista you need to massage it a little for optimum results, I just thought I’d write down some notes here to share how I use it with Windows Vista machines.

-= Don’t run TightVNC as a Service =-

Unfortunately you can’t run TightVNC effectively as a Windows service. As a work-around you can copy the TightVNC Server Icon into the Startup folder.

-= Disable Windows Aero =-

You’ll find under VNC Windows Vista machine screens wont refresh properly, windows appear black, don’t look right, and generally painful. It’s easy to fix though, you just have to disable Windows Aero.

1) Right-click on the desktop and choose Personalize. Click the “Window Color and Appearance” link:

200903191103.jpg  

2) Click the link near the bottom for “Open classic appearance properties for more color options”

200903191103.jpg

3) Now disable Aero altogether by choosing Windows Vista Basic instead of Windows Aero. You could also switch to Windows Classic but some users complain with this.

200903191102.jpg

Written by Blade

March 19th, 2009 at 11:07 am

Posted in Documentation

Drupal – “Content (missing)”

with 24 comments

I’ve started playing with Drupal and looking at moving a few sites over to it. In a late night session of bolting things together I ran into a bit of a snag with a few modules trying to create thumbnails on teaser articles.

Unfortunately when I installed the imagefield CCK module I ran into a snag where it wouldn’t allow me to continue without the ‘content’ module which was missing.

I attempted to search for this missing module in the drupal module downloads section with no luck… http://drupal.org/search/node/type%3Aproject_project+content gave me no joy at all.

Luckily, the a nice Drupal IRC user slapped me with a quick ‘CCK = content’ line after I pleaded where this magical ‘Content’ module is and of course after I installed the CCK module everything worked like a charm. I had thought I had already installed this module and was probably too tired to have checked this first…

So for any newbie Drupal users out there I hope you find this helpful tip on Google before you harass some poor sod on IRC… that way you might actually appear somewhat knowledgeable.

Written by Blade

September 30th, 2008 at 10:40 am

Posted in LanSmash,Linux,Technical

Tagged with ,

Macbook Pro 320GB upgrade

with 8 comments

Seeing my partner’s brand new MacBook Pro came with a spanking new 200GB harddisk I thought my measly 120GB disk was just not enough.

I found a nice Western Digital 320GB harddisk that was quite cheap, and set about taking my Macbook Pro apart. Note to self, not a good idea to start such projects on the coffee table when drunk. The procedure went fairly smoothly since I had my Torx screwdrivers handy.

With the old harddisk out and the new one in I started installing a new copy of Mac OS X. I had my trusty USB harddisk recovery tool handy so I was able to plug the old 120GB disk into the Mac’s USB port and use the Migration Assistant to copy over my profile to the new drive.

I just love the Migration Assistant, without it this job would have been a longer more painful process….

Anyhow, after two weeks of using the new drive I’ve had a minor catastrophe.

Coming home one afternoon I took out my bag and found Macbook to find it red hot. The machine had been running inside the bag and with no air circulation…. Yikes! I thought at first it might be something to do with the Sudden Motion Shock detection systems messing with the auto startup, but no it was the lid sensor.

I put the machine to sleep and held it up; pinching the closed lid made the machine start back up. Obviously the magnetic sensor that detects the position of the lid was slightly out of alignment. I’m sure an apple technician could re-align it, but instead I just changed the lidwake behaviour.

$ sudo pmset -a lidwake 0

Typing this command sets the computer to not automagically start up when I open the lid, instead it starts when I hit a key or touch the mouse.

It’s not a bug, it’s a feature. :P

Written by Blade

August 8th, 2008 at 10:00 am

Posted in Mac OS X,Technical