I did it. I bought a Nexus One. I've only had a few minutes to play with it so far and my initial impression of the interface is that it makes the iPhone feel clunky and boring. I don't know if it will be an iPhone killer, but there's a lot to like about this phone.
I plan to continue this blog because I enjoy hacking around on the iPhone. I'll probably start a different blog for the N1.
Taken with my iPhone. I'm going to go out on a limb and say the N1's 5MP camera with flash could probably have done better than my old 3G.
iPhone and Linux
Thursday, March 18, 2010
Script for looking up language codes
Shhh, don't tell anyone but I've made a secret post. It's a simple script to look up language codes, but it's 1100 lines long. The script is one simple grep command, the other 1100 lines are just languages and codes.
I made the post date Jan 1 2009 so it would go straight to the archive and not take up the front page. It can be found here.
It may be useful to anyone running my iPhone language deleting script who runs across an unknown language code.
I made the post date Jan 1 2009 so it would go straight to the archive and not take up the front page. It can be found here.
It may be useful to anyone running my iPhone language deleting script who runs across an unknown language code.
Wednesday, March 3, 2010
whereis
Another simple script to replace the missing whereis command on the iPhone.
#! /bin/shToo bad an if statement needs a then statement to go with it. Since ls has it's own output, there's no reason to duplicate it so it's easier to use the ls output and do an empty then command. The result works, but it just looks dumb. Here's a shorter version. It will list all the files. If any are not found, the error goes to /dev/null.
if
ls /usr/bin/$1 2>/dev/null
then echo >/dev/null
elif
ls /usr/local/bin/$1 2>/dev/null
then echo >/dev/null
elif
ls /usr/sbin/$1 2>/dev/null
then echo >/dev/null
elif
ls /sbin/$1 2>/dev/null
then echo >/dev/null
elif
ls /bin/$1 2>/dev/null
then echo >/dev/null
else
echo "$1 not found in /bin /sbin /usr/bin /usr/sbin /usr/local/bin"
fi
#! /bin/shBut that won't give you a "not found" message. So let's take that and put it in a variable. If the variable is not empty, it will echo the variable, which is the non-error output from the ls command. If it ends up empty, the -n test will fail so the && command is skipped and the || command executes.
ls /usr/bin/$1 /usr/local/bin/$1 /usr/sbin/$1 /sbin/$1 /bin/$1 2>/dev/null
#! /bin/sh
test=$(ls /usr/bin/$1 /usr/local/bin/$1 /usr/sbin/$1 /sbin/$1 /bin/$1 2>/dev/null)
[ -n "$test" ] && echo $test || echo "$1 not found in /bin /sbin /usr/bin /usr/sbin /usr/local/bin"
Subscribe to:
Posts (Atom)