Category Archives: Programming

Simple Countdown Timer and Stopwatch with Laps for Bash

There are a lot of decent, small shell scripts for creating a simple timer or simple stopwatch. Yet, I needed a bit more than the ones I found on Google, so of course, I made some of my own.

My simple stopwatch for Bash lets you create laps, pause and gives you a total elapsed time. Keep in mind, it’s all presented in seconds.

stopwatch with laps for bash

My simple timer for Bash just countdowns the number of seconds you provide and then beeps. Like my stopwatch script, it’s all based on seconds so that there aren’t a bunch of command line arguments to deal with.

countdown timer for bash

Cordova Tip: Automatically Open Web Inspector for iOS Simulator

How many times have you painfully, manually opened Safari Web Inspector after starting the iOS Simulator with `cordova emulate`? Too often. Me too. No more.

I found a nifty osascript gist then tweaked it a little and put it inside a shell script `ios-sim-inspector`.

Then, I added a couple of new Cordova aliases to my bash profile (leveraging a couple of existing aliases)

## Existing Aliases ##

# Run iOS Simulator
alias corem="killall Simulator || echo && cordova emulate"

# Build and Run iOS Simulator
alias corbem="killall Simulator || echo && cordova build && cordova emulate"

## New Aliases with Web Inspector'ing ##

# Run iOS Simulator with Safari Web Inspector (for Debugging)
alias coremd="corem && ios-sim-inspector"

# Build and Run iOS Simulator with Safari Web Inspector (for Debugging)
alias corbemd="corbem && ios-sim-inspector"

Now you know how to painlessly open Safari Web Inspector after starting the iOS Simulator with Cordova emulate from the command line.

Free Currency Converter for Your Website

a long time ago, i was looking for some currency conversion code, be it JavaScript or some server side code utilizing some public web service. to be honest there just wasn’t anything very decent for use inside your own website… not without paying of course. i wasn’t looking for an official and up to the minute foreign exchange service, just something a little better than what a dev like myself might hack up on the cheap.

thankfully i found exactly what i was looking for.. an unbranded currency converter that i could embed into my pages via an iframe. where do you think i got it from? you know… who else gives away more useful web tools that others charge for than… Google. i bet it’s even an up to the minute quality too… but i’m not making any promises. anyhow, i just figured there might be many of you out there like myself searching for ‘free website currency converter’ ‘iframe currency converter’ ‘currency conversion script’ or something similar. so here’s the best i’ve found.. free of charge 🙂

FIX FOR: SQL Express 2008 x64, file is corrupt during install

while setting up a new windows virtual server on the rackspace cloud i ran into a hiccup. not with rackspace, so far i’m liking their setup even though it’s still in beta mode for windows. the problem actually came about with installing microsoft’s sql express 2008 x64. the installer seemed to download without any problems, all 600MB of it, but when i ran the installer (actually a self extracting cabinet file) it would get 2/3 complete and then pop a message box with “File is corrupt.” so, i’m thinking.. that’s odd that i downloaded it straight off so, i google the error message real quick.. i’m still addicted to google so no bing action. google came back with tons of discussions regarding this problem, many of them on m$ sites… google “sql express 2008 file is corrupt during install” and see for yourself. the only problem is that none of those discussions had a real solution. people, like myself, were upset with many of the m$ tech responses… paraphrasing: “just keep downloading it until it works.. something is probably wrong with your anti-virus software.” no help.

ultimately here’s what worked for me: i realized that because i was downloading the sql express 2008 software from the web server.. i was using the IE browser (because i didn’t have chrome or ff installed on it.. no need). however, i wasn’t just using IE.. i was using the 64 bit version of IE. i remember long ago, with vista x64 that the 64 bit version of IE corrupted every executable I tried downloading.. so i quit using the 64 bit version and stuck with the old trusty 32 bit version. anyhow, i just downloaded sql express 2008 x64 using the 32 bit version of IE and ta-da no more “file is corrupt.”

i’m too busy to login to all those sites discussing this problem, but hopefully anybody searching for a solution to “file is corrupt” when installing sql express 2008 will find this blog entry and save themselves some time and frustration.

Website Uptime Monitoring

lately i’ve been moving a number of my websites to new hosting providers. downtime was not my motivation for moving the sites, however after hosting most of those sites with one particular company for 10 years to hosts whom i have no personal experience, uptime is concern #1. with hosting companies you never know exactly what you’re getting until you’ve been running for a while, sometimes for several years 🙂

i’ve used free uptime monitors for a couple of websites in the past, but i’ve never noticed any problems that would encourage actually paying for better service. during the recent moves however, it has become very clear that i can’t afford to not have thorough monitoring in place. so, if you’re comparing uptime monitoring services and stumbled on this blog i’ll just say you absolutely have to consider pingdom. at work we use another service that our sys admin likes, but it was a little more expensive. he’s going to take a look at pingdom too and see if we can save a little bread and still get the same quality of service.

pingdom doesn’t just ping. it monitors all the other fun stuff too: http, https, tcp port, dns, udp, stmp, pop3, imap, post data and will check for specific strings on a resulting page. you can get notifications via email, sms, twitter and iphone.

money well spent..

Google can crawl Javascript

Micro$oft might be spending $100,000,000 dollars to convince you that they have developed a better search engine than Google, but Google’s I/O conference stirred up some conversations about the ability of Googlebot to crawl JavaScript. That’s a tremendous step forward for search engines. If it’s true it’s also a serious game changing feature; one that should shush those (like myself) who’ve been saying that Google has been neglecting it’s search engine and focusing too much on all the other stuff they’ve been building, buying and giving away. So, it seems that yes Google can and does crawl JavaScript.

Here are some articles that SEO experts should check out.. and you’ll get a whiff of how important JavaScript crawling is:

Google Lengthens Snippets, But The Meta Description Still Important

So recently Google officially released longer snippets on search results. There has been some chatter about this depreciating the value of the meta description. I have to play spoiler here and say I disagree.

The extended snippet stuff is great for long tail queries, like the many that I do when looking for programming information. Yet I don’t think it changes the importance of the meta description tag, especially for shorter search phrases.

Short snippets indicate tighter keyword proximity within the optimization of content; more precisely what the searcher is looking for. Longer snippets are only displayed when the keyword proximity is wider, therefore the content might not be precisely what the search is looking for, so that the searcher can better determine if the content on each page might have what they’re searching for.

Here’s some examples of tight keyword proximity within the content of the ranked pages, resulting in mostly short snippets:

“ response.cookie expiration”

“Austin rodeo tickets”

Here’s some examples of loose keyword proximity within the content of the ranked pages, resulting in many long snippets:

“ response.cookie expiration not working”

“can i watch the austin rodeo on tv”

So I stand by my opinion that body content and title tag are equally the best places to optimize for keywords and phrases to increase rankings, while the meta description is the best place to encourage a click through.

.htaccess files for IIS on Windows

if you’ve ever needed to password protect a directory on a Windows IIS web server, in the same way you can on an Apache (Linux) web server you’ve probably been hunting for a better solution than what is built into Windows / IIS. that is, in Windows / IIS you have to actually create a Windows user account for each username that will have access to the directory. that’s just plain stupid!!

sometimes you just simply want to use .htaccess files on IIS! don’t fret, you can use htaccess files on a Windows Server & IIS, no problemo!

i found a freeware solution that makes protecting directories and files a snap… just like using an htaccess file on Apache… but it’s an htaccess file for IIS / Windows. it’s called IISPassword, from a company called Troxo ( & it has a very nice gui and works like a charm… so if you’re in need be sure to checkout the site and download it >>