Thursday, 23 May 2013

Manually update dynds from a cron job when dd-wrt's builtin inadyn client segfaults

OK so dd-wrt's builtin Dyndns.org updater somehow gave in. Tried changing it to opendns, played around with settings etc → no avail.

Now, it's technically possible to just update dyndns every minute. But that will definately break the update policy and I'll be banned. So I made this little script that I put on a machine in the internal network:

cat update-dyndns.sh
#!/bin/sh
# Arno's update-dns-script, run by cron every 1 min


# Get current ROUTER IP
ROUTERIP=`wget -q -O - http://router|grep "IP: "|sed 's/<[^>]*>//g'|sed 's/.*IP..//'`
CMNIP=`ping -c 1 -w 1 <myhostname>|grep PING |sed 's/^.*(//'|sed 's/).*//'`

# echo $ROUTERIP
# echo $CMNIP

if [ "$ROUTERIP" = "$CMNIP" ]; then
 # echo IPs are the same
 # don't do anything :)
 echo "Last DDNS check at " `date` > /root/dnsupdate.txt
else
 # echo IPs differ
 # echo We need to update it
 #update now
 wget -q -O - "https://<user>:<password>@members.dyndns.org/nic/update?hostname=<myhostname>" >/dev/null
 echo "Last DDNS update at" `date` > /root/dnsupdate.txt
fi


And to make sure it's run every minute, "crontab -e" and insert:
*       *       *       *       *       /root/update-dyndns.sh

That was it :) Didn't bother removing the debug/explanatory comments ;)

Friday, 3 May 2013

centOS annoyances

OK after some time using centOS I have three things to rant about:

- Can't find a good photo management program. For now I use shotwell in mint in a VirtualBox machine and over sshfs. Somewhat slow.

- Something's up with gpg-agent and/or Enigmail and/or Thunderbird in centOS. Wherever I start up Thunderbird, I can send a digitally signed email WITH ATTACHMENT only and exactly ONCE. After that, every intent of sending my next digitally-signed mail with an attachment fails with "GPG returned an unknown error". Great. Sending signed mail without attachments works ok.

- Dropbox works (yum install dropbox), but for some reason stops working on reboot →?  Some error message saying <somefilename>.zip doesn't exist →? "yum remove dropbox; yum install dropbox" fixes it, but it's kind of awkward...