The Ultimate Setup Guide for ownCloud on Small Systems such as the Raspberry Pi

It took me about a year to collect this information. There are many guides, but all I found are incomplete. Here's the one guide to rule them all - hopefully. The guide works on Ubuntu and Debian without changes. It's optimized for resources, speed, security and ease of use. While this runs well on my old phone (ARMv7; 512 MB; ~1000 BogoMIPS), it should run even better on a Raspberry Pi.

Accessing Public ownCloud shares via WebDAV

Since ownCloud supports server to server sharing you can access public shares via webdav clients. You simply use the access token (t=...) as user name. If there is a password, use that as password, otherwise leave it blank. As URL you use the owncloud address with /public.php/webdav at the end:

-> webdavs://12345@myserver.com/owncloud/public.php/webdav

Speeding up your ownCloud on small systems such as the Raspberry Pi with Sqlite


I had seriously considered to use a raspberry pi system for setting up my ownCloud server. But the old pi had pretty much the same capabilities as my old mobile phone with cyanogen. And the phone has Wifi and some flash space already included. So I opted for the phone. As with most pi installations, the performance was not great. But I found some easy tweaks I haven't seen anywhere else to significantly improve the performance. I'm assuming you're already using the usual tweaks such as opcache(this will usually help more than the following tweaks!) and using cron.php. Please backup your owncloud.db before you start! You will need the sqlite3 tool (sudo apt-get install sqlite3).

Two ways to download your pictures from Picasaweb with Linux

There is a nerdy and a simple way. The simple way is to use the google data export ("takeout") pages. You select your photos, create an archive and download it. You may have to upgrade from Picasaweb to Google+ in order for this to work properly.

The nerdy way is via googlecl. Unfortunately this option does not currently work properly due to googlecl still using oauth version 1. But once that's fixed - or if you're still signed into googecl - you can use these two commands:

google picasa list-albums > albums.txt
parallel -a "albums.txt" -j 3 --eta google picasa get "{,}" .

Beware of weird folder names including / or other special symbols. Now you can e.g. move your pictures to your ownCloud server. No picasa needed.

How to change the volume with an active lock screen in android lollipop

This works at least from my Samsung galaxy S4: you press the power button for a few seconds until you see the pop-up to turn off the device, or to go into offline mode. Now you can use the volume buttons to change the ring tone volume.

Fixing Netflix Error Code: M7361-1254 on a Linux System

If you get this error code there is an issue with the sound output. If you use pulse, kill the pulseaudio process. Then close the browser, open it again.

Otherwise remove the kernel driver module for your sound card and insert it again. Then close and open the browser.

How to Fix a common VirtualBox Segfault

If you have a segmentation fault during the start of a VirtualBox machine, you are likely using an old, incompatible version of the VirtualBox Extensions. Simply update or uninstall them and things should work again.

An example from the dmesg kernel log:
EMT-1 [7265]: segfault at 618 ip 00007f0eaacbef31 sp 00007f0ed2afbc70 error 4 in VBoxDD.so [7f0eaac00000+26f000].

Checking S.M.A.R.T. status for USB drive

Usually smartctl -a works out of the box. But sometimes it doesn't. In that case, try using the option -d sat, e.g. smartctl -d sat -a /dev/sdb. That may solve if a modern external USB drive reports that SMART support is "unavailable" and that the "device lacks SMART capability". Because that a drive actually lacks the capability is extremely unlikely these days. If that doesn't work, you can try -d auto or consult an extensive list of options of different devices.

Recording with tape-a-talk to external sd card in KitKat

You can enter a manual storage path. It must be setup like the following path. This path can be adjusted to work with other apps and different devices:

/storage/extSdCard/Android/data/name.markus.droesser.tapeatalk/files

If you use the wrong path the app won't be able to write anything. This path works on most Samsung devices.

How to Fix a Broken Sector of Your Hard Drive

