Twitter is All About Me

I don’t care about getting a ton of followers on Twitter.  In fact, one thing that drives me nuts about Twitter is all of the ‘Get more followers!’ posts. If you’re simply concerned with getting as many followers as possible without caring who those followers are, you’re a spammer. Even though following means opt-in, if you’re more concerned with the number of eyes you can reach than the people who own those eyes, you’re a spammer.

I want quality, not quantity. Signal, not noise. I follow interesting people that I want to read. I don’t follow everyone who follows me, and there are a number of people I follow that don’t reciprocate. That’s just as it should be.

Why might I follow you on Twitter? Mostly, you talk smartly about, and/or link to, things I find interesting, even if that ‘thing’ is yourself. (I’m not ashamed to admit that I do a bit of the fanboy thing.)  If you want to know what I find interesting, look at the people I currently follow. I have a huge range of interests and passions. Feel free to @ me if you think we might dig each other.

Why might I not follow you on Twitter? I’m picky, I’ll admit:

  • U use txtspk 2 much. Seriously, text speak drives me nuts.
  • Your Twitter account is three days old, you have four updates, and you follow 932 people. You’re obviously interested in followers, not me.
  • You Tweet only to generate sales. I want to connect with people, not products.
  • You use ‘Please RT’ way too often. Begging is unbecoming.
  • You don’t know how to use the word “you’re.” Come on, this is second grade stuff here. Ok, maybe third grade, but still.
  • You’re a traditional marketer. Read up on Seth Godin and Hugh MacLeod if you don’t get what I mean.

Why might I unfollow you? Not very many reasons, really. If you start doing some of the things in the list above, that might do it. One biggie is not responding to me. If you’re following me, I presume it’s because you’re interested in what I have to say and share. That’s possibly naive of me, I know. I’m giving you the benefit of the doubt and not writing you off as a mass spammer follower. If I @ you a few times and I get no response, I am going to be a bit offended. Just being honest here. My interest in what you have to say has to outweigh that offense for me to keep following you. I think that’s more than fair. (Many thanks to @mariancall, @gapingvoid, @loic, and @KristieMcNealy on that last point, btw.)

The great thing about Twitter is that everyone has a chance to make it exactly what they want it to be.  In other words, Twitter is all about me.

I Want to Volunteer Evenings and Weekends in the Greensboro Area

I’ve looked at VolunteerMatch and Idealist, but I cannot find any volunteer positions that will fit my simple schedule.  Everyone seems to want a full-time daytime person.  I do have a full-time job during the day that I must keep, but I do want to help.

My background is in IT.  If you are aware of any local NGOs or non-profits that could use my skills, please pop me an email at volunteer@jeffharbert.com.

A PDF version of my resume can be found here: My Resume.  Feel free to forward it to any agency in the Greensboro area you think might be interested in having me help out.

Thank you very much!

Convert Unicode Files to ASCII

I had a situation at work recently where I needed to mine some Unicode-formatted HL7 files for data.  For my purposes, I really needed the files in plain text format.  Here’s the VBScript I used to convert the HL7 files to plain text.  I hope you find it useful.

Const ForReading = 1
Const ForWriting = 2

‘— The possible values for TriStateTrue are 0, -1, and -2.  -2 is the setting I needed in this case.
Const TriStateTrue = -2

Set objFSO = CreateObject(”Scripting.FileSystemObject”)
Set objFile = objFSO.OpenTextFile(”C:\HL7Archive\000001.hl7″, ForReading,False,TriStateTrue)

strText = objFile.ReadAll
‘— In my case I needed to replace the linefeed character, chr(13), with VbCrLf.
‘— Otherwise the entire file would have ended up on one single line.
strLine = Replace(strText, chr(13), VbCrLf)
objFile.Close

‘— Now we have the properly formatted file in memory.  Let’s write it to a new text file.
Set objNewFile = objFSO.CreateTextFile(”C:\Documents and Settings\jharbert\Desktop\HL7Testing\gpa000000.txt”, True)
objNewFile.WriteLine strLine
objNewFile.Close

Idea: Cooperative Music Publishing

It’s a pretty simple idea.  You have an internet music station a la SomaFM or Pandora that plays only unsigned bands.  Bands produce their own songs and make them available, free of charge, to the radio station as MP3s (or whatever) for streaming.  Higher-quality MP3s (DRM-free, please) and whatever other file formats you wanted to support would be available for purchase on the station’s website.  Want a plain old audio CD?  Easily done.  Bands retain total control over their work, the station and the band split the proceeds of sales (tilted somewhat in favor of the station because of their ongoing bandwidth costs), and the RIAA gets to take a long walk off a short pier.

