Raspberry Pi Revives a Wasp

I just plugged the WASP WCS3905 bar code reader into a Raspberry Pi that I have at my desk.

A few seconds later, I heard the handheld device beep. I didn’t have to install any drivers or other software.

I launched the built-in text editor, Leafpad. Then, I aimed the bar code reader at a bar code. BEEP! The serial number on the box appeared in the text document!

The WCS3905 had been used with our inventory system. But, the inventory laptop crashed about a year or so ago, and it’s been just gathering dust.

I’m trying to get a better hold of all the tech that goes through my office, to be more organized, accountable. This will be a huge boon for me. I can now start scanning hardware as it comes in, capturing information quickly.

I’ve been thinking about building a little inventory control database, and this will be a great part of that.

Notifications via the terminal

Oh man! This will be a very handy tool to have.

At work I use Apple Remote Desktop to manage the school’s computers.

One of the features of Remote Desktop is the ability to run shell scripts on any or all of the machines.

Sometimes, my shell-script-fu is weak, but I know how to do it with Applescript.

But, Remote Desktop doesn’t allow me to run an Applescript in the same way. That is, I can’t send a string of Applescript commands to a machine over the network, and have it do the bidding of the Applescript.

I have created some Applescripts and I’ve saved them as applications, which I then trigger from Remote Desktop. But, sometimes, I need to just do a one-off task, and don’t want to write the script, save it as an application, copy the application to all the Macs, and then run the application.

In the past, I’ve seen ways to wrap an Applescript in a shell script, but I haven’t used that before.

I have a task now, where I want to have the computers tell me their names. I was thinking of modifying a script that creates a text document, identifying the computer by name, and then sends a print job from each computer.

But, I thought, what about this fancy Notification Center. Can I tap into that?

Turns out the answer is yes!

How can I trigger a Notification Center notification from an AppleScript or shell script?

(Via Ask Different as Stack Exchange.)

Finding the OS Version via the command line

I was working on a user’s MacBook Air, trying to resolve a kernel panic.

I had been working in their account (the only account on the machine). I shifted my attention to something else.

After being unattended, it locked the screen.  The user was not around, and I was trying to figure out the version of the OS. Looking at the logs, it looked like it a networking library was missing or damaged. I suspected that a system update would fix this. But, how to figure out the OS version, when I couldn’t log in?

I thought I could reboot into Single User Mode and find it that way. 

Sure ‘nuff!

Here’s the string: 

sw_vers | grep -0 '[0=9]*\.[0-9]*\.[0-9]*'

It was running 10.9.2. I restarted the system, which then told me it had updates to install. I clicked on “Install Updates and Reboot.” A few minutes later, the Air restarted. I held command-S, and booted back into Single User Mode.

Ran the sw_vers again, and it replied “10.9.4″

Sweet!

(I had discovered the utility of SUM a few years ago, when I trying to troubleshoot lost user accounts. It’s been a very handy tool on some of the more odd or difficult issues, since)