OwnCloud – Upload failed. Could not find uploaded file.

The precise error Owncloud would give at the top of the screen when I tried to upload a file was: Upload failed. Could not find uploaded file.
I spent ages trying to fix this with nothing online to help (which is why I’m writing this now for other’s, in case others are as ignorant as I am).
Go into /etc/php/php.ini and ensure that upload_tmp_dir is set to a directory included in the open_basedir path further up the file. The open_basedir set of directories is a list of base directories all PHP code can interact with. If your upload directory is not in there, any uploaded files are sent in the ether and then lost – with Owncloud complaining that it ‘can’t find them’. Owncloud can’t see the directory if it’s not one of those included in open_basedir.

Gnome Startup Crash when coming from KDE

Had some problems with Gnome failing to start and crashing with the weird sad face image and ‘Oh no, something has gone wrong’ error. If you check the error journal with ‘journalctl | grep gnome’ you may see some errors relating to PolKit. This can be checked against specifically with ‘journalctl | grep polkit’. If PolKit is throwing errors, installing polkit-gnome again. This seemed to repair paths, dependencies or whatever and after this Gnome booted successfully.

Fix for no emoticons on Motorola Moto G 2014

The new Moto G has an issue where emoticons do not show in any application correctly – where they should be is a blank space. This ‘bug’ has been shipped with the phone, but it is a misconfiguration left in by the developer and is easy to fix.

Go into the stock messaging app (not hangouts) and enter the settings. Find the ‘Character Encoding’ setting and change it from ‘7 bit’ to ‘automatic’.

This configuration seems to be a system-wide settings, and all applications will now display emoticons successfully.

Utilising OpenVPN and a Firewall to create an Intranet with private services

This post will explain how I’ve effectively created an intranet using my Digital Ocean Droplet, OpenVPN, and UFW. I’ve assumed that you’re technically capable and already have a good understand of routing, firewalls, sockets, services etc.

The first thing you’ll of course need is a server – be it a VM, Raspberry Pi, or VPS. If you do go the VPS route I recommend checking out Digital Ocean.

OpenVPN

Once you’ve got the server you’ll need to setup and configure OpenVPN. I won’t explain how to do that as it’s a relatively long process, but the best guide is probably here on the Arch Wiki. However once you understand it, it’s easy to make configuration changes in the future. In the OpenVPN settings you’ll need to enable ‘client-to-client’ communication, specify ‘tun’ for a tunnel device type (as we want a routed IP tunnel) and at various places in the config specify the IP range you want to use. I used 10.8.0.0/16 as that is a private range and not externally┬ároutable (any gateway/border┬árouter should drop the packets). In addition I found that using TCP as opposed to UDP was a better choice for the VPN, my phone does do some random reconnects sometimes when packets get out of order, but I’ve found that when browsing the web YouTube and GIFs are far more reliable. You can switch OpenVPN to TCP by changing the proto udp directive to proto tcp.
Continue reading

My experience of Dalvik vs. ART on Android

Back in July I decided to swap my phone and tablet’s runtime from Dalvik to the (apparently) newer and faster ART runtime. The difference between the two being that Dalvik performs Just-In-Time-Compiling (JIT) of the applications you are running, whilst ART performs compilation during the installation, saving the need for it later.

I had read that ART will use more space (storing precompiled executables) and the performance boost from using the precompiled executables would be noticable and a battery saver. Instead applications were choppier. I realised this even more strongly when I reverted back to Dalvik.

I appreciate that ART is still meant to be in Beta and a preview for developers, but I’m still disappointed it doesn’t work even remotely like people would hope. Yet.

How to get an A+ Rating on SSLLabs

To gain an A+ rating over at SSL labs requires your website’s SSL to be configured with the follow principles:

  • A large key size: 4096bits
  • HTTP Strict Transport Security
  • A VirtualHost configuration for the website that meets minimum requirements (see bottom).

You don’t need a trusted certificate to get an A+. The SSLlabs tool will grade you as T due to trust hierarchy issues, but underneath it does say “If trust issues are ignored: A+”, as you can see below.
Continue reading

Quick disable of IPv6 in Ubuntu, which is responsible for slow website connections.

By default Ubuntu has IPv6 enabled on network interfaces. This means when you try and visit a website, an IPv6 DNS request is made. It’s unlikely your ISP supports IPv6 and your client hangs waiting for DNS response from IPv6, whilst the IPv4 one has come back immediately. Eventually the IPv6 request times out, and if you reload the page it is instantaneous. This is because the cached IPv4 address is used. The solution is to disable IPv6

The Quad-A IPv6 DNS query is sent out immediately after the regular IPv4 A query.

The Quad-A IPv6 DNS query is sent out immediately after the regular IPv4 A query.

Run the following in a terminal to fix this.

sudo echo '##IPV6\nnet.ipv6.conf.all.disable_ipv6 = 1\nnet.ipv6.conf.all.disable_ipv6 = 1\nnet.ipv6.conf.default.disable_ipv6 = 1\nnet.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf

This adds a few lines to /etc/sysctl.conf that disable IPv6 at boottime.

Reboot.

Checking Ink Levels on Epson Printers in Arch and Ubuntu

Relevant to 2013 onwards involving udev and checking ink levels on older printers.

The standard GutenPrint libraries and drivers used by CUPS for printing can talk to Epson Printers well enough so that general printing can take place, test pages, change of print quality etc. However there is no decent means for returning current Ink levels.
Continue reading