Find Me Online

HTML5 Powered with CSS3 / Styling, and Semantics

IP Address Bash Script for OS X

As a developer, I often need to get my external IP address and while there are numerous widgets, websites and apps for this, I wanted a nice, quick bash script to do it. I’ve adapted the script from a few internet sources (including a message on Ars Technica) and modified & enhanced it for my own uses. Put this in your .profile and you’ll then be able to type “ip” to get all the internal/external IP addresses. The external IP will then get copied to your paste board.

You can download the script here in text format.

function ip() {
local ETHERNET=`ipconfig getifaddr en0 2> /dev/null`
local WIFI=`ipconfig getifaddr en1 2> /dev/null`
local EXT=`curl -s http://checkip.dyndns.org/ | grep -o '[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*.[0-9]*'`
if [ "$ETHERNET" != "" ]; then
echo -n -e "Ethernet:\t "
echo -e $ETHERNET
fi
if [ "$WIFI" != "" ]; then
echo -n -e "WiFi:\t\t "
echo -e $WIFI
fi
echo -n -e "External:\t "
echo -e $EXT
echo -e $EXT | pbcopy
echo ""

}

 

Why We Need To Kill Flash

Anytime there’s a discussion these days about the iPhone and its competitors, Flash is usually mentioned early on in the discussion along with Multitasking. Today I want to address Flash because it’s something I strongly believe we need to kill. The topic came to me last week when the news came out that Adobe was blocking the adoption of HTML5. We still don’t have all the details there, but it did remind me of my hatred for Flash in general.

Flash is a weird product. On the one hand, it did things very well. When Macromedia (now Adobe) introduced it in 1996, they managed to make it so ubiquitous that it now has 98%+ install base. That’s quite the achievement.

On the other hand, Flash is terrible and that’s something most people agree with except perhaps for Flash designers. It’s being used today mainly for 3 things : video streaming/playback, entire or parts of web sites and banner ads.

It’s too bad Web standards are so slow to be adopted because for video streaming, there’s already a much better solution than Flash. Youtube, UStream and many others are (slowly) moving to it as more and more browsers are supporting it. Of course, as always, Internet Explorer will be the one slowing us down for this. For Web sites, the “new” technologies like the latest revisions of Javascript and DOM scripting can absolutely compete with Flash.

There are 3 major problems with Flash. Let’s review:

First, the flash player is very poorly implemented on OS X and Linux. Performance is terrible and it sucks battery life out of your laptop in record time since it pegs the CPU to 100% in seconds. That makes it inappropriate for things like cellphones in my opinion. If you visit a site with banner ads and a few flash movies, does this means you will lose 20-30% of your battery life in minutes?

As a second issue, I would point out that the flash authoring app is way too pricy. In a world where everything gets pirated, it may not seem like a big deal, but Flash, unlike Visual Studio from Microsoft and XCode from Apple has no free versions for people at home to play with. Coupled with Adobe’s usual upgrade routine every 18 months, it make Flash to be extremely expensive.

The third problem is that Flash is controlled by one company. That company decides if the Mac OS X version will be performing well. That company alone decides when a new version is released.

Add to these 3 problems the fact that many Flash websites are terribly designed and would be hard to see on a smaller screen and that these sites are usually badly (if at all) indexed in search engines and you start to understand why Apple is refusing to include it on the iPhone.

Because of all this, I’m actually happy Apple is doing this. It has forced some sites to reconsider the use of Flash and I hope it’s a trend that will continue.

Hopefully more companies will be bullish like Apple and take a stand.