Installing a HP LaserJet 1505 printer on Apple OSX Mountain Lion

What a problem this was! We had a user with a MacBook Pro that had a new copy of Macintosh OSX Mountain Lion 10.8.2 running on it. Plugged in a rinky-dink HP LaserJet 1505 and nothing. Even though there was the exact same printer installed before, from the user’s home, the system refused to reuse the connection for the printer at work. Obviously that has to be because the system notices it’s a different device and refuses to play along, which I find stupid.

Plug in the printer, try to add it, and the Add Printer function goes out to Apple Software Update to look for the driver and then comes back and tells us that nothing is available. Then commence zombie debugging via muzzle flare, wandering around in the dark trying to fix what shouldn’t be happening but apparently is beyond all logic and reason.

So how you do diagnose a Mac? Here’s a handy-dandy guide which anyone can use to fix their Macs. I seriously doubt any issues ever survive this particular procedure:

  1. Clear PRAM – Turn off computer, turn on computer while holding down  Command-Option-P-R. The computer will restart and you’ll hear the startup chime twice. Let go of the keys. ~ For this, just do it. It doesn’t matter if you don’t think doing this will fix your problem, it will. Just shut your pie hole and do this. If you don’t do it, I don’t want to hear about your problems. It’s magical. I don’t care if Apple says it won’t do anything. This thing DOES EVERYTHING IN CREATION – apparently. That and it cannot hurt. Lots of fluids and plenty of bed-rest. 
  2. Repair Disk Permissions – Start Disk Utility, find your “Macintosh HD” and click “Repair Disk Permissions” and wait. Do this. Often. Regularly. Lots. Weekly. Now.
  3. Download Onyx. Pick which version of OSX you are using, download it, install it and use it. I recommend skipping everything it wants to do and going right for the Automation button. Uncheck “Repair Permissions” and “Display of folders content” and check the rest. Click Execute and wait. When the system asks for a reboot. Reboot. Everyone should do this weekly. Think of it like vitamins for your Mac. Plus, it can’t hurt.

At this point your system should be all spic and span and whatever niggling bit was bothering you should be dealt with. Of course, for the problem I had to deal with at work, there is one little thing extra, one thing more. Open Finder, click Go on the Menubar, then Go to Folder… and type in /Library/Printers and click Ok. You’ll see a list of folders. In this list find the folder named “hp” and KILL IT WITH EXTREME PREJUDICE. Y’arr! This !@#$ folder is at the very center of my hatred for all that is Hewlett-Packard. I’ve started to unceremoniously refer to them as Fudge Packard. Bastards. Anyways, killing the folder does the trick, it clears everything up and Mountain Lion can download software from Apple again for the HP Drivers – blah blah blah. I’d rather just get a sledgehammer and pound the HP LaserJet 1505 into foil, but hey, you have to cope or have some sort of attack. I regret buying HP. I regret the LaserJet 1505. What a piece of crap. Steaming.

Starting Out Small

ethernet cablesThere is an issue I have at work, something I’ve written about before in my logs that I’ve found a solution for that I feel I can blog about. I can’t really talk about the why behind all of this, but I can share a technical explanation of how I am addressing this problem. It’s a half-thing, bear with me.

At Western, I’m very interested in the number of open TCP connections that a workstation has open at any one time. I don’t care what state the connection is in, ACK_WAIT to any of the others, if there is a line, I want to know about it. Specifically I want to know how many lines there are. Mac OSX is based on Darwin, and Darwin is based on BSD – so you get a shell to work with when you start Terminal.app. There is a lot of power in the command line interface and once you get the hang of it, it’s really quite useful.

So remote stations, at least two of them I have turned on “Remote Login” in their Sharing applet in System Preferences which enables the machines SSH servers to answer incoming connections. I can use SSH to call up a command line window to those remote stations, feeding them commands. I have done this for a long while for our servers in the office but this is the first time I’ve seriously done this for workstations. So, with this connection established I want to collect the number of TCP connections that machine has established. On the command line there are lots of pieces to get this to work:

First, you need a loop structure so that the command happens regularly: 

while true; do [command]; sleep 60; done

This will run a command every 60 seconds and it will never end unless I send a Control-C character which represents “Break” to the shell.

