How To Ask For Tech Support

I found this in my email archives. I hope you can enjoy it as much as I do.

One of my friends (he was one of my most pleasant customers at Sydney Uni) many years ago wrote me an email asking me a tech question. It was February 2008 and we were both upset by the New England Patriot’s loss in Super Bowl LXII that ruined a perfect season.

Alan provides a perfect example of how to ask a mate for tech support. Football is much more important than mere computer problems.

From: Alan
Subject: Sadness reigns
Date: 20/02/2008

I don’t know if you feel as I do, riven still with grief over the catastrophic end to the season.

It still pisses me off.

An evil destiny intervened to tear victory from us!

At any rate, I hope you are going well.

Tony, I need advice from you, as usual.

Something just started happening and I don’t know why.

And I don’t like it and want it to stop now!

When I’m working in a Word document, if I go into the middle of a line, of a sentence, and type an additional letter, the new letter erases the letter just to the right of it.

So with each new letter the one to the right is erased!

So what I want to keep to the right of the insert is being erased!

This is almost as frustrating as watching Asante Samuel drop what would have been the game-winning interception!

Or the Patriots defenders lose their grip on Manning and let him make that desperation throw!

Or Tyree what’s his name make that catch!

Or Ellis Hobbs forget to cover Plaxico Burress in the corner of the end zone!

Can you help me, please?

Best,
Alan

From: Tony
Subject: Re: Sadness reigns
Date: 20/02/2008

Alan,

I am totally distraught, one might even say tormented by the way the season ended. I was working and deliberately avoided all newspaper web sites and turned off the car radio so I could go home and watch without knowing the result. All I can say is that I think Bill was out coached – when the opening drive took so long I knew we were in trouble, the Pats had been winning fast games and getting into trouble in low scoring, slow games. I even had a brand new Pats hoodie my brother had sent me to wear during the game and that didn’t carry us through – DAMN!!

BTW – Nothing is as frustrating as watching Samuel drop that interception, not even watching Brady get sacked three plays in a row.

Oh, in case you actually wanted that Word problem fixed – you’re in overtype mode. Widen the window until you see a green dot with “OVR” next to it and click on “OVR”, the dot will go empty and your problem will be fixed. There’s probably some strange key combination to toggle it that you accidentally hit. (Why in the name of God such a mode exists I leave to stronger minds than mine.)

Take care,
// Tony

From: Alan
Subject: Re: Sadness reigns
Date: 20/02/2008

Tony,

Yes, that Asante Samuel drop is absolutely gut-ripping.

And also the much-touted three-fifths All Pro offensive line, where did it go??!!

They should be ashamed of themselves!

I thought we were going to have a field day.

I looked at the Patriots home page today and Belichick says if only one thing more had gone our way in the game, just one thing more!

So right!

Like Asante catching the f…… ball!

I could have caught it, Tony!

I had been invited to watch the game with friends but at the last minute they had to cancel.

Thank god, because I was screaming at the TV.

And at the evil demon who was robbing me of the ecstacy I was expecting, replacing it with utter agony!

I have tinnitus, and it suddenly was not only activated but up at a level it hadn’t been in years!

I still feel the torment too, Tony.

By the way, your suggestion re OVR was as ever spot on!

Coming to Sydney any time soon?

Best,
Alan

It’s always a joy to talk to Alan and it comes across when he asks even a simple question.

Advertisements

Setting Up A Cloud Server

I recently decided to set myself up with a Unix box in the cloud. I want it so I can use it for things I can’t do on my iPad, most notably using pandoc for converting MarkDown documents to various other formats.

There are any number of places that offer an incredibly cheap box. I found a special offer at one and bought myself a year for less than $20. I then fired up an Ubuntu 16 server.

Here’s what I did to get it all working in a (fairly) secure manner.

Continue reading

A Little Python Makes Dad Happy

My daughter, Jessica was born the Thursday before Father’s Day in 1992, the 3rd of September. That means this year her birthday occurs on Father’s Day.

That begs the question, what other years will this occur? Here’s some Python code that answers the question.

