Change Computer Name to Serial

Little Windows VBS script to pull Dell BIOS serial tags into Computer Names. I pulled this from an old backup, since it got removed a long time ago for whatever reason.

strUser = "Administrator"
strPassword = "P@ssw0rd"

Set objNetwork = CreateObject("WScript.Network")
	strComputer = objNetwork.ComputerName

Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _
	strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _
		strComputer & "'")

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
	strMsg = objItem.Caption
	If strMsg = "Microsoft Windows XP Professional" Then

		winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//."
		'WScript.Echo winmgmt1
			Set SNSet = GetObject( winmgmt1 ).InstancesOf ("Win32_BIOS")
			for each SN in SNSet

				If SN.SerialNumber = strComputer Then
					MsgBox "Computer name already set! Name is: "& strComputer
					Wscript.Quit
				End If

				If SN.SerialNumber = "" Then
					MsgBox "Problem with computer naming!"
					Wscript.Quit
				End If

				ErrCode = objComputer.Rename(SN.SerialNumber, strPassword, strUser)

				If ErrCode = 0 Then
					MsgBox "Computer renamed successfully to: "& SN.SerialNumber
				End If

			Next

	End If
Next

BBSLink Client

If you have heard of or came across http://bbslink.net/ and wanted to add the services door games to your BBS but find that they only offer a javascript file for Synchronet BBSes then this might help you out.

I recently joined and not having a Synchronet BBS I had to make my own client to work with their service. It is written in C# against .NET 2.0 and *might* work in mono on Linux. You will have to test.

Local Binary: BBSLink Door Binaries
Local Source: BBSLink Door Source Code

Cisco 7965 VoIP Phone with Voip.ms

First you will need the SIP firmware for the phone, as they are supplied with SCCP firmware.
You can download a package I have built here. You can also download the latest version from the Cisco website, they are free and available with a standard Cisco website account.

You will also need a TFTP server that the phone can connect to, and if you do not force a TFTP server address into the phone your DHCP server will need to pass option 66 with the TFTP server IP address. Windows 2008 R2 DHCP options has this as 066 “Boot Server Host Name”.

Extract the zip file into your TFTP root directory and then edit the SEP#######.cnf.xml file, search for the word “FIXME” and read around those lines to fix and replace for your setup. Then rename the file to be the MAC address of the phone. Replace ######### with the MAC as the sample file has already.

You may wish to also edit the dialplan.xml file and set your area codes and other stuff.

The phone will boot up on the network, grab an IP address from your DHCP server, pull the TFTP server address from the DHCP options and then contact the TFTP server. It will pull the SEP#######.cnf.xml file that responds to the phones MAC address. After some reboots and firmware changes it should register to your SIP provider.

I have this all working for voip.ms. If you are behind a firewall you may have issues with NAT. I am using pfSense and have no issues. The phone has NAT turned off (in the config already) and voip.ms settings for the sub-account I am using has NAT set to ‘yes’.

Lots of info was found on the voip-info website.

Sonerezh Album Covers

Sonerezh is a self-hosted music streaming platform that is still fairly young. It works very well, until I recently updated to PHP7. I had to manually update the CakePHP libraries that came with it to get past a error “String is a built in function”. After I fixed that error, I decided to try and get the album cover images working.

By default Sonerezh pulls the album covers from the mp3 files themselves via the ID3 info, but I don’t keep those tags when I clean my mp3 files up I have the album art stored as ‘folder.jpg’ in the album folder itself. So I started to dig around and came up with a simple solution that works for me.

Edit the file SongsController.php inside the app/Controllers folder. Around line 93 or so it starts with pulling the photos out of the ID3 information. I added a new section and commented out the old, as displayed below:

            if (!empty($songInfo['comments']['genre'])) {
                $genre_array_length = count($songInfo['comments']['genre']);
                $newSong['genre'] = $songInfo['comments']['genre'][$genre_array_length - 1];
            }

            $extension = 'jpg';
            $name = md5($newSong['artist'].$newSong['album']);
            $path = IMAGES.THUMBNAILS_DIR.DS.$name.'.'.$extension;

            if (!file_exists($path)) {
                if (!file_exists(IMAGES.THUMBNAILS_DIR)) {
                    new Folder(IMAGES.THUMBNAILS_DIR, true, 0777);
                }
                if (copy("/...music path here.../".$newSong['artist']."/folder.jpg", $path)) {
                    $newSong['cover'] = $name.'.'.$extension;
                }
            }
/*
            if (isset($songInfo['comments']['picture'])) {
                if (isset($songInfo['comments']['picture'][0]['image_mime'])) {
                    $mime = preg_split('/\//', $songInfo['comments']['picture'][0]['image_mime']);
                    $extension = $mime[1];
                } else {
                    $extension = 'jpg';
                }

                $name = md5($newSong['artist'].$newSong['album']);
                $path = IMAGES.THUMBNAILS_DIR.DS.$name.'.'.$extension;

                if (!file_exists($path)) {
                    if (!file_exists(IMAGES.THUMBNAILS_DIR)) {
                        new Folder(IMAGES.THUMBNAILS_DIR, true, 0777);
                    }
                    $file = fopen($path, "w");
                    fwrite($file, $songInfo['comments']['picture'][0]['data']);
                    fclose($file);
                }
                $newSong['cover'] = $name.'.'.$extension;
            }
*/
        }

        if (!isset($newSong['title'])) {

Battle.net fails with error “Qt platform plugin”

If your running or trying to run the Battle.net client and getting the error “This application failed to start because it could not find or load the Qt platform plugin “windows”.” then check your WINE prefixes and be sure you are running them in Windows XP mode. Also check if you are using a -staging version of WINE, I have found it works on a non-staging version of WINE but not a staging version.

Wine bug confirmed: https://bugs.winehq.org/show_bug.cgi?id=39985

Post Navigation