e-Cycle and Gas Station Sushi

Used 1985 Cadillac EldoradoI sent three old iPhone 4’s to e-Cycle for recycling, they had a relatively good buy-back rate for the old devices. Of the three that I sent, only one was accepted. The other two were shredded and I got nothing for them, other than the vague satisfaction that the hazardous materials in them were recycled, probably.

I can’t really blame the company, it’s all there in black and white. Don’t send phones with active lines on them. Oops, that was my fault, but after hearing that they had this problem I thought I could just go into Verizon’s site and mark the lines as suspended. That didn’t do the trick. So the phones were summarily destroyed and recycled. I think that’s the part I don’t get, the rush to obliteration. Then again, I do get it, it’s a company trying to maximize all their angles and this is a rather convenient angle. It strikes me that they could have simply shipped the phones back to me or perhaps told me that my attempt at suspend didn’t work. Instead, they took the silent and cheap way out – shred the phones and mark the Unit Price as $0.00.

So, do I do business with e-Cycle in the future? I don’t know. I have learned my lesson at least, a phone you haven’t used in six months may still have a line on it. I don’t think I’ll be doing any further business with e-Cycle. It’s not because of anything overtly naughty, but just the sense that they didn’t care to even get back to me after I tried to disconnect the lines – that haste to simply shred and zero-balance fills me with doubt as to whether I got a fair shake on that deal, or not. I’m thinking not. While it wasn’t against any of the fine print, it did leave a rather bitter taste in my mouth, and I did learn a lot dealing with them, so perhaps in the end, it was good for everyone. I got a lesson, they lost a customer, and I’m wiser next time.

Now, to see if e-Cycle has any competitors.

UPDATE: They do have competitors, so at least there is a wide field available. Also turns out that the reports of the devices shredding were perhaps premature. They were found in a box, waiting for Verizon to disconnect them, since I sent that little nugget to Verizon today, it may take a bit for those devices to register as disconnected. I’ll update more as events unfold.

Premature Refugee

Perhaps in all the fleeing Google I just assumed that apps like Flipboard are just going to roll over and play dead. Turns out, they aren’t. They state that we’ll be able to sync our Google Reader in the Flipboard infrastructure without Google. There is some vague “Everything will be ok, don’t run away” coming out of Flipboard, but users like me really would like the nitty gritty details. In what way will the July 1st outage actually do for Flipboard users? I suppose I can wait a few months while Flipboard figures it out. The feedHopper app is still quite good, but Flipboard does beat it out visually for me. I wish the Flipboard app devs would post something geekier than “Don’t Panic”, it would really help me, uh, not panic.

God I Wish… Ah!

Apple Inc.At work I’ve been thinking about a particular system administration subject on and off for a few days now. When Mac is first installed all the “Optional Sharing Services” are all shipped defaulted to off, which makes sense and is fine. Generally speaking I’ve been fine with using Apple Remote Desktop to share the workstation, open System Preferences, and turning on whatever sharing bits I need to have on for the client workstations and that’s that. However that’s not really that elegant and I’ve been looking for a way to programmatically do it on the command line. As it is, Apple Remote Desktop can send Unix commands to connected workstations. All my client workstations are assembled in a neat little pile on my Apple Remote Desktop screen, as easy as you please. How can I turn on or off these Sharing services without having to upset the user. Ideally I want to turn these on without even sharing their workstation, to in a way, do it under the covers.

Enter the command systemsetup. G’duh. There’s even a handy-dandy template in Apple Remote Desktop that I’ve overlooked all these years that even has the details of the options laid out. So, in Apple Remote Desktop, select the stations you want to change, click the UNIX button, in there select the right template, change the user to root and send the command. Moments later, and in this case, SSH is up and running on the client workstation as easy as you please. Boom. No futzing with sharing workstations, no mucking about with System Preferences. Just simple, easy, like I knew had to exist. Now I know how.

This is actually the way I prefer to learn these things. This was something I sussed out, so it’s worth more than if I just spotted it in some bit of documentation. It took time and energy and it’s mine. The solution is worth something to me, and so I blog about it so I can celebrate Mac OSX and keep a little log in case I forget in the future. It’ll always be here.

Hooray for Mac OSX!

photo by: marcopako 

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!

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.

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.

Importing Plain Text into Mountain Lion Reminders App

I have created a new project to enrich the tags in my WordPress blog using the WP Calais Auto Tagger that I mentioned in this previous blog post. To do this I am working on pages of old posts in my WordPress dashboard and so I wanted to track just which pages I had completed and which ones still need my attention. I’ve got 48 pages of blog posts and so this is going to take some time to complete.