Some fairness details: A band can’t sell their music anywhere else at a lower price and undercut the station.  The band can’t stream their music at a higher quality on another website.  The station will allocate airtime fairly to ensure that new bands get good exposure.  There are undoubtedly other details that’d have to be worked out.

Any reason why this wouldn’t work?

To Kindle or Not to Kindle

I tweeted earlier today that I was pondering getting a Kindle.  I got a quick reply from @jesslynh with a link to a blog post titled Why you should get a Kindle…or Not. Let’s go over the Shoulds and the Nots.

Why you should get a Kindle

  1. You read more than two books a month – Yep, 2-4 for me.
  2. You read the newspaper(s) every day  - No, I don’t read newspapers. I just don’t find them that helpful or timely.
  3. You need reading glasses or read large print books – I do not need glasses for reading.
  4. You regularly buy hardcover books – Definitely.
  5. You rarely leave the house without a book – Ditto.
  6. You read while on your daily commute – I drive, have a fairly short commute, and I don’t like audio books. It’s usually NPR for me.
  7. You have a drawer (or computer) full of those cds that come with your reference books (Can you say full-text index?) – I don’t have a ton, but I do keep them.
  8. Mobility issues make it hard for you to hold/read books for an extended period of time – Does not apply.
  9. You do any of the above and don’t live near a bookstore – I live near several good bookstores.
  10. You do any of the above and frequently travel – I don’t travel a lot, but I do seem to take more books than clothes.
  11. Zero Geek Requirement, the Kindle is a book; it just happens to be more than one book if you want it to be. – My thoughts exactly.

…or Not

  1. You rarely read books, but usually get the latest gadget – I rarely go for the latest gadgets.
  2. You only want to read your blogs, comic books or magazines – Hardly.
  3. You think you’ll have an iPhone/iTouch/iPod replacement or backup – I don’t think this. (A secret – I don’t like the iPhone.)
  4. You read really obscure or highly specific genres (i.e., South American manga translated to Sanskrit) – Nope.
  5. The majority of your reading is not in English – Nope.
  6. You absolutely need color – Nope.
  7. You are interested in mainly free books – Nope.
  8. You’re looking for swift ROI dollars – Not swift, no, but it will eventually pay for itself.
  9. You think it’s a viable alternative to a netbook – Nope, they’re totally separate beasts.  I am pondering getting one in a couple of months though.
  10. You heard that it was cool – Well, yes, but that’s not a consideration.

My shoulds outweigh my nots.

Using Taskkill to End Remote Processes

You can kill processes on a remote computer by using the taskkill command. Run ‘taskkill /?’ on a command line to see all the options.

We use SpySweeper on all our workstations at work. It occasionally hangs during a scan, severely slowing down that particular PC. Here’s the command I use to kill it remotely:

taskkill /s computername /im spysweep* /f /t

/s lets you designate a remote PC, in this case ‘computername’.
/im lets you specify a process by application name. This lets you kill a process without knowing the PID
/f forces a process to close
/t also kills any child processes

I’ve actually made a batch file on my workstation called ks.bat. ‘ks’ = kill SpySweeper. Here it is:

taskkill /s %1 /im spysweep* /f /t

I simply open a Run dialog box, enter ‘ks computername’ and it kills SpySweeper on whatever workstation I specify.

A VBScript ‘Wake on LAN’ Project

I was working at home one weekend recently, performing some scheduled server maintenance. We have mostly HP servers where I work, and they have this nice feature built into them called Remote Insight. It’s a card that’s plugged into the motherboard of the server. This card has an ethernet port on it. You can connect to the RI card over this ethernet port and use it as a sort of virtual KVM. It’s a fantastic feature, letting you control a server remotely, shutting down or restarting if you need to, and, since it’s essentially attached to the console, you can even get into the BIOS should the need arise.

That is, when it works.

The RI cards are pretty reliable, but every once in a while they’ll disconnect you and make you wait a 30 minute timout period before it resets the connection. Not a big deal if you’re in the building, but a much bigger problem if you’re offsite, as I was this particular weekend.

Anyway, I had to shut down a server briefly, and that server’s RI card decided that right then would be a good time to drop its connection. I had to drive in to work on a Sunday just so I could press the power button on the server. I was good and annoyed, let me tell you.

The next work day, I decided to give myself a backup method of turning on a server. My tool of choice? A wonderful piece of technology called Wake on LAN. I use a tiny application called WOL.EXE for this. Open a command prompt, type “wol 112233445566? (that last part being a MAC address) and WOL.EXE sends out what’s called the magic packet to wake up the computer (or server) with the correct MAC address. This would have suited my needs perfectly, if only I’d had the MAC address of the server in question.

