Hi. I scored a sweet domain name and I think I'm gonna start moving stuff over to un.ix.io
I made a nifty little one liner so cal will show you the current date. It even makes sure not sure not to mess up the formatting. I'm sure this is like, the millionth time this was invented, and I'm sure there's a better way to do it, and it's not even technically a one-liner, though it is short.
DATE=`date +%d`;REP=`echo $DATE | sed 's/./#/g'`;cal | sed "s/ $DATE / $REP /"
and you get something like:
December 2005 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 10 11 12 ## 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
UPDATE: already found a better one:
cal | sed "s/ $(date +%d) / $(date +%d | sed 's/./#/g') /"
UPDATE 2: it worked till the 17th, oops! Not all the dates have spaces on both sides. The best thing i could think of to do was just add spaces on each end of the lines, so now I'm using:
cal | sed "s/^/ /;s/$/ /;s/ $(date +%d) / $(date +%d | sed 's/./#/g') /"
UPDATE 3: thanks to someone at MacGeekery, I learned how to use shell escape codes. So here's a version that just bolds the current date:
cal | sed "s/^/ /;s/$/ /;s/ $(date +%d) /$(printf '\e[1m&\e[m')/"
UPDATE FOR NEW YEAR: you need to strip the leading zero from the date:
cal | sed "s/^/ /;s/$/ /;s/ $(date +%d | sed 's/^0//') /$(printf '\e[1m&\e[m')/"
cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) /$(printf '\e[1m&\e[m')/"
cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /"
cal | sed "s/.*/ & /;s/ $(date +%e) /  /"
I wanted to have my 770 do dynamic dns update. In the past, due to ignorance of anything better I've just written a shell script that gets cronned every 15 mins or so that sees if anything's changed, and if so updates my IP with curl. But the 770 doesn't have cron.
So I went looking for some sort if interface up hook.
/etc/init.d/ was the only place I knew to look - but it turns out that scripts in there just get called when the interfaces go up, not when a wlan connection happens, so that was no dice. I couldn't find anything else, and ended up finding someone had ported a working cron to 770, so for a while I just used that.
Then today, I found out about dbus, which led me to
/etc/udhcp, and bingo, that was it. I added a line that calls my dynip script at the appropriate spot in
/etc/udhcp/udhcp.script, which seems to be the one that actually runs, and it works great - only checks/updates on wlan connect.
I got a Nokia 770 recently - fun thing to play with. I've stuck some of the stuff I've been working on in svn.
I managed to get a semi-working scratchbox and to compile some stuff I was missing and couldn't find. The one I really wanted was diff, and I managed to get that compiled, so theres
sdiff. Also threw in
I also managed to get
nvi compiled. The busybox vi is pretty terrible, and vim seems kind of overkill for a 770 plus the port to 770 advertises itself as fairly tricky and incomplete. I haven't noticed any issues with this binary so far.
Also a little lan manager script (
lan) that can show internal and external IP and wlan name. You need curl and wireless-tools for that.
Finally, my famous command line twitter client tweaked to use /bin/sh :)
remind was pretty easy to install to dreamhost
mkdir .packages cd .packages wget http://www.roaringpenguin.com/files/download/remind-03.01.00.tar.gz tar xvfz remind-03.01.00.tar.gz cd remind-03.01.00/ ./configure --prefix=$HOME make make install
Only other thing to it really is Dreamhost is PST so I had to set the TZ variable. In
I want to run remind on here mostly to send email reminders, and maintain an online calendar, so I set that in my crontab while I was at it so the times are right.