Category Archives: Computing

Macbook Air about to be refreshed

Been a lot of rumors flying about that the Macbook Air is finally getting an update. The Air hasn’t gotten a meaningful update in quite a while and is currently the only laptop model from Apple that doesn’t have a the large multitouch trackpad. Rumors include an 11 and 13″ sku and SSD only. AppleInsider has the details at http://www.appleinsider.com/articles/10/10/16/more_details_surface_on_apples_next_generation_macbook_airs.html.

Using expect to automate a process

In my previous post I talk about needing a TFTP server in order to serve some files to a hardware device. This post describes how I used expect to automate the process of logging into the hardware device and issue commands that copy in a config file, commit it to the device, upgrade the firmware and finally tell the device to reset to factory defaults and reboot.

Expect is a way to programmatically work with a normally interactive process. Using expect you can write a script that telnets into a system and then issues commands based on what it “sees.” Here is the script I used, with some important values removed, to automate the process of updating a number of devices.

#!/usr/bin/expect
set timeout 300
spawn telnet 192.168.1.1
expect "login: "
send "root\n"
expect "Password: "
send "tehmagicphrase\n"
expect "# "
send "cd /tmp \n"
expect "# "
send "tftp -g -r config.ini 192.168.1.159\n"
expect "# "
send "config.sh import config.ini\n"
expect "# "
send "tftp -g -r firmware.img 192.168.1.159\n"
expect "# "
send "firmware_upgrade /tmp/firmware.img 1\n"
expect EOF

The above script was saved into a file called pushConfig.expect and set as executable using ‘chmod +x pushConfig.expect’. To run the script, I powered on the device and waited for it to be ready, once ready I issued ./pushConfig.expect to start the update process.

Using expect is fairly straightforward. The most difficult part is ensuring you correctly tell expect what to look for before sending the next command. In the script above I do the following:

set timeout 300

This tells expect to wait at least 5 minutes for matching text before continuing to the next send command. What this means, is if I tell it to send some data it’ll wait up to 5 minutes to see what is in the expect line after the send. In the case of my script the firmware upgrade could take quite a bit of time and I didn’t want it to timeout so I set the value fairly high.

The next line tells expect to start a telnet session to a remote machine and then to wait until it sees:

login: 

Once it sees that it sends the username. The script continues like this until it sees EOF. At this point expect knows that the process is now complete and it exits.

By using an expect script I was able to simply power on the hardware device and wait for it to boot. Once booted I ran the script. This saved me and a co-worker a lot of time while pushing custom configurations and upgrading the firmware on a number of devices.

Expect is capable of a lot more than I used in my example and can react differently based on what it receives back from the interactive process or even loop over a series of commands. To learn more about expect try ‘man expect’ or search your favorite search engine.

Jailbreaking the Apple TV and the legality of jailbreaking

Came across this article talking about progress being made with the new Apple TV in regards to jailbreaking and adding new functionality. Jailbreaking was recently ruled as legal. I think this is a big win for consumers who want to be able to use their hardware devices for whatever they want. For example, I think it’s ridiculous that Apple is allowed to force me to join their developer program if I want to write my own iOS application for a device I own. It’s perfectly reasonable that if I want to distribute my software using their App Store platform but beyond that I should be faced with such restrictions.

Also, just because jailbreaking has been deemed legal doesn’t mean pirating software is suddenly legal as well. There are still plenty of other existing laws protecting against that. In the next few months or years I think we’ll see additional clarifications with the DMCA and jailbreaking. For example, although the iPhone was specifically mentioned in the ruling, I actually don’t think it should be ok to jailbreak an iPhone for security reasons as it pertains to the cell phone network. The iPhone is part of a bigger infrastructure that is not owned and operated by the owner of the phone and in that case it’s a lot like a business PC being connected to a business network. At the same however, such a ruling will hopefully coerce Apple into providing a toggle on the phone allowing end users to install software outside of the App Store. This would satisfy what some end users want while still protecting the security of the cellular network.

Xmarks is closing up shop, here’s hoping they’ll open source it