Hmm, I feel some scripting coming on.

Let’s not limit this to servers. Let’s cover all the computers in an entire domain, ok? Ok.

The first thing to do is gather all the computer names from your Active Directory domain. I found the perfect script over at Microsoft’s Script Center Repository. Their website doesn’t support direct hyperlinking, so I can’t link to the script. I’ll just give it to you here:

On Error Resume Next

Const ADS_SCOPE_SUBTREE = 2

Set objConnection = CreateObject(”ADODB.Connection”)
Set objCommand = CreateObject(”ADODB.Command”)
objConnection.Provider = “ADsDSOObject”
objConnection.Open “Active Directory Provider”
Set objCommand.ActiveConnection = objConnection

objCommand.Properties(”Page Size”) = 1000
objCommand.Properties(”Searchscope”) = ADS_SCOPE_SUBTREE

objCommand.CommandText = _
“SELECT Name FROM ‘LDAP://dc=fabrikam,dc=com’ WHERE objectCategory=’computer’”
Set objRecordSet = objCommand.Execute

objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo objRecordSet.Fields(”Name”).Value
objRecordSet.MoveNext
Loop

Quick side note: The script references an example AD domain as ‘LDAP://dc=fabrikam,dc=com’. The AD domain where I work is actually a subdomain of our public domain name, so I have to add to the DC path above. Like so: ‘LDAP://dc=subdomain,dc=fabrikam,dc=com’. Note how I added a third DC section. That’s how you can reference a subdomain name in an LDAP path.

The script as-is will output the information it gathers to the console, but I wanted to capture it in a text file. The easiest way to do this without modifying the script is to run the script from within Microsoft’s Scriptomatic tool, with Scriptomatic set to display the results in a text file. Boom, nice and easy. I use Scriptomatic a lot this way.

Paste the script into Scriptomatic, change the LDAP path in the script to your own AD domain, and click Run. After a second or two you’ll see a text file pop open with a list of all the computers and servers in your domain. Save this text file somewhere safe. I saved mine with the name workstations.txt.

Now we need to fetch all the MAC addresses of the computers listed in that text file we just saved. We’ll use another script to do that, using the text file we just saved as the input for the script.

Here’s the script:

‘—– Let’s Dim our variables —————————————————————-

Dim strComputer, objFSO

‘—– Set some constants used for manipulating text files————————————-

Const ForReading = 1
Const ForAppending = 8

‘—– Let’s open the list of workstations we grabbed from Active Directory ——————-

Set objFSO = CreateObject(”Scripting.FileSystemObject”)
Set objFile = objFSO.OpenTextFile(”C:\scripts\Fetch MAC Addresses\workstations.txt”, ForReading)

‘—– We want to loop through the text file line by line, grabbing MAC addresses as we go —

Do Until objFile.AtEndOfStream
strComputer = objFile.ReadLine

‘—– Let’s see if we can ping the workstation ———————————————–

Set WshShell = CreateObject(”WScript.Shell”)
PINGFlag = Not CBool(WshShell.run(”ping -n 2 -w 250 ” & strComputer,0,True))

‘—– If we can ping the workstation, grab the MAC address and save it in a text file ——–

If PINGFlag = True Then
wScript.Echo strComputer & ” pings”
Dim objShell,objExec
Set objShell=CreateObject(”wscript.shell”)
strCommand=”nbtstat -a ” & strComputer
Set objExec=objShell.Exec(strCommand)
Do While objExec.StdOut.AtEndOfStreamTrue
strLine=objExec.StdOut.ReadLine
If InStr(strLine,”MAC Address”) Then
arrFields = Split(strLine, ” “)
strMAC1 = arrFields(7)
strMACAddress = Replace(strMAC1, “-”, “”)
strCompEntry = strComputer & “,” & strMACAddress
Set objFile2 = objFSO.OpenTextFile(”C:\scripts\Fetch MAC Addresses\MAC_Addresses.txt”, ForAppending)
objFile2.WriteLine strCompEntry
objFile2.close
End If
Loop
Else

‘—– If we can’t ping the workstation, let’s log that so we can get the MAC address later —-

Set objFile3 = objFSO.OpenTextFile(”C:\scripts\Fetch MAC Addresses\cannot_ping.txt”, ForAppending)
objFile3.WriteLine strComputer
objFile3.close

End If

Loop