At first I just needed to count how many connections. You get this number, or at least an approximation of it this way:

netstat -p tcp|wc -l

That calls netstat to list out all the TCP connections, which then I pipe, using the pipe character ‘|’ to another command called wc, which calculates word-counts. I make wc ignore words and just count lines by using the -l switch. I don’t really care what other stations my targets are communicating with, just a count of how many. And yes, technically the SSH connection inflates this by at least one connection, it’s not intended to be forensic.

But something was missing. I need a date stamp. In BSD, there is a command called date, and you can give it a format so you can make date write out the Hours, Minutes, and Seconds the way you want to see them, but date has an annoyance to it. The command date always inserts a ‘newline’ character at the end, so what you’d get is a date, a new line, and your count. It’s okay, but it’s annoying. It would be far better to get rid of that newline character altogether. Enter in the ‘tr’ command, which translates characters. In this case, we tell tr to just delete the newline character, so ask date for the right sort of date, have tr nail off that newline at the end because it’s annoying and…

while true; do date '+%H:%M:%S '|tr -d '\n'; netstat -p tcp|wc -l; sleep 60; done

This outputs a very nicely formatted report on a remote workstation. So now I have datestamps, connection count levels, and when the count gets to a certain number and things happen, I can be faux-psychic.

UPDATE: Apparently I just can’t leave well enough alone. Seeing a slow parade of numbers trot by is rather dull when all I really want to know is when these numbers say, get over 70. So…

while true; do test "$(netstat -p tcp|wc -l)" -gt 70 && (date '+%H:%M:%S '|tr -d '\n'; netstat -p tcp|wc -l;); sleep 60; done

 

photo by: Bull3t

Encrypted Time Machine Drive Botch in Mac OSX 10.8.2 Mountain Lion

We had a Firewire 800 drive botch when it came to whole-volume encryption in Mac OSX 10.8.2 Mountain Lion. We lost the password and couldn’t recover it. The drive refused to erase, all the options were grayed out. I refuse to believe that a software change can render hardware junk, so there had to be a way, and I found it. Here’s the procedure:

  • Attach botched drive to computer, since the password won’t work, cancel the unlock dialog box
  • Open Terminal
  • Enter command: diskutil CoreStorage list
  • You will get a long list, you are looking for the UUID of the “Logical Volume Group” at the very top of the list, for the drive that is affected.
  • Enter command: diskutil CoreStorage delete [UUID]
  • The system will eject the volumes, destroy the grouping, erase the disk, then initialize the disk, mount it and finish.
  • Done!

Friday Flashback – March 8th

2004 – I got my IRS return back from the Feds, $1700, a part of that went to GenCon. Boy, were those the days. Since GenCon went to Indianapolis, and I don’t travel through Indiana unless driven by a myrddraal, that won’t be happening again. Some funny Andy-abuses-popsong-lyrics humor and the almost daily work issues, which at this point are at the focus where irritation and cliché meet. Moving along…

2006 – The big thing on this day was Project Runway was concluded. The most important bit from this show happened this year, “Where’s Andre?” Yes. Where.

2007 – Owning an American Made Car made the headlines on this day. Getting screwed over by General Motors makes 2013 a laugh-fest. We saved GM, Quist-ler, and Ford. Oh hooray. $1200 for replacement bearings and fourth set of brakes. It’s one of the reasons why I’ll never own another American made piece of shit car again. American auto companies can fail – hah – or not. wry smile The start of my debt was this awful car, one small little golden brick of it at least.

2009 – The beginning of the end for my odd benign cyst that was on my leg for years and years and years. This was when that whole thing started on the path to the end. Now I’m delightfully symmetrical and ever so daintily scarred. In the movies? Watchmen. Those were the days.

2010 – Wireless carriers still mattered. Sprint was good for highways, Verizon was slow but everywhere and AT&T was shit. This also was when AT&T bought Centennial wireless. So, whatever. Little did these carriers know but they were on the path to becoming commodity carriers. Nobody cares about their products or their employees, just their towers. In other news, I was hopeful that La Palma would break off, hit the ocean and several hours later erase New York City with a megatsunami. Alas, my hopes were for naught. New York City still exists. Blah. I started to blog and lauded how I could link dump automatically on Twitter and Facebook. Yeah, social networks as whores, take it bitches. It was at this point I realized that Apple Sales are whores. If you approach them and jingle money at them, they’ll do anything for you, but after the sale? You’re full of Santorum and the beer goggles have worn off. I also wished for Fax Machines to disappear. I didn’t get my wish.

2011 – A bit of Sage love as an email brought me great joy. I still thought Daniel Tosh was pretty neat, before the rape jokes and general wretchedness set in. WMU rolled out the Bronco Transit Mobile GPS and I thought it was neat, then I stopped using the system. I started thinking about how awkward it must be for Christians when Easter isn’t a fixed date but based off a calculation on the moon after the vernal equinox, lulz. Extra special work-fun and I started talking about AES–256 and how smart people look it up and take advantage of it.

2013 – Reality TV and Contest TV kind of suck. I decided to make a change to what I do at home, after dinner and cleanup are done. A very old friend and I shared a special moment, but they have no idea because it was just a dream. My daily tarot card readings pretty much jive with my horoscopes and so, I do my best to not go all “Hulk Angry/Hulk Smash”. I dealt with work issues, did things I’m not proud of, found FBackup which was okay, and generally felt that the day was best forgotten. I laughed heartily at the foibles of folken, they don’t, so I do, and it doesn’t matter. Well, it matters to me, which is why I do it. What is it? Ah, yes. Work stuff… you’ll never be knowing. Trust Issues. Dangly Bits. LOL.

For the want of pgrep on Mac OSX

I’ve got an issue at work, of course. I’ve got a Mac OSX xServer that has grown crotchety and so I’ve gotten to making things better by using killall on various running processes in order to “clean up the mess”. This is all fine and good and these processes respawn and the world goes back to normal and everything is fine, however I also want to renice this pesky command and give it a lower priority. While killall can do a search by name, renice requires a pid. The way you get pids is to run the ‘ps’ command, but this gives you a big pile of data and really all you want is just the pid itself, so you can pass that to renice.

So here’s how to get your cake and eat it too on Mac OSX Leopard Server:

1) First, change your shell – the default for root is /bin/sh, do this by issuing this command:

chsh -s /bin/bash root

2) Then you’ll need to give bash a profile, create a new file call it .bash_profile and fill it with this text:

[[ -s ~/.bashrc ]] && source ~/.bashrc

3) Next you’ll need to fill out that .bashrc because that contains the function you need to replicate pgrep:

pgrep() for arg; do ps aux|grep $1|grep -v grep|awk '{print $2}';done;

4) Log out and log back in and you’ll end up in bash, not sh, and you’ll have a new command at your disposal, pgrep. You can then use pgrep CommandName and it’ll spit out the pid related to what you are after.

5) Then you can use this new function with renice this way:

renice 20 `pgrep CommandName`