First you should really backup the whole drive. Because unreadable sectors mean that the drive will fail soon:
("Add. Sense: Unrecovered read error - auto reallocate failed
sd 0:0:0:0: [sda] CDB:  ... end_request: I/O error, dev sda, sector 3459933711 ...").

You may be able to solve the issue temporarily but you should expect the drive to fail completely at any moment. So ddrescue to another disk of the same size. First, only rescue good parts:
ddrescue -n olddew newdev ~/logfile

Then try to rescue the rest:
ddrescue olddew newdev ~/logfile

Then try to manually read the sector with hdparm. In your example, the marked sector above. This probably won't work.
hdparm --read-sector 3459933711
Then you can overwrite the sector with zeros so it won't cause repeated hangs:
hdparm --write-sector 3459933711

And now you order a replacement drive and wait for the drive to fail entirely.

How to Efficiently Replace a Broken Disk from a Linux Software RAID 5

1. ddrescue the broken disk to a new, completely empty disc. At least zero the former raid superblock... (ddrescue -n faileddev newdev logfile; ddrescue faileddev newdev logfile)
If successful (if you have bad blocks that couldn't be rescued, you should preferably rebuild the raid.)
2. add the disc to the raid and remove the failed disc from the raid
3. go to the sysfs folder of the raid device, e.g. cd /sys/block/md0/md/.
4. put the new disc into the slot of the failed old disc:, e.g.  echo 2 > dev-sdc1/slot.
5. check the raid to be sure if all worked out well: echo check > /sys/block/md0/md/sync_action.

TVHeadend with Transcode Support in Ubuntu 14.04

Unfortunately the packages from the repository no longer support transcoding recently. You have to build your own package.


sudo apt-get install build-essential pkg-config libssl-dev git libavahi-client-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libswscale-dev libavcodec-extra-53 liburiparser1 liburiparser-dev debhelper libcurl4-gnutls-dev a52dec


AUTOBUILD_CONFIGURE_EXTRA=--enable-libffmpeg_static ./Autobuild.sh -t trusty-i386

or

AUTOBUILD_CONFIGURE_EXTRA=--enable-libffmpeg_static ./Autobuild.sh -t trusty-amd64

Finally, the transcode setting is no longer in the general tab. Rather, you can now enable transcoding by selecting special profiles you can set up under Coniguration, Stream, Stream Profiles. Unfortunately, most the Android apps don't support this at the moment. You may want to try to checkout the version before committ c4089cc7a378abc2d8912d86d6440aab6230967a.

HTSP Plugin for Ubuntu 14.04

After trying to find a package for a long time I ended up compiling it myself. This is a link to my library file: libhtsp_plugin.so (AMD64). You can check with ldd libhtsp_plugin.so. If there are missing libraries, it won't work for you.

OpenVPN on Android only supports 4096 bits private key

If you run into the error
"OpenVPN core error : PolarSSL: error parsing config private key : PK - Bad input parameters to function."
with OpenVPN on Android you'll have to change your private key. It has to be supported by PolarSSL / ARM mbed. In my case, reducing the private key size to 2048 bits solved the issue.

Panbox missed an important library: no unix-java in java.library.path

The solution is simple. You need to install the libraries listed in the readme.txt file.

E.g. for Ubuntu or Debian:
sudo apt-get install dbus-java-bin python-appindicator python-nautilus libbluetooth-dev python-notify python-gtk2 python-dbus

Using GMail with IMAP Clients - especially when using the priority inbox

If you wish to use Gmail via IMAP, it's important to keep in mind some specialties in how Gmail handles IMAP. This is especially important if you use the priority inbox to filter important emails for you.

What you would do in Gmail | What you do in the mail client
  • Archive email | Delete the email (but do not move it into the trash folder)
  • Mark the email not important | Move the email from impotant to all mails or the inbox
  • Add a label | Copy the email to the folder
  • Remove a label | Delete an email from a folder (but do not move it to the trash folder)
  • Delete an email | Move it to the trash folder (you may also delete it from the current folder).

If you want to search your emails via IMAP, you will usually want to search inside the folder all mails. Note that unless you use special extensions the search in my tests only works for exact matches in the subject line. It does not find anything else, e.g. email addresses or content.

I hope that helps!

Network Manager not working: Disabled by Hardware Key

If Network Manager claims that Wifi is disabled by a hardware key, take these steps:
  1. Check if hardware keys disable the wifi (duh!) - this may include key combinations such as Fn-F2.
  2. Check rfkill list if some devices are blocked and unblock them with sudo rfkill unblock all
  3. If you have one blocked device, this may block all other devices due to a bug in Network Manager. Hence removing the modules of all other devices may be necessary to enable a device which is actually already unblocked. (e.g. sudo rmmod rf2800pci and sudo rmmod ideapad_laptop).
Worked for me - let me know how this works for you.

Successfully Connecting your Bluetooth Headset with PulseAudio and A2DP to Linux

After lots of trying to connect the bluetooth headset via bluetooth and pulseaudio to Linux, the following procedure has proved pretty successful for me most of the time:

  1. Pair Headset normally via blueman.
  2. Connect to the headset (aka telephony) service (not A2DP)
  3. killall -9 pulseaudio (it often hangs for me)
  4. start playing something
  5. open pavucontrol
  6. switch the playing output to the bluetooth device
  7. you now hear crappy sound
  8. now while the sound is playing, connect A2DP, either via blueman.
  9. pulseaudio should automatically switch to high quality playback now. otherwise: Go to the last tab in pavucontrol and set the profile to A2DP.

Enjoy! And let us know if this worked for you! ;)

Kernel Compile Service for Testing Patches and Bisecting

You know the situation, when you report a bug in the kernel and then ideally you're asked to test a patch? This means you have to compile your own kernel to test it and that means a lot of time: setting up a build environment, compiling, testing, compiling again, .... Depending on your skill and machine this may take a lot of effort.

It seems to be this could be so much easier and faster. The quick&dirty fix: e.g. the Ubuntu kernel ppa could provide a package with the already compiled sources so that you only have to compile that part which changed - if that would even work. The better fix: you could request a compiled image with a certain patch applied. That would not take too many resources - after all the compiled tree would already be there. And it would make things enourmously easier for debugging. It would not need to be available to the general public, but an "access key" could be distributed to someone who reported a bug in the bugzilla once a patch is ready for testing.

And what would help even more, would be if a git bisect could be done in the same way. If you had a powerful compilation server and you bisect via a web interface, download a kernel image, test it, and then tell the interface if the error occurred or not. Of course that would take much more power. But that's exactly why it would be great to have.

And overall, all this would improve the kernel debugging a lot and reduce the effort for developers and users with debugging.

Running New Software on an Old System

I have a netbook which still runs a very old system. It's ancient and no longer supported (just like Windows XP). But it's the last version which supports the proprietary Intel Graphics drivers (poulsbo) with video acceleration in Linux. Now the problem is using this in any environment would be extremely dangerous, because it's full of years of serious security issues. And the software really is very ancient.

Luckily, there is help, called schroot. Using a simple script, you can replace any command with a command out of the chroot. With this simple script, the application will behave just as if it was installed in your current environment - except for access to directories.

#!/bin/bash
schroot -c precise -- /usr/bin/google-chrome-stable ${@}

Of course you could just the same method to simple make your system a bit more secure for a few programs. You can use schroot and debootstrap to setup a secure environment.