Reading news the way I like it

I have been using Tiny Tiny RSS (or TT-RSS) (www-apps/tt-rss in Gentoo) as my news aggregator since the end of 2008. It is a web application (written in PHP) that provides a great news aggregator UI. Since it’s a web application, you can use it from anywhere with just a browser, and thus have all your feeds in the same state (read/starred/…), anywhere you are. Think of it as Google Reader, but without Google knowing exactly what news articles you’re interested in, since you can run TT-RSS on your own server / web host.
So, TT-RSS alone was great already, but the UI is more suitable for when you have a mouse and a big browser window, than for using it from your phone.

Recently I discovered the Android App TT-RSS Reader which solves exactly that problem. It connects to your TT-RSS instance via an API, and brings all your feeds, with all their states just as on the web interface, to your Android device. The interface is specifically designed for touch screens, so it’s much easier to navigate through your feeds and articles than via the web interface. Furthermore, it can cache articles and images, which you can trigger while on WiFi before leaving the house, and then read everything on the way in Offline mode, to save mobile traffic, which is expensive and/or slow for some. When you’re back on WiFi, you switch back to Online mode, and TT-RSS Reader synchronises your state to your TT-RSS instance. Absolutely awesome 🙂

A couple of quick screenshots from the web interface (TT-RSS):


… and the Android App (TT-RSS Reader):


Update (2011-07-03): Shortly after posting this, hwoarang offered to take TT-RSS from the Sunrise Overlay into Gentoo’s main repository (Portage), with me proxy-maintaining it. So now it’s even easier to get TT-RSS onto your Gentoo-powered server.

My phone’s bash.profile

Here is some automation that I put into my bash.profile. It’s all done with aliases, since with regular shell scripts, I would first have to remount /mnt/sdcard without ‘noexec’. Like this, I just need to open a ConnectBot “Local” connection, type the alias, and press enter(*).

(*) For this to work, the ‘post login automation’ entry of the ConnectBot “Local” profile needs to have
bash --rcfile /sdcard/bash.profile
in it.

Here is what I have in there:

alias bb="busybox"
alias top="bb top"
alias df="bb df"

alias ll="ls -l"
alias n="su -c \"netstat -ntupl\""

alias backupdata="su -c \"rsync -rP --delete --numeric-ids --chmod=u+rwX --exclude Music /sdcard/ pat@192.168.0.2:/data/pat/g2sd/\""

alias postflash="echo \"Mounting /system read-write\" && su -c \"mount -o rw,remount /system\" && echo \"Copying modified keyboard layout files...\" && su -c \"cp /sdcard/vision-keypad-wwe.kcm.bin /system/usr/keychars/\" && su -c \"cp /sdcard/vision-keypad-wwe.kl /system/usr/keylayout/\" && echo \"Deleting awful camera click sound...\" && su -c \"rm /system/media/audio/ui/camera_click.ogg\" && sync && echo \"All done. Please reboot now.\""

clear
uptime
echo

The first couple of aliases should be self-explanatory.
backupdata is, as the name suggests, to get my SD card’s content to my home server.
postflash is for after flashing a new ROM (usually a CyanogenMod nightly build). It gets my modified keyboard layout into place, and deletes the terrible sound file that gets played when I take a photo with the phone’s camera.

emerge output ends up as attachment.bin when sent with nail / Heirloom mailx

I really like the command line mailer Heirloom mailx (formerly nail), and now there is even a current version in portage again (still under the name mail-client/nail, but that doesn’t matter), so that’s even better. I use it on all servers, since it’s just convenient – it can handle attached files, UTF-8 etc. without any problems.

But there was one problem that bothered me for months already: It involved my check_updates.sh script, which basically just calls /usr/bin/emerge -upvDN --nospinner world for the host and all virtual servers, and then sends the output to me.

The problem: emerge’s output always ended up as ‘attachment.bin’, attached to the (otherwise empty) mail, although I piped it into mail -s "Updates for $DATE" root where it should come out as the mail body. I knew that Heirloom mailx does that, as soon as it doesn’t “like” one of the characters in the input, but I couldn’t think of a reason why it would do that with emerge’s supposedly plain-ASCII output.

Today I had enough of it, and fired up hexdump to investigate said ‘attachment.bin’, using the following command:
hexdump -e '1/1 "%03d \n"' attachment.bin | sort -u
It outputs the unique decimal values of any byte occurring in ‘attachment.bin’ as a sorted list. I expected to find something above 127 – but the highest occurring value was 122 (“z”). I then checked the top part of the list, and to my surprise, found 008 (backspace) there. After removing those by piping the output through tr -d '\010' (8dec = 10oct, and tr needs octal values), Heirloom mailx no longer put the text into ‘attachment.bin’. It now appears in the mail’s body, where it belongs.

By the way, those backspaces (when interpreted) change
Calculating dependencies ... done!
to
Calculating dependencies... done!
… so removing them is not a big loss. I’d like to know though, why they are there in the first place, even though the output doesn’t go to a TTY.