#!/usr/bin/python
#
# Find all the years when my daughter's
# birthday and Father's day coincide
# from the year of her birth till 2100

import time

for i in range(1992, 2100):
	dt = "3 09 " + str(i)
	tt = time.strptime(dt, "%d %m %Y")
    	if tt.tm_wday == 6:
    		print i

I love you, Jessica. My favourite Father’s Day gift ever, always.

Writing A Web App With Python

I have spent my spare time in the past two weeks writing a web app. I couldn’t find a good web site that offered an easy personal journal. I wanted something that was a bit like a blog but with less fuss and totally private.

So I decided to try writing one. The language choice was obvious, Python. The next question was which framework to use. I did a web search and discovered that the choice quickly came down to two.

Django is the older giant in the room compared to Flask. The two also have a different philosophies. Django has it all built-in while Flask seems to be a thin wrapper over Werkzeug and Jinja2 mostly providing request and session handling while leaving almost everything else to extensions. Continue reading

Bash Completion For Pandoc Is Built In

This is more in the way of a note to myself. I was just starting to write a bash completion script for Pandoc when I came upon this  in the Pandoc documentation:

--bash-completion

Generate a bash completion script. To enable bash completion with pandoc, add this to your .bashrc:

 eval "$(pandoc --bash-completion)"

 

So no need for me to write one. Neat trick, generate your own bash completion script. John McFarlane really is a god. Oh, and the completion is top quality, it knows when you’ve typed an option that takes an input or output format and completes on those and other little tricks. I may end up using some of his tricks for my completions.

A Little Shell Will Fix It

Last night I went to Lights For The Wild at Taronga Zoo. As usual, I took a lot of photos with my DSLR camera, over 200, though a lot of that number are quite similar as I often take two or three to increase the chances of getting the right shot, sometimes I vary the speed so that one is better exposed.

The camera saves both a RAW file​ and a JPEG so I end up with over 400 images. Looking through them in QuickLook in the Finder can be painful as the RAW images take quite a while to load, then you get the problem that when you have decided which of the three shots you want to keep you also have to delete the matching JPEG or RAW file.

The easiest solution to both of these is to only go through the JPEG files and then delete the matching NEF file (which is what the Mac calls the RAW file).

So I open the folder and sort by ‘Kind’ which puts the JPEGs at the top. I then open the first in QuickLook by hitting space and using the up and down arrow keys to move through the list commanddelete deletes a file and displays the next. Easy.

Now I have 80 JPEG files from the original 240. How to get rid of the NEF files that match the JPEG files I have deleted? A little bash programming to the rescue.


for i in *.NEF ; do
  if [ ! -e `basename $i NEF`JPG ]; then 
    rm $i; 
  fi 
done

The secret to this is the basename utility. It’s a neat little tool. Pass it a full file path such as /Users/tonyw/Documents/UselessRamblings.txt and it will return just
the file name without the path, UselessRamblings.txt. It has a matching tool, dirname which returns just the path portion. As you can see from my code basename has another trick, it will happily strip the suffix from the filename if you tell it what to strip.

More Tools For Building Tools

I’m working on more bash completions. This time for some of the command line tools Apple provides for sysadmins.

I decided there had to be a way to get a list of the options from the man page for a tool. After all they are all in there.

So I built a command line piece by piece. As an example let’s get a list of the options (with some caveats) for the tool pkgbuild. We start with man pkgbuild | col -b , the col -b step takes out the special characters man uses to show bold on screen. Now find all lines containing -- with grep, I liked grep -e '--'. If you have a look at the output of that we are getting close.

Next I decided to use sed to do a find and replace for the option itself. After some playing around I ended up with sed -e 's#.*\(--[a-zA-Z-]*\).*$#\1#' An important note for young players, it did take some time and a few tries to get that substitution just right. Don’t be afraid and remember Google (and Stack Exchange) are your friends.

First, I should point out an old Unix hand’s trick. Most of the time you see sed substitution commands using / as the separator but sed can use anything but \ or newline – it uses the first character it sees after the ‘s’. I usually use # as it makes the \ used for special characters easier to spot and the string easier to read.

Continue reading