About Leo Gaggl

ict business owner specialising in mobile learning systems. interests: sustainability, internet of things, ict for development, open innovation, agriculture

Twitter RSS Feeds

Now that Twitter has totally killed their V1 API there is no official way to get Twitter feeds via RSS. Which is a real shame as RSS is a well accepted Open Standard for this type of information :-(



The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.

SHAME ON YOU TWITTER !

Currently there seem to be very few third party sites providing RSS services and it appears unlikely many will as Twitter will just kill them with changes to their API and/or terms & conditions as soon as they gain traction.

Here is one I found to get a Users Timeline (which is not all that useful).
http://www.twitter-rss.com/

However Hashtag or Search to RSS services are harder to find and will need a lot more work to implement
http://www.queness.com/post/14004/easiest-way-to-retrieve-twitter-timeline-and-hashtags-twitter-oauth-api-11

Please use the comment section if you are aware of others !

Remove Ubuntu Webapps integration features

One of the most annoying features in Ubuntu from 12.10 onwards are the pesky notifications popping up asking if you want webapps support everytime you visit a supported webpage?

Whilst you can disable this in Firefox’s browser options: Firefox > Preferences > General: Uncheck “Prompt integration options for any website”.

Firefox Webapp Intergration Options

However I prefer to remove the browser extensions entirely.

sudo apt-get remove xul-ext-unity unity-chromium-extension

NOTE: Take care – unfortunatly you can not remove the following as their removal will cause Unity to fail !

  • unity-webapps-common
  • unity-webapps-service

Quick ‘manual’ Eclipse install on Ubuntu

Since I always had trouble with the Eclipse version that is avaialable via the Ubuntu repositories I often need to install Elcipse on new machinery. Hence I am documenting the process for myself and hopefully it might help others as well.

Orion’s Umbra by jah~, on Flickr
Creative Commons Attribution-Noncommercial 2.0 Generic License  by  jah~ 

If you haven’t got the Java dependencies

Java dependencies install

sudo apt-get install openjdk-7-jre openjdk-7-jdk icedtea-7-plugin

Eclipse download

Note: download link needs to be updated – current as of 2013-06-10

cd /tmp
wget http://mirror.aarnet.edu.au/pub/eclipse/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz
tar -xzf eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz
mv eclipse/ /opt
rm -f eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz

Create symlink

ln -s /opt/eclipse/eclipse /usr/bin/eclipse

Create application launcher

sudo touch /usr/share/applications/eclipse.desktop
echo "[Desktop Entry]" >> /usr/share/applications/eclipse.desktop
echo "Version=4.2" >> /usr/share/applications/eclipse.desktop
echo "Name=Eclipse" >> /usr/share/applications/eclipse.desktop
echo "Comment=Integrated Development Environment" >> /usr/share/applications/eclipse.desktop
echo "Exec=/opt/eclipse/eclipse" >> /usr/share/applications/eclipse.desktop
echo "Type=Application" >> /usr/share/applications/eclipse.desktop
echo "Icon=/opt/eclipse/icon.xpm" >> /usr/share/applications/eclipse.desktop
echo "Terminal=false" >> /usr/share/applications/eclipse.desktop
echo "NoDisplay=false" >> /usr/share/applications/eclipse.desktop
echo "Categories=Development;IDE" >> /usr/share/applications/eclipse.desktop
update-desktop-database

Simple conky system monitor configuration

Just a quick note on install and configuration of Conky.

Conk Screenshot

Installation

sudo apt-get install conky conky-all hddtemp curl lm-sensors
sudo chmod u+s /usr/sbin/hddtemp
sudo sensors-detect

vim ~/.conkyrc

This is the content of my config file.

use_xft yes
xftfont Ubuntu Condensed:size=9
xftalpha 0.8
override_utf8_locale yes
update_interval 5.0
total_run_times 0
own_window yes
own_window_transparent no
own_window_argb_visual yes
own_window_argb_value 155
own_window_colour 081100
own_window_type normal
own_window_class conky-lgaggl
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#background yes
#out_to_console no
double_buffer yes
#max_user_text 32768
minimum_size 300
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_shade_color black
default_outline_color white
default_bar_size 150 5
default_gauge_size 20 20
imlib_cache_size 0
draw_shades no
alignment middle_right
gap_x 15
gap_y 15
border_inner_margin 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
default_color ffffff
color1 ffffff
color2 cccccc
color3 000000
color4 FFAA00

TEXT
${font UbuntuBold:bold:size=11}${color4}Info ${color2}${hr 2}${font}
${color1}Date ${alignr}${color2}${time %a,}${color}${time %e %B %G}
${color1}Time ${alignr}${color}${time %T}

${font UbuntuBold:bold:size=11}${color4}System ${color2}${hr 2}${font}
${color1}Hostname ${alignr}${color}${nodename}
${color1}${sysname} ${alignr}${color}${kernel}-${machine}
${color1}CPU ${alignr}${color}${freq_g}GHz
${color1}Loadaverage ${alignr}${color}${loadavg 1} ${loadavg 2} ${loadavg 3}
${color1}Uptime ${alignr}${color}${uptime}
${color1}Cpu Temperature ${alignr}${color}${acpitemp}C

${font UbuntuBold:bold:size=11}${color4}Processors ${color2}${hr 2}${font}
${color1}Core 1 ${alignr}${color}${cpu cpu1}% ${cpubar cpu1}
${color1}Core 2 ${alignr}${color}${cpu cpu2}% ${cpubar cpu2}
${color1}Core 3 ${alignr}${color}${cpu cpu3}% ${cpubar cpu3}
${color1}Core 4 ${alignr}${color}${cpu cpu4}% ${cpubar cpu4}

${font UbuntuBold:bold:size=11}${color4}Memory ${color2}${hr 2}${font}
${color1}Memory ${color}${alignr}${memeasyfree} / ${memmax}
${color1}Currently ${color}${alignr}${memperc}% ${membar}

${font UbuntuBold:bold:size=11}${color4}Filesystem ${color2}${hr 2}${font}
${color1}/ ${color}${alignc}${fs_used /} / ${fs_size /} ${color}${alignr}${fs_free_perc /} %
${color}${fs_bar 5,300 /}

${font UbuntuBold:bold:size=11}${color4}Networking ${color2}${hr 2}${font}
${if_existing /proc/net/route wlan0}${color1}Ip ${color}${alignr}${addr wlan0}
${color1}AP ${color}${alignr}${wireless_essid wlan0}
${color1}Signal ${color}${alignr}${wireless_link_qual_perc wlan0}${wireless_link_bar 10,100 wlan0}
${color1}Download ${alignr}${color}${downspeed wlan0}${downspeedgraph wlan0 10,100}
${color1}Upload ${alignr}${color}${upspeed wlan0}${upspeedgraph wlan0 10,100}
${color1}Total Down/Up ${alignr}${color}${totaldown wlan0}${color1}/${color}${totalup wlan0}
${else}${if_existing /proc/net/route eth0}${color1}Ip ${color}${alignr}${addr eth0}
${color1}Download ${alignr}${color}${downspeed eth0}${downspeedgraph eth0 10,100}
${color1}Upload ${alignr}${color}${upspeed eth0}${upspeedgraph eth0 10,100}
${color1}Total Down/Up ${alignr}${color}${totaldown eth0}${color1}/${color}${totalup eth0}${endif}${endif}

${font UbuntuBold:bold:size=11}${color4}Weather ${color2}${hr 2}${font}
${color1}Temperature ${alignr}${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ YPAD temperature} °C
${color1}Humidity ${alignr}${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ YPAD humidity} %
${color1}Cloud Cover ${alignr}${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ YPAD cloud_cover}

${font UbuntuBold:bold:size=11}${color4}Top Processes ${color2}${hr 2}${font}
${color1}${top name 1} ${alignr}${color}${top cpu 1} ${top mem 1}
${color1}${top name 2} ${alignr}${color}${top cpu 2} ${top mem 2}
${color1}${top name 3} ${alignr}${color}${top cpu 3} ${top mem 3}
${color1}${top name 4} ${alignr}${color}${top cpu 4} ${top mem 4}
${color1}${top name 5} ${alignr}${color}${top cpu 5} ${top mem 5}

Note: if you want to use this config file you want to at least change the METAR code (YPAD in my case) with one closer to you – see http://www.rap.ucar.edu/weather/surface/stations.txt.

Autostart config

vim ~/.config/autostart/conky.desktop

This is the content of my config file.

[Desktop Entry]
Type=Application
Exec=/usr/bin/conky
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_AU]=Conky
Name=Conky
Comment[en_AU]=Conky System Monitor
Comment=Conky System Monitor