One thing to note here is that the ` character is the backtick character. You’ll find this hiding out in the upper left corner of your keyboard, it’s the unshifted tilde button.

FBackup: Free Is Good

At work I was asked to put together a server on the cheap which I’m fine with as long as everyone understands that doing so has some implicated risk. A server cast on a desktop machine is a risky proposition. You don’t have power support from redundant power supplies, you don’t have RAID which can protect you from hard drive failure, and the machine is not designed to be a very robust server in any stretch of the imagination – it just lacks the processing and RAM that would really answer the need strongly. However, once I covered those risks, everyone was still on-board with me moving forward. I rolled a server out, used an Operating System that would be best to not speak about and set up the software.

Being a part of the technology from the great beast, of course it didn’t work well at first. There were hidden requirements, annoying requirements. Requirements with “dots” in their name. Once I figured out the how and got the thing running I took it down from the lab place I was working on it in and moved it to its permanent home in our machine room. From the point of deployment which was a few days ago I’ve had a niggling worry that the thing is going to fail, as any machine could when it relies on just one hard drive. I needed a backup solution.

The built-in backup solution in the “product” that I was “using” as an “operating system” was just not going to work. I needed something that would work well and be free above all else. I went to the great sage and eminent junkie Google and eventually ran across FBackup. It’s not glorious, it’s not complicated, but it is exactly what I was looking for. So now with that software installed, and it’s quite good in fact for the “operating system” I was using I don’t have to worry so much about that “server” going down. If it does, eh, who cares, at least the data will be safe. For those that wonder where I put my backups, I have a NAS, a handy dandy DroboNAS that isn’t the fastest tool in the shed, but at 16TB, it certainly has a lot of space and it’s RAID means that I don’t have to worry so much about hardware failure with that box.

So, hooray for FBackup. It’s free, and while I can’t spare any change for it, what I can do is recommend it. If you are looking for something handy and you can’t get your hands on a native installation of ‘tar’ like you should be using, this is quite good. It’s not Backup Exec of course, but then, I would rather chew a lightbulb than even hear the words “Backup Exec” spoken aloud.

Weekly Photo Challenge: Unique

2012-08-20 17.30.42 Last August I was walking out of where I work and I just happened to glance down and saw this flower growing all by itself in a crack that had developed in the concrete stairway leading out of my building down to the sidewalk. It struck me that something so evocative would grow without encouragement in a place that really is unlikely for any flower to thrive. It didn’t really last very long as someone from landscape services (I assume) came along and plucked it. Now all that is there is a crack in the concrete stairway. A little bit of special was there only for a brief time.

Unique.

Cloze

Discovered a neat new site and I sent invites out to everyone who I thought initially might find it useful. The site is called Cloze and it combines email and social networking in one view. There are free apps for iPhone and iPad as well. So if you got some email from me and you weren’t expecting it, now you know who it was from. I had to use my work email because many of the addressees on the mail were work contacts and they wouldn’t know who I am if I used my gmail account.

Week 9’s Tarot Theme

This week the Two of Pentacles has appeared over and over again. Even after some mad shuffling and even shuffling and cutting I end up with this card. Sometimes it’s right ways up, sometimes reversed, but there it is. Always with the juggling.

Another series of cards that pop up are high-order swords suit cards, you know the ones, the ones with a lot of pain and unhappiness linked to them. My most popular cards are these: Eight, Nine, and the most hilariously bad card in the entire Tarot, the Ten of Swords.

Sometimes at work I think of my querent card is the Ten of Swords.

Tagging

I’ve been blogging actively on and off for years. Much of it started in LiveJournal and when SixApart, the company that wrote LiveJournal were sold to a russian company it was time for me to leave. I left for a few reasons, one was because I didn’t trust my writings to a company that was owned by a foreign country – the laws get murky once your thoughts and opinions leave the USA; the other reason was a general eroding of english users as more cyrillic users started to appear on LiveJournal. The language barrier between english and russian was the little push that I needed to leave that and get on with WordPress.

My use of WordPress continued a-pace until one of my work blogs was tagged as suspect by a WordPress.com robot and the company deactivated my blog. After explaining what I was using the blog for, they re-enabled it however that identified a problem for me, mostly that my blog was being measured – if not by a person then by an automatic process and as such, it had a definite stink of censorship about it. At work, and in my private life I already had a separate hosting company and that’s when I discovered WordPress.org, the DIY blog platform based on the technology that powers WordPress.com. I installed a constellation of new blogs both for work and for personal use and that had a bunch of added extras – specifically unlimited storage of rich media which I would have otherwise had to pay for with WordPress.com as well as direct control of the content. There were no robots or censors wandering around turning off accounts willy-nilly in this other arrangement. Also, and more to the point of this blog entry, the shift over to WordPress.org also enabled the use of plugins which really extend the WordPress platform even further than the nice presentation that the WordPress.com system provides. I’ve been having a devil of a time remembering to tag my WordPress blog posts. I went fishing for a new plugin to maybe help with tags and I found the WP Calais Auto Tagger and so far I’m quite impressed with it’s quality. Now when I make a post, the post is sent to OpenCalais where it is processed for relevant tags and I get a list of possibilities that I can elect to use or not. I take the category part of my blog posts very seriously and now I can rely on this bit of technology to help me with the tags as well. If you run WordPress blogs, I suggest you look into this.

Generally speaking, if you are a friend of mine and would like a WordPress.org blog for your own, I’m more than happy to help you out. I can set it up quickly and support it even – if you are interested, just drop me a line. Those that know me know how to reach me. I suppose everyone else could leave a comment. This offer isn’t valid for anyone at Western, sorry.