newspaint

Documenting Problems That Were Difficult To Find The Answer To

Monthly Archives: August 2017

Running AUSkey on Ubuntu 16.04 in 2017

Getting the Australian government’s authentication mechanism “AUSkey” working on Linux is no easy feat thanks to its rather poor choice of Java plugins to do the job – now that browsers have discontinued support for Java plugins that becomes considerably more difficult.

I created a LXC container using instructions from this post to get a virtual machine with X11 over SSH support going – to completely insulate what I was doing from the rest of my operating system. In addition I had to sudo apt-get install xubuntu-icon-theme for completeness with the icons Firefox would expect.

Then I used the instructions at this forum post to get Firefox working with AUSkey.

  • download an “Extended Support Release” of Firefox (version 52.3.0) from https://www.mozilla.org/en-US/firefox/organizations/all/ for your OS/language
  • extract the .tar.bz2 file to /opt/
  • based on the system requirements execute the statement sudo apt-get install libgtk-3-0 libdbus-glib-1-2 libxt6
  • install the Java Runtime Environment (JRE) browser plugin using the OpenJDK package by first closing down your browser, then running sudo apt-get install icedtea-plugin, then starting the browser again and visiting about:plugins to confirm that the IcedTea-Web Plugin is in “State: Enabled” (should be the case without any additional changes)
  • now visit the activation link you were given in your activation e-mail (looks like https://auskey.abr.gov.au/Activate.aspx?code=TaRaQui37jag&verify=Y&pid=71), choose “Install AUSkey”, and then the browser may ask at the top of the screen “Allow https://auskey.abr.gov.au to run IcedTea-Web?”, press “Allow…”
  • you may get a security warning “The website’s HTTPS certificate cannot be verified. Do you want to continue?”, tick “Always trust content from this publisher” and press “Yes”
  • you’ll get a message saying “The application’s digital signature has been verified. Do you want to run the application? It will be granted unrestricted access to your computer.” Choose “Run”.
  • you’ll get a message saying “The application AUSkey from … uses resources from the following remote locations. They looks ok. Are you sure you want to run this application?”. Tick “Remember this option?” and then choose “Proceed”.
  • bizarrely, at this point, you might just have to go through a cycle of pasting your activation link into your browser and going through the motions again and again (each time ending up at the “Setting up AUSkey troubleshooting” page) until, maybe on the tenth time, it requires you to enter your activation code, confirm your details, and then choose a password.
  • It may be that when you access an AUSkey protected site you may have to reload the page a few times before it recognises the fact you have an AUSkey.

    The process seems very buggy.

OpenWRT/LEDE Buffalo WZR-HP-AG300H Getting 5GHz Radio Working

I had a problem with my Buffalo WZR-HP-AG300H, I couldn’t get the 5GHz radio wireless interface working along with the 2.5GHz radio.

In the end I used the following /etc/config/wireless configuration:

config wifi-device 'radio0'
        option type 'mac80211'
        option phy 'phy0'
        option txpower '7'
        option country 'GB'
        option hwmode '11g'
        option channel '7'
        option htmode 'HT20'

config wifi-device 'radio1'
        option type 'mac80211'
        option phy 'phy1'
        option txpower '9'
        option country 'GB'
        option hwmode '11a'
        option channel '120'
        option htmode 'HT40'

config wifi-iface
        option device 'radio0'
        option mode 'ap'
        option ssid 'my2500KHz'
        option network 'wlan'
        option encryption 'psk2'
        option key 'password'
        option wmm '0'

config wifi-iface
        option device 'radio1'
        option mode 'ap'
        option ssid 'my5GHz'
        option network 'wlan'
        option encryption 'psk2'
        option key 'password'
        option wmm '0'

This configuration seemed to work for me only after I rebooted the router.

LXC Container Reports PTY allocation request failed on channel 0 On SSH Connection

I tried upgrading my LXC from Ubuntu Trusty 14.04 by running sudo apt-get install lxc because, by default, the lxc package was not being upgraded.

But I then had problems getting consoles/terminals with my existing LXC containers.

This problem exhibits itself when attempting to ssh to a LXC container with the following message:

# ssh ubuntu@10.0.3.201
ubuntu@10.0.3.201's password: 
PTY allocation request failed on channel 0

It also exhibits itself when attempting to lxc-console a LXC container:

# sudo lxc-console -n mycontainer
lxc-console: commands.c: lxc_cmd_console: 722 Console -1 invalid, busy or all consoles busy.

(although a workaround is to connect using sudo lxc-console -n mycontainer -t 0).

The issue is that every container config file needs to have some extra lines added:

# required for lxc-console to work
lxc.tty = 4

# requires for interactive SSH to work
lxc.pts = 1024

One other issue I came across was that I would get the following errors when trying to start a container:

# sudo lxc-start -F -n mycontainer
Failed to mount cgroup at /sys/fs/cgroup/systemd: Permission denied
[!!!!!!] Failed to mount API filesystems, freezing.
Freezing execution.

This was bypassed by adding the following to the container’s config file:

# disable apparmour restrictions on container
lxc.aa_profile = unconfined

VLC on Ubuntu 16.04 with NVidia Graphics Card – Divx Video Playback Blank

I attempted to play a divx-encoded video on VLC 2.2.2 running on Ubuntu 16.04 LTS. The video was blank, although if, while the video was playing, I selected Video > Video Track > Disable, then select Video > Video Track > Track 1 from the menu it would display the current frame as a still image.

I opened up the messages window by selecting Tools > Messages from the menu. I then altered the Verbosity from 0 (errors) to 1 (warnings). Then I pressed play on the video for a short period to capture the warnings:

It displayed messages like:

avi warning: multiple riff -> OpenDML ?
avi warning: detected OpenDML file
avcodec info: Using NVIDIA VDPAU Driver Shared Library 384.59 Wed Jul 19 23:45:51 PDT 2017 for hardware decoding.
avcodec warning: cannot decode one frame (337 bytes)
core warning: VoutDisplayEvent 'pictures invalid'
core warning: VoutDisplayEvent 'pictures invalid'
avcodec warning: cannot decode one frame (337 bytes)
avcodec warning: cannot decode one frame (190 bytes)
avcodec warning: cannot decode one frame (190 bytes)

This led me to thinking the VDPAU driver was maybe failing.

A simple fix (although possibly not efficient) is select Tools > Preferences from the menu, select “Input / Codecs” from the icons at the top of the Simple Preferences dialog box, and change the first option, “Hardware-accelerated decoding” from “Automatic” to “Disable”. Then clicking “Save” at the bottom of the dialog box.