The first step was to create a list of text lines going from Page 48 to Page 1 like a countdown. I did that in OpenOffice using the Spreadsheet app. All you need to do here is type in two lines where the number series example can be made and then you can select these two cells and then grab the autonumbering control on the spreadsheet and draw it down, this is a great way to quickly create very repetitive lines where the only thing that changes is a number at the end. With this list, I copied it into a plain text file with each line on it’s own and saved it as “tagging.txt” on my desktop.

The next step is to use AppleScript to tell the Mountain Lion Reminders app to create entires automatically based on the file you just made in OpenOffice. Technically the Reminders app has an import mechanism but that’s only meant for ICS files, and that’s more trouble than it’s worth as far as I care to pursue it as a solution. Here’s the AppleScript:

 

set theFileContents to read file "Users:andy:Desktop:tagging.txt"
set theLines to paragraphs of theFileContents

repeat with eachLine in theLines
tell application "Reminders"
tell list "Tagging Project"
make new reminder with properties {name:eachLine}
end tell
end tell
end repeat

The only part you’d have to fix is the file location part and the list name part. Otherwise it works well. The only gotcha is it doesn’t seem to import the tasks in order, but at least they are in there.

Here are some helpful sites where I got a lot of this code and hints on how to talk to Reminders instead of iCal:

Benguild.com Page

MacScripter Page

Empty Nests

I’ve given up on Twitter. I won’t be removing my account as Twitter still has some use to for browsing the stream but there really isn’t any compelling interactions on that service for me any longer. The only things that will end up on Twitter really are links to blog posts and maybe the one-off comment.

Ever since Twitter enabled the data download feature on my account, I took advantage of it. I downloaded the entire archive and discovered to my pleasure that Twitter stored all my tweets as plain text in a CSV file. I spent the last months migrating my old Tweets into my Day One application. I will hand one thing to Twitter, it did keep me “logging” along for a long time. I’m switching that impulse over to Day One. It’s impressive just how much of my past I have recorded. It turns out to be about 2600 days, or about 7 years of my past – recorded and in some ways with a lot of resolution. For that I will always be thankful for Twitter. However…

The reason why I am leaving Twitter is because it is too exposed. I didn’t feel it was useful to have a private Twitter account, so I left it public and this decision was made with a devil-may-care attitude, that anything I tweeted wouldn’t matter. As it turns out, it does. Mostly this is because of my workplace, in that I do not trust them or anyone who works there. It’s not really anything meant to be hurtful or anything, but I can’t risk my job and I certainly feel that sharing on Twitter threatens my employment. For as far as I trust Western Michigan University, it starts and ends with the partitioned, compartmentalized version of me that works there professionally. Not the true honest authentic me. Being honest and sharing freely would just upset everyone and lead to needless drama at work, so I unfollowed a bunch of coworkers and people whose tweets would have gone to waste on an ignored account.

Another problem with Twitter is the loss of engagement and dimensionality. Everyone on Twitter is a three-dimensional person with all the complexities that come with being alive. Twitter’s relationships seem stuck in a one-sided mode of conversation. This very thing struck me most powerfully as I was migrating Tweets into my Day One app. I caught out of the corner of my eye tweets that I had made to people who were popular or famous. They were wasted messages. At first this concerned me, but then I realized that what was really going on was that the people who had thousands and thousands of followers were so far beyond their social horizon (that 150 limit I’ve written about before) that they simply cannot socially relate to anyone beyond their subset coterie of social contacts. It’s not that they are mean or being ignorant, but they just cannot process that level of interaction – it’s more about how our biology is colliding with our technology. So for the really famous, the really popular, that’s where the dimensionality comes in. A regular person is three-dimensional. The others are one-dimensional. They are human billboards. They stand there and output information and you stop thinking of them as individuals and start relating to them as “sources” instead. Robbing them of their inherent humanity. They don’t have feelings, as billboards don’t have feelings.

So, we’re all done with that. Twitter will still be a link-dump for my blog. Most of my actual sharing will start in Byword, then be copied to Day One, then from there shared to Facebook under my “Sharing” security model. If you don’t see lots of things on my Facebook wall, that’s because you aren’t in “Sharing”, and mostly that’s because I can’t allow my honest self to interfere with my work. — Gosh, writing that out felt wrong, but at least I’m honest.

If you follow me on Twitter and want to keep your lists tidy and unfollow me, I won’t even notice you leaving. So go in peace.