Xmarks has decided to close up shop because it can’t find a way to make any money. Sad to me because it’s a service I use everyday and is honestly something I’d probably pay for because it works across all browsers on all the systems I care about. Although it is possible to use your own server as an xmarks sync server this is really only a stop gap measure because the plugin is going to need to be continuously updated as new browsers are released. The only answer then is for someone (are you listening Google?) to buy it out or for the team to release it as an open source project.

Interview with “The Man Who Makes Your iPhone”

Interesting interview with the guy who runs Foxconn, manufacturer of least one part in what ever eletronic device you have in your home. http://www.businessweek.com/print/magazine/content/10_38/b4195058423479.htm

Office 2011 for Mac has been released to market as well

Office 2011 is on track for its late October release as the MacBU is reporting they have signed off on final testing.

UPDATE: If Amazon is to be believed then Office 2011 is set to be released on October 26th – Amazon leaks Oct. 26 launch of Mac Office 2011

Restore window positions and sizes

Few weeks ago I was telling my co-workers how I wish there was an application that would put the windows of running applications back to “where they belong” when I plug my MacBook into a secondary monitor at work. Yesterday I finally found that app.

Stay

Today Apple will demonstrate why they don’t need flash for video

Apple announced yesterday that they will be streaming their September 1 event live. The catch? It’ll only work in Safari on Mac and on iOS devices. So in other words, only about 9/10′s of the internet will be able to view the live stream.

But that 9/10′s of the internet will be able to enjoy the exact same video stream no matter what device they are on, be it laptop or the tiny iPod touch. No need for a desktop optimized version and no need for a mobile optimized version. The same stream will play on any sized device.

Make no mistake, this is a giant stab at anyone who is arguing that flash is needed on Apple’s devices. If you need any further information about the state flash on Android you need only watch the video here and then read the comments. People love to rail on Apple while completely missing the point that having flash at all doesn’t mean flash works and a half-assed flash experience is not what Apple is willing to allow on their devices. Reading through the comments you’ll find a few people who argue that “at least it is there” and that “it doesn’t matter that flash sucks today because there are better phones coming out tomorrow.” That makes no sense.

Apple’s attention to detail

This is something I’ve actually noticed on their machines and I’ve always wondered why nobody else bothers to make a computer look like it is actually “sleeping.”

http://floodlite.tumblr.com/post/1011047822/apples-attention-to-detail

Sometimes you just need to rethink how something is done

Since Steve Jobs came back to Apple there has been one thing Apple has done that nobody can really argue. Innovation in the PC industry. While everyone, including Apple at the time, was producing boring looking beige computers Apple decided to completely rethink how a computer can look and introduced iMac. Love it or hate it, the iMac was completely different than anything else at the time and soon other manufacturers tried to add some amount of flair to their PC lineup.

Skip a head a few years later and Apple did it again. While everyone else was basically creating incrementally different smart phones in 2007, Apple simply destroyed how everyone assumed a smart phone should look and work by bringing to market iPhone. They made it far easier, intuitive and beautiful and from that moment on, they made it so that any phone on the market that didn’t have a touch screen or had a touch screen that required the use of a stylus was simply awkward and outdated.

Apple’s most recent market disruption was none other than iPad. During the summer prior to iPad’s release the netbook craze was in full swing. Just a year later there are reports that sales on netbooks have slowed considerably and some reports even show netbooks are losing out because of iPad.

At iPads reveal in January of 2010 Steve Jobs quipped that netbooks weren’t better at anything, they were simply cheaper laptops. Many people argued that netbooks were most useful for consumption and were never really meant for creating content. Yet netbooks looked and worked just like any other ordinary PC. Apple changed this by creating something that looked and worked nothing like a PC. Note too that iPad was the first tablet device on the market. Microsoft has been trying to get consumers using tablet PCs for years but I don’t think anyone could argue they’ve been anything near the run away success that Apple has seen basically over night.

The inspiration for my post comes from Marco Arment’s recent post. He also poses the interesting question of, “How do you think the subcompact, inexpensive computer category will look in three years?”