Sources

Installing Ubuntu on Toshiba Z930 Ultrabook

Since I have been really happy with the performance and mobility on the Toshiba Ultrabooks (see previous blog entries) I have now chosen to stay with a tried brand and uprgrade to the Z930 i7 model.

Unfortunately this now comes with added hurdles by our good friends at Microsoft in the form of UEFI and the pre-installed disaster that is Windows 8. Instead of totally wiping the system as I did with the Z830 model I decided to install next to Windows 8 as lots of people have reported problems with the UEFI bootloader and the BIOS if you start messing with the pre-installed partitions (specially the EFI partition).


EDIT (2013-06-10): It turns out that Ubuntu works just fine without the factory partitions (which I found out accidentally & not necessarily planned … see cautionary note at the end of this article). The important part is the “Fix GRUB bootloader” section below as the unit refuses to boot without that step. Hat tip and thank you to the boot-repair developers !


Install procedure

Resize Windows partition

I resized the Windows partition in the Windows Control Panel (after I spent considerable time actually finding the damn thing in that crazy Metro UI) and removed all the Windows Crapware that comes pre-installed with this thing (such as Norton Security, Microsoft Office and other annoying ad-ware). I decieded to use 200GB for the Ubuntu system leaving roughly 40GB for Windows.

Boot off the Ubuntu 13.04 USB
Keep F12 key pressed on power up to get the choice boot from USB. Choose “Try Ubuntu” (this is a good idea to see if you have any issues with Ubuntu) and then start the install process from the desktop.

Install Ubuntu

I used 5GB of swap space (10GB of RAM) and the rest of the free disk space as root partition, but you can use any layout you like) and installed Ubuntu.

Reboot

After first reboot I was sort of hoping to get a choice, but the thing booted straight back into Windows 8. Turns out you have to do some more work to get rid Windows 8.

Fix boot options

Go to the PowerOff options, and while holding the SHIFT key, click on Restart.

Window Troubleshoot Power Options

When the menu below appears, select Troubleshoot, then UEFI Firmware Settings.

Window Advanced Power Options

It will ask you to reboot to go to BIOS.

BIOS Changes

Disable “Secure boot” in the “Security” tab

Control Panel –> Power Options –> Choose what the power button does

Note: You need to click on “Change settings that are currently unavailable” and should see something like below.

disable fastboot

Uncheck the option that says “Turn on fast startup”

Fix GRUB bootloader

You need to boot from USB stick again (and choose “Try Ubuntu”). This might be avoidable if you change the BIOS settings before you install Ubuntu. Please leave a comment on this blog for other users if you can test this as I certainly do not want to go through this procedures just to test if the order can be changed. :-)

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)

boot-repair

Check the options and follow the instructions given.

Source:
https://help.ubuntu.com/community/Boot-Repair
https://help.ubuntu.com/community/UEFI

Reboot and you should be presented with the GRUB Boot Menu (which should default to UBUNTU, but still allow you to boot into Windows 8 for those who have masochistic tendencies).

Enjoy !!!

CAUTION (2013-06-10): Be careful when re-installing Ubuntu in a dual-boot configuration. Do not choose the option “Remove existing Ubuntu partitions & re-install” – manually delete and re-create the partitions instead. I found out the hard way that this option will REMOVE ALL EXISTING PARTITIONS. In my case that does not matter as I wasn’t planning to use Windows 8 at all. I just left it there as some people reported trouble booting when the partitions were removed. It actually means I just have just recovered 40GB of wasted SSD space. But if you want to dual-boot be careful with that option.

EDIT (2013-06-08): turns out there is a confirmed bug in the ACPI power management module on this unit. However thanks to Alexander Pevzner there is a temporary kernel module that fixes the issue.

Using TOR and PRIVOXY on Ubuntu

This covers only the basic install and configuration for future reference. More info on Privoxy can be found on their website http://www.privoxy.org/.

Install

apt-get install tor privoxy

vim /etc/privoxy/config

uncomment the following line:

forward-socks5 / 127.0.0.1:9050 .

If you need to browse internal hosts while connected:

forward 10.*.*.*/

Browser Configuration

Firefox: FoxyProxy
Chromium: Proxy Switchy

Documentation: http://www.privoxy.org/faq/misc.html#TOR

FreedomBox + RaspberryPi = FreedomPi

I have been watching progress on FreedomBox ever since watching a video of Eben Moglen a few years ago.

Turns out that that they recently announced the availability of their 0.1 preview release. As part of this there is one component that is extremely useful for RaspberryPi users (funnily the co-founder of RasperryPi is also called Eblen by first name – go figure) out there concerned about increasing snooping of private information by governments and corporations for a variety of reasons.

Meet ‘freedombox-privoxy’

freedombox logo

https://www.gitorious.org/freedombox-privoxy/freedombox-privoxy

This software combines the functionality of the Adblock Plus ad blocker, the Easy Privacy filtering list, and the (HTTPS Everywhere](https://www.eff.org/https-everywhere) website redirection plugin into a single piece of software to run on your FreedomBox. Combining these different plugins into software for your FreedomBox means that you can use them with almost any browser or mobile device using a standard web proxy connection.

Best of all this has already been made available via the Raspbian repositories (http://mirrordirector.raspbian.org/raspbian/pool/contrib/f/freedombox-privoxy/) so the install is extremely simple.

sudo apt-get install privoxy-freedombox

Note: make sure that you have the ‘contrib’ branch in the Raspbian repositories enabled in /etc/apt/sources.list

deb http://mirrordirector.raspbian.org/raspbian wheezy main contrib non-free
deb-src http://mirrordirector.raspbian.org/raspbian wheezy main contrib non-free

Kudos to James Vasile for the technical work !

To get some more idea on the usage of privoxy you can check this article.

OpenVPN – forward all client traffic through tunnel using UFW

By default OpenVPN only routes traffic to and from the OpenVPN Server. If you need all traffic from a client through the OpenVPN tunnel there are several options listed in the OpenVPN docs (http://openvpn.net/index.php/open-source/documentation/howto.html#redirect). Since I don’t have any control over the server in some cases I needed a client side solution. As I already have ufw running with Ubuntu I wanted to use the existing software.

Here is how to configure ufw to enable routing all traffic from your client machines through the OpenVPN Server.

Forwarding policy

Change default forward policy, edit /etc/sysctl.conf to permanently enable ipv4 packet forwarding. (Note: This will take effect at next boot).

sudo vim /etc/sysctl.conf

# Enable packet forwarding
net.ipv4.ip_forward=1

UFW config

And then configure ufw in /etc/default/ufw
sudo vim /etc/default/ufw

DEFAULT_FORWARD_POLICY="ACCEPT"

UFW before rules

Change /etc/ufw/before.rules to add the following code after the header and before the “*filter” line. Match the IP/subnet mask to the same one as in /etc/openvpn/server.conf.

sudo vim /etc/ufw/before.rules

# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to eth0
-A POSTROUTING -s 10.8.0.0/8 -o eth0 -j MASQUERADE
COMMIT
# END OPENVPN RULES

Enable OpenVPN

Open openvpn port 1194
sudo ufw allow 1194

Start UFW

sudo service ufw start

Connection Android 4.x MTP mass storage to Ubuntu 12.x

The ability to connect Android 4.+ devices to Ubuntu using the USB Mass Storage interface has always been a pain. With Ubuntu 13.04 a new MTP back-end (gvfs-mtp) is going to be introduced, but I have had some issues with the 13.04 Beta so I found this backport PPA to Ubuntu 12.04 and 12.10

sudo add-apt-repository ppa:langdalepl/gvfs-mtp
sudo apt-get update
sudo apt-get install gvfs
sudo apt-get upgrade

Kudos to Phillip Langdale for the work and maintaining the PPA !

Enabling the watchdog timer on the Raspberry Pi

Turns out that the Broadcom BCM2708 chip on the RPi has a hardware watchdog. This can be very useful if your RPi is located remotely and locks up. However, this would not the preferred method of restarting the unit and in extreme cases this can result in file-system damage that could prevent the RPi from booting. If this occurs regularly you better find the root cause of the problem rather than fight the symptoms.

Enable Watchdog Kernel Module

echo 'bcm2708_wdog' >> /etc/modules
sudo modprobe bcm2708_wdog

Install Watchdog Daemon

sudo apt-get install watchdog chkconfig
chkconfig watchdog on
sudo /etc/init.d/watchdog start

sudo vim /etc/watchdog.conf
# Uncomment the line watchdog-device = /dev/watchdog
# You might also want to uncomment max-load-1, or add something like "max-load-1 = 24" to reset your Pi if the load average exceeds 24 in any 1-minute span.

sudo /etc/init.d/watchdog restart

The watchdog daemon will send /dev/watchdog a heartbeat every 10 seconds. If /dev/watchdog does not receive this signal it will brute-force restart your Raspberry Pi.

If you are feeling adventurous you can test the setup by launching one of the fork-bombs you can find out there. Just make sure you don’t have anything of importance running.
: (){ :|:& };:

Thanks to gadgetoid for the original tip !