Friday, 4 December 2009

Restart Windows Server Remotely

Found ourselves in a situation today in that we needed to restart a remote Windows Server which wasn't accepting RDP connections and didn't have a DRAC or any other method of remote access.

Running the shutdown command from another workstation/server with the following switches did the job:
shutdown /m \\targetcomputer /r

Usage
/m \\targetcompter - specifies the target computer
/r - restarts the computer

Hardly rocket science, but a nice tip non the less.

Tuesday, 15 September 2009

Moving ESX Service Console using CLI

Today a NIC in one of our ESX (3.5) Servers failed. Unfortunately, the NIC that failed was running a few Virtual Machines, and the Service Console (I know, I know...) Luckily (because I wouldn't have it any other way), the server had a DRAC card and we still had access to the console, so all was not lost.
We were able to move the Service Console to the other vSwitch using the following commands:

esxcfg-vswif -d vswif0
esxcfg-vswitch -D "Service Console" vSwitch0
esxcfg-vswif -A "Service Console" vSwitch1
esxcfg-vswif -a vswif0 -p "Service Console" -i 192.168.3.53 -n 255.255.255.0

Once we had restored access to the Service Console, we could move the VM's to the other vSwitch using the viclient.

Thanks to the following websites for guidence:
http://www.petri.co.il/forums/showthread.php?t=32229
http://vmware-land.com/esxcfg-help.html

Thursday, 11 June 2009

How to mount Windows (SMB/CIFS) shares in Linux (Ubuntu)

1. Install smbfs package
sudo aptitude install smbfs

2. Create the directory where you will mount the share
mkdir /mnt/share

3. Create a file to store the credentials...
nano /etc/cifspw
...and enter the username/password
username=enter_username
password=enter_password

4. Edit fstab to mount the share at startup
sudo nano /etc/fstab

//server/share /mnt/share/ cifs credentials=/etc/cifspw,domain=DOMAIN 0 0

5. Mount the share
sudo mount -a

Sunday, 7 June 2009

Creating Ringtones for iPhone using iTunes

1. Select the song you want to convert to a ringtone in iTunes. Right-click and choose 'Get Info'. Click the Options tab. Set the Start and Stop time for the sample (no more than 30 seconds). Click OK.

2. Right-click the song in iTunes again and select 'Create AAC Version'. This will create a sample of the original track in iTunes to the length you set in step 1.

3. You can now set the original song's start / stop time back to how it was (undo step 1).

4. Right-click the sample track in iTunes and select 'Show in Windows Explorer'.

5. Drag the new file to your Desktop (or any other folder).

6. Delete the sampled track from iTunes (right-click, delete). The file can be moved
to the Recycle Bin.

7. Browse to the copy of the track you made in step 5. Right-click and rename. Change the extension from .m4a to .m4r.

8. Import the file back into iTunes (File -> Add File to Library) and it will be added to your library as a Ringtone.

That's it!

Friday, 13 February 2009

Adding external emails in AD Distribution Groups

Today I've been 'playing' with EventTriggers as detailed in an earlier post How to use Eventtriggers.exe to send e-mail based on Event IDs.

I'm using bmail to fire off an email when an EventID (2031) is logged (by a performance alert) in the Event Viewer.

Todays challange was that I wanted to send the resulting email notification to multiple recipients, some of which were in the format [mobilenumber]@esendex.net (which delivers the email alert as an SMS to a mobile phone).

I found the first part of the solution on the following website:
Adding external emails in AD Distribution Groups - Spiceworks Community

By creating a Distribution Group in Active Directory, and adding my contacts to that group, I could now send the alert to the email address of the distribution group and let Exchange do the rest.

The second part of the solution was to add an SMTP Connector to our Exchange server to forward emails addressed to [mobilenumber]@esendex.net through to my Esendex account which would deliver the email as an SMS to an oncall engineers mobile phone. If I wanted to be really cruel, I could address the email to [mobilenumber]@voice.esendex.net and this would deliver the email as a voice message!

(WARNING! shameless plug alert)
Take a look at these websites if you want more information on Email to SMS, configuring an SMTP Connector for Exchange, or any of Esendex's Services.

Thursday, 12 February 2009

Initial thoughts on Internet Explorer 8

The Weekly Web Usage reports I receive from ISA Server show me that Firefox is the top web browser at Esendex HQ. The reports also show me that Jonathan is the top web user, Sunny is shopping for a new fireplace, and Drew likes Strictly Come Dancing!

Me, I've always been an IE man. And I have to say that I'm liking some of the new features in Internet Explorer 8, which I've been using for the past couple of weeks. I particularly like the Accelerators, which help me quickly perform my everyday browsing tasks; like Blog with Blogger, Define with Wikipedia, and Map with Google Maps. Try it, you might like it.

iPhone Batteries for Dummies

I love my iPhone, I really do. I'm not ashamed in the slightest to admit that to the whole world. It's right up there on my list along with my family, Xbox 360, VAIO Laptop, Curry, PES, and SAFC (in no particular order).
However, there are 2 things which really bug me about it:
1. I have to put it down to change the channel on the TV. My IPAQ RX3715 could change the channel on TV, why can't my iPhone? I suppose I'll have to wait for a Bluetooth TV.
2. The battery life is awful. Even when I leave it on charge all night, it barely makes it to the end of my working day :( handy for those times I go for a swift half after work though ;)

I followed a few of the recommendations on Apple's website to see if I could get a couple of extra hours out of the battery. By disabling location services and a Google Mail account, and dimming the screen slightly, I seem to be just about making it to the end of the day. Nice one.

Managing logs with Forfiles

The Esendex Development Team like blogging. There's only one thing they like more than blogging and that's logging. They like logging so much that it has been known for their logs to consume large amounts of disk space, even fill it entirely on one or two occasions. In the past this kept my colleague Chris very busy. He would manually connect to each server on a biweekly rota and clear down the logs directory; a complete waste of a valuable resource, I'm sure you'll agree.

We looked at a way to automate his task and came across a very simple solution using an old command Forfiles. By scheduling Forfiles to run as a Scheduled Task, once a month, using the following parameters, we keep the logs directory at a sensible size.

C:\WINDOWS\system32\forfiles.exe /p D:\esendex\logs /d -30 /c "CMD /C del @FILE"

Hardly Rocket Science but Chris' time can now be put to much better use. "Milk no sugar, Chris"

How to use Eventtriggers.exe to send e-mail based on Event IDs

I discovered today that a service on an application server was terminating unexpectedly and restarting. Filtering through the event viewer I was shocked to find that this has been occurring quite frequently of late, and would need to be monitored more closely. Monitoring event logs can be a tedious task; an email notification, when a specific Event ID was logged, was definitely the way forward...

One of the best new features in Windows Server 2008's Event Viewer is the 'Attach Task to This Event' option. By right-clicking on an event and selecting this option, you can schedule a task that will be triggered if the event is logged. Actions for a triggered event include 'Send an email'. And using Esendex's Email-SMS service, we can quickly get a notification to an on-call engineer. Very nice...

Unfortunately, for me, this particular box is Windows 2003. So 'nice new feature' wasn't an option.

A quick Google search returned the following article on the Petri IT Knowledgebase:

How to use Eventtriggers.exe to send e-mail based on Event IDs

Using a combination of: Performance Logs and Alerts, Event Viewer, and Eventtriggers we now have a proactive rather than reactive monitoring tool.