preload
Apr 21

I’m not sure how many people actually subscribe to my blog. I think more people just stumble upon technical articles that I post while they are searching the net. That was the intention of this blog, to give back and help the same way so many posts help me. Anyways, I thought I would post this personal entry.

I’m living in Victoria, BC, Canada for a month as my wife has an internship at the local TV station here. We rented a vacation condo at The Reef very near to the Shoal Point on Erie Street. The building and accommodation is perfect and I know this month is going to go by very very fast.

Victoria BC is the town I grew up in and I feels soo good to be back home. The feeling is also amplified by the fact that as I write this all I have to is glance up and I have a perfect view of Victoria’s breathtaking inner harbor. It is amazing to look out the window and see landmark after landmark that has a memory attached to it as the float plans land in the water. This afternoon I was taking Peepsi, our dog, for walk on Dallas road which runs along the south end of the island. I ran into a old friend walking his dog. It was so good to do that, just run into an old friend and walk in one of the best cities in the world with perfect weather. I have missed it.

I have added some photos of our first couple of nights.

Apr 20

Save this for myself later on.. Nice tip!

Terminal tip: easy email attachments: “

Filed under:

If you’re looking to automate the sending of emails with attachments quickly and easily (and aren’t too concerned with having some glamorous stationery), Terminal is once again your friend. It’s possible with Mail.app and AppleScript, but there are a few pitfalls and, for most purposes, a simple shell command will do the trick:

(echo 'This is the message body';uuencode Desktop/yourDoc.doc yourDoc.doc)|mail -s 'Test attachment' someone@adomain.com

The magical command in this one is uuencode, which is used to encode and decode binary files and can be used on just about any file type. The two arguments in the command above define the name and location of the source file and the name the file should have when it’s received. The parenthetical statement at the beginning combines the results of the echo and uuencode commands which are then piped (|) to the mail command. The mail command, having received the body text and attachment, is told to append a subject (-s ‘Subject’) and send it to the address specified. If you wanted to send a longer text file – with line breaks, perhaps – as the body, you could save the text in an external file and replace the echo statement with cat myfile.txt.

By adding a little complexity you could make a shell script that takes arguments, making the automation a little more flexible. But TUAW reader Adam was wondering how to send a photo he’d taken automatically using AppleScript (triggered by a Mail Rule). So here’s an AppleScript implementation that doesn’t require opening Terminal or dealing with Mail.app scripting:

set msgBody to 'This is the body of the message'
set msgSubj to 'Message subject'
set mailDest to 'someone@adomain.com'
do shell script '(echo '' & msgBody & ''; uuencode /Users/you/Desktop/pictosend.jpg pictosend.jpg) | mail -s '' & msgSubj & '' ' & mailDest

Make sure you remove any line breaks from that last line. This obviously requires a predetermined image name, but that could be made a variable as well and used as part of a larger script. We hope this helps, Adam!

(Via The Unofficial Apple Weblog (TUAW).)

Tagged with:
Apr 16

I bought a cheapest Acer Vista crap machine to run some performance tests on. My plan is I’ll wiped and install Ubuntu on it. I have always wanted to try it and it will work well for the performance tests.

acer.pngAnyways, when I bought the computer I noticed there were no Vista disks. I thought I should have them just in case I want to format the drive and get rid of the machine. Also, I noticed that the HD was split into two partitions, C: & D:, and they didn’t add up to the total on the box. There was about 10gb missing. I called customer support…

We start with the regular hi, name, phone number, I give him all that, it is going fine.

Me: “Where are my Vista install disks, how am I to reinstall the OS”.
Acer: “Yeaaaaah, ok, do you have any blank DVDs in the house?”.
Me: “No, I’m not going to download Vista and burn it, I paid for Vista and I would like the disks.”

I was kinda shocked by his response, granted I have never done this before so I don’t know if manufactures usually make people download the Windows or Vista image and burn it but I did not think it was right. This is this my first introduction in the Windows support world and I already feel sorry for them.

So the conversation goes on. He gets all the shipping information from me to send me the disks. Then he says your service number is blah blah blah. I ask if that is my Acer customer support number, like for this case. He says, no that is for shipping of the disks. I ask, if it is a tracking number, he confirms, so then I ask him.. so who are you sending this with.. “yes, Fed-Ex, but they are going to have they’re own tracking number”. I AM SO CONFUSED…So then I have to ask him… “so, this is NOT a tracking number?”. His reply, “No, it is the number that comes out of our system”. Moses smell the roses!

I was not asking for a lot here. Just send me my disks that I paid for..

So the call seems to be finishing up and I ask him if they really ask there customers to download the OS and burn it.. Why don’t they ship a $0.15 disk with the computer. He response with: “Yeaaaaaah, we don’t ship the disks because we hide the image on your drive in case you need to use it.”

Bingo, that is where the 10gb went! What a joke… to top it off, on Acer’s Vista install there is soo much Acer this and Acer pop-up message center that I would not recommend anyone buy an Acer, ever.

ME: “So, Sir, can you please tell me how to get this image off my drive and recall this space back”
Acer: “If you do that it will void your warranty as you are removing the recovery image”
ME: “But you are sending me the recovery disks”
Acer: “FINE!”

Me: ( In my head) “wow”.

So the Acer dude has to put me on hold go across the room to find a Vista machine and find out how to do this. When he comes back, he shows me and tells me just to erase it. So I explain to him that I was telling him that I don’t want 3 partitions, I have this acer install part, this C drive, and the D drive. He thinks for a while and says.. if you erase the acer image part it will just ‘go back’ to the C or the D drive….

Me: ( In my head) “wow”.
Acer: “And Sir.. We don’t really know how to do what you are asking here”
Me: “So who in your organization could I talk to in order to get that answer, support?”
Acer: “Yes”
Me: “Aren’t you support”
Acer: “Yes”
Me: “Please just send me the disks”
Acer: “Fine!”
Me: ( In my head) “One Two Three Four
Tell me that you love me more
Sleepless, long nights
That was what my youth was for”

Apr 09
timemachine_hero20071016.png

Last week at around 2pm Friday afternoon I was working away having a IM conversation with a client and I heard a ‘click… click click’ from my MacBook Pro, then, the computer stopped responding. I knew what was going to happen in the next second or two.. and it did. My hard drive died. After one and half years of turning away almost 24 hours a day it gave out. All my data gone, years and years of emails gone, every piece of work, every contact, every line code ever written gone, every picture every taken in my life, gone.

The only reason why I was not totally freaking was that last month I had bought a external drive and enabled Time Machine backups. What was a little scary was that only solution, there where no other backups any where. I had put my entire faith in Apple’s Time Machine and I was about to find out if it was a good idea or not.

timemachine_icon20071016.pngSo my plan was to go buy a 500GB external hard drive and partition it into two parts. One half to make a backup of my Time Machine data (just in case) and the other half to install Mac OS X, then restore from my Time Machine data in order to use it to boot from so I am able to work while I wait for my replacement drive.

After about 8 hours or so (I was out so I can’t be sure) of restoring from my Time Machine share over ethernet I went to boot from my external drive for the first time and… it was perfect. Time Machine has done a perfect job of capturing all the data and then restoring it. All my mail, photos, documents development environments were all perfect and working. I’m a pretty hard core Apple fan-boy (I have the T-Shirts, I do the Windows trash talking, and most importantly I live a Windows free life) but I was just glowing at this point. I had put my entire faith in Apple’s Time Machine and it was a good idea.

But, as the title reads, Time Machine is not perfect… This next part will not effect 95% of Apple users as they don’t use Terminal or make changes to the OS… After a few days I noticed that some things were missing. I started keeping a list:

timemachine_hdicon20071016.png

  • Printers – my printers were not backed up. I had to add them again.
  • /etc/bashrc – the file was not backed up but the contents of the dir was. Weird.
  • /System/Library/StartupItems – The contents of that dir was not backed up. I noticed this because my Cisco vpn client failed. I ran the installer again and it installs a dir there: /CiscoVPN/CiscoVPN.
  • Security System Preferences – It was not returned to the same state. Usually have everything checked except for the ‘Log out after n minutes of inactivity’.
  • Time Machine System Preferences – It was ‘off’ when I restarted my machine. It was turned on when the machine crashed, on restore you have to manually turn it on again.

Personally, I think, for the consumer not commercial, Apple is way ahead if it’s time. If you look at it technically it was amazing what just happened… with a few clicks on some big buttons… I had my machine back in a perfect state.

Tagged with: