Posts tagged: Kubuntu 12.04

Hide My Ass! and Kubuntu

Hide My Ass! provide an excellent VPN service, which is handy for streaming Netflix in countries other than the USA (not that I condone such an activity). In case you’re wondering why people would want to do that – the USA version of Netflix has a much larger and more contemporary catalogue.

As per most software companies they provide a GUI for Windows. Kubuntu users (and Linux users in general) have the option of manually setting up the VPN connections in NetworkManager, or using an executable shell script. The former option is a bit laborious, and the latter has failed to work for me until this morning.

As per the instructions, I made sure that I had openvpn-2.1 and curl installed (Kubuntu 12.04 uses openvpn-2.2).

sudo apt-get install openvpn curl

Then I downloaded and extracted the shell script, gave it a chmod and moved it to /usr/local/bin. For the lazier amongst you it looks a lot like this:

wget https://vpn.hidemyass.com/hma-vpn-linux-cli.zip
unzip hma-vpn-linux-cli.zip
chmod +x hma-vpn.sh
sudo mv hma-vpn.sh /usr/local/bin

So far so good, but executing hma-vpn.sh “Los Angeles” produces a “TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)” message. Perhaps ipchains is blocking the connection. The manpage for openvpn says that it uses port 1194 and also recommends altering the chain for the tunnel interface.

sudo iptables -A INPUT -i tun+ -j ACCEPT
sudo iptables -A INPUT -p udp --dport 1194 -j ACCEPT
sudo iptables -A OUTPUT -p udp --dport 1194 -j ACCEPT

That changes the ipchains for now. A reboot will cause the changes to be lost so we need to save and restore the chains. To save the chains we execute:
sudo sh -c "iptables-save > /etc/iptables.rules"

Kubuntu 12.04 (and I think all version since 9) use NetworkManager. So we need to restore the chains via NetworkManager. Run the following command:

kdesudo kate /etc/NetworkManager/dispatcher.d/01firewall

(If you’re hardcore you can edit it from the command line using vi)

Then add the following code:

if [ -x /usr/bin/logger ]; then
        LOGGER="/usr/bin/logger -s -p daemon.info -t FirewallHandler"
else
        LOGGER=echo
fi
case "$2" in
        up)
                if [ ! -r /etc/iptables.rules ]; then
                        ${LOGGER} "No iptables rules exist to restore."
                        return
                fi
                if [ ! -x /sbin/iptables-restore ]; then
                        ${LOGGER} "No program exists to restore iptables rules."
                        return
                fi
                ${LOGGER} "Restoring iptables rules"
                /sbin/iptables-restore -c < /etc/iptables.rules                 ;;         down)                 if [ ! -x /sbin/iptables-save ]; then                         ${LOGGER} "No program exists to save iptables rules."                         return                 fi                 ${LOGGER} "Saving iptables rules."                 /sbin/iptables-save -c > /etc/iptables.rules
                ;;
        *)
                ;;
esac

Ok. Now we get a new error message: “TLS Error: client->client or server->server connection attempted”. This message is a bit confusing,  but the solution is an easy one. It just involves adding “-p tcp” to the invocation of hma-vpn.sh. We now invoke it as:

hma-vpn.sh -p tcp "Los Angeles"

It asks for your HMA! username and password, and after a bit of negotiating, you’re surfing via Los Angeles.

Hooray!

Ubuntu reference on ipchains can be found here:

https://help.ubuntu.com/community/IptablesHowTo

You can sign up for Hide My Ass! using this link (and it gives me a little bit of commission):

http://hidemyass.com/vpn/r10785

{lang: 'en-GB'}

Compro Videomate C100 and Kubuntu 12.04

Long story. I bought a Compro Videomate C100 because it was cheap and I understood it would work under v4l. That was six months  ago and I’ve only just got it to work.

To see what was happening, I ran grep on the output from dmesg to find references to saa7134.

matthewa@alexandria:~$ dmesg | grep -i "saa7134"
[   11.584348] saa7134 0000:04:01.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[   11.584352] saa7134[0]: found at 0000:04:01.0, rev: 1, irq: 16, latency: 64, mmio: 0xfebffc00
[   11.584358] saa7134[0]: subsystem: 185b:c900, board: Compro Videomate DVB-T300 [card=70,autodetected]
[   11.584412] saa7134[0]: board init: gpio is 400000
[   11.632861] input: saa7134 IR (Compro Videomate DV as /devices/pci0000:00/0000:00:1e.0/0000:04:01.0/rc/rc0/input4
[   11.633226] rc0: saa7134 IR (Compro Videomate DV as /devices/pci0000:00/0000:00:1e.0/0000:04:01.0/rc/rc0
[   11.784007] saa7134[0]: i2c eeprom 00: 5b 18 00 c9 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[   11.784016] saa7134[0]: i2c eeprom 10: 00 ff 86 0f ff 20 ff ff ff ff ff ff ff ff ff ff
[   11.784024] saa7134[0]: i2c eeprom 20: 01 40 01 02 02 03 01 03 08 ff 00 89 ff ff ff ff
[   11.784032] saa7134[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784040] saa7134[0]: i2c eeprom 40: ff da 00 ff 86 ff ff ff ff ff ff ff 5a ff 03 17
[   11.784047] saa7134[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff cb
[   11.784055] saa7134[0]: i2c eeprom 60: 34 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784063] saa7134[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784071] saa7134[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784079] saa7134[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784087] saa7134[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784095] saa7134[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784102] saa7134[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784110] saa7134[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784118] saa7134[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   11.784126] saa7134[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   12.830402] saa7134[0]: registered device video0 [v4l2]
[   12.830449] saa7134[0]: registered device vbi0
[   13.338092] saa7134[0]/dvb: frontend initialization failed
[   13.338686] saa7134 ALSA driver for DMA sound loaded
[   13.338710] saa7134[0]/alsa: saa7134[0] at 0xfebffc00 irq 16 registered as card -2

This shows that Kubuntu is detecting the card, but wrongly as a DVB-T300. From CARDLIST.saa7134, card 19 looks like a safer bet. This is easily remedied and only involves creating a configuration file.
kdesudo kate /etc/modprobe.d/saa7134.conf

options saa7134 card=19 tuner=54
install saa7134 /sbin/modprobe --ignore-install saa7134; /sbin/modprobe saa7134-alsa

After the change the outptu from dmesg shows that the card is now being correctly detected.

matthewa@alexandria:~$ dmesg | grep -i "saa7134"
[   17.388103] saa7134 0000:04:01.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[   17.388108] saa7134[0]: found at 0000:04:01.0, rev: 1, irq: 16, latency: 64, mmio: 0xfebffc00
[   17.388114] saa7134[0]: subsystem: 185b:c900, board: Compro VideoMate TV [card=19,insmod option]
[   17.388129] saa7134[0]: board init: gpio is 400000
[   17.540010] saa7134[0]: i2c eeprom 00: 5b 18 00 c9 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[   17.540026] saa7134[0]: i2c eeprom 10: 00 ff 86 0f ff 20 ff ff ff ff ff ff ff ff ff ff
[   17.540041] saa7134[0]: i2c eeprom 20: 01 40 01 02 02 03 01 03 08 ff 00 89 ff ff ff ff
[   17.540056] saa7134[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540070] saa7134[0]: i2c eeprom 40: ff da 00 ff 86 ff ff ff ff ff ff ff 5a ff 03 17
[   17.540085] saa7134[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff cb
[   17.540099] saa7134[0]: i2c eeprom 60: 34 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540114] saa7134[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540128] saa7134[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540143] saa7134[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540158] saa7134[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540172] saa7134[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540187] saa7134[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540206] saa7134[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540214] saa7134[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.540222] saa7134[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.543424] saa7134[0]: registered device video1 [v4l2]
[   17.543476] saa7134[0]: registered device vbi0
[   17.545825] saa7134 ALSA driver for DMA sound loaded
[   17.545851] saa7134[0]/alsa: saa7134[0] at 0xfebffc00 irq 16 registered as card -2

VLC can now open the card as /dev/video1 and use the alsa sound card line-in for sound.

Details of the Compro Videomate C100 are here:

http://www.comprousa.com/en/product/c100/c100.html

A few helpful pointers (and the full card and tuner list) are here:

http://www.techsupportteam.org/forum/linux-alternative-os/5417-saa7134-pci-tv-tuner-cards-linux.html

 

{lang: 'en-GB'}

WordPress Themes