The script reads the first workstation name, sees if the workstation responds to ping, runs the nbtstat command against the workstation, grabs the MAC address by monitoring the stdout of the nbtstat command, then saves the workstation name and MAC address (sans hyphens) to a second text file. Also, if the workstation does not respond to ping, it saves that workstation name to a third text file. We can use this third text file at a later date as the input file of this same script so that, over time, we can gather all the MAC addresses in our domain.

There you have it, all the MAC addresses in your domain. For myself, I now have all the information I need to wake up any workstation or server on my domain, but let’s not stop here. Let’s make it easy to use the MAC addresses we just gathered.

Here’s a script that prompts you for a workstation name, searches for the MAC address in the second text file, then automatically sends the WOL packet to wake up the workstation.

‘—– Let’s dim our variables ————————————————
dim fname, objFSO, objFile

‘—– This opens an input box into which we’ll enter our workstation name —-

fname=InputBox(”Which computer do you want to wake up?”)
fname = UCase(fname)

‘—– Some tracking integers ————————————————-

i = 0
y = 0

Const ForReading = 1

‘—– Open the text file of MAC addresses and read the ———————–
‘—– entire thing into memory at once —————————————

Set objFSO = CreateObject(”Scripting.FileSystemObject”)
Set objFile = objFSO.OpenTextFile_
(”C:\scripts\Fetch MAC Addresses\Copy of MAC_Addresses.txt”, ForReading)
strFile = objFile.ReadAll
objFile.Close

‘—– Split the file into an array, using the comma delimiter —————-

arrFields = Split(strFile, “,”)

‘—– When we find a match we’ll increment Y by 1, but ———————–
‘—– we want the script to keep looping until otherwise ———————

Do While y=0

‘—– Whatever array field has the workstation name, the MAC address ———
‘—– will be in the next field ———————————————-

strPC=arrFields(i)
strMAC=arrFields(i+1)

‘—– Let’s see if we have a match between the workstation name taken ——–
‘—– from the text file and the input box ———————————–

If strPC = fname Then

‘—– If we do, let’s grab the MAC address and send the WOL signal ———–

Dim objShell,objExec
Set objShell=CreateObject(”wscript.shell”)
strCommand=”C:\scripts\wol.exe ” & strMAC
Set objExec=objShell.Exec(strCommand)
‘—– Let’s get a visual confirmation that we sent the WOL signal ————

wscript.echo “Wake on lan command sent to MAC address ” & strMAC

‘—– Since we found a match, let’s increment Y ——————————
y=1
End If

‘—– If we didn’t find a match, let’s look at the next workstation name —–
‘—– which will always be two array segments away —————————

i=i+2

‘—– The loop will terminate here once Y=1, otherwise it’ll keep going ——

Loop

And there you have it. I hope you find this helpful.

FedEx Office Provides Free Resume Printing on March 10th

Are you job hunting? On Tuesday, March 10th, Fedex Office (formerly Fedex Kinko’s) is offering to print 25 copies of your resume for free. They have over 1600 locations nationwide, hopefully one of them near you.

http://news.van.fedex.com/freeresumeprinting

Tweak XP to Work Better with Older Hardware

Change XP to the Classic theme: Right-click on the desktop and select Properties. On the Theme tab, select ‘Windows Classic’ from the drop-down menu. Click Apply, then OK.

On systems that use shared system memory for video instead of dedicated video memory, turn off the wallpaper and reduce the color depth to 16-bit.

Reduce visual effects: Right-click on My Computer and select Properties. Click the Advanced tab. Under ‘Performance’, click Settings. Select ‘Adjust for best performance’. Click Apply, then OK, then OK again.

Open the Registry. Start > Run > regedit.

Go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PriorityControl

Give ‘Win32PrioritySeparation’ a Hex value of 26. This prioritizes applications over background services. Do NOT do this on a server.

Go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

Give ‘DisablePagingExecutive’ and ‘LargeSystemCache’ each a value of 1. The first one keeps critical OS and application processes in RAM and prevents them from being written to the swap file. This keeps apps more responsive. The second one makes that RAM cache larger. This does not reduce swap file use per se, but it does keep the more important stuff in RAM so apps remain (mostly) immediately usable.

Close the Registry.

Schedule weekly disk defrags: Open a command prompt. Enter: at 03:00 /every:Sunday “defrag c:”. This will defragment the C: drive every Sunday at 3:00am. Change time and day values to whatever you need. Enter a separate ‘at’ command for every local drive letter, staggering the times by 30-60 minutes.

Reboot and enjoy. It won’t be greased lightning, but it’ll be better.