Skip to content

Limit Spotify upstream bandwidth with trickle

While debugging network related stuff on my router, I noticed that something in my network was using all the available DSL upstream bandwidth. The only active application at that time was Spotify and it wasn't even playing a song. After digging around in the interwebz for a time, I found quite a few reports about this behaviour. Spotify is using p2p techniques to distribute content. So, if somebody plays a song, Spotify tries to download it from another user (maybe you!) who has the song already sitting in his computers disk cache. While Spotify is saving money by using p2p, because it decreases bandwidth usage on their servers, it can lead to problems on your side. Spotify sometimes decides to use ALL of the available upstream, causing short lag spikes in games or SSH sessions. Or maybe your ISP limits traffic to a certain amount of data per month.

Since Spotify does not include an option to limit p2p upstream (Hey Spotify, I am a paying customer and I am pissed!) you have to help yourself and use the neat Linux tool "trickle" to limit the Spotify upstream maximum. Continue reading "Limit Spotify upstream bandwidth with trickle"

Using EncFS with Copy Cloud File Storage

I have been trying out Barracuda Networks cloud file storage "Copy" for the last few day. The Linux client seems stable and syncing has been reliable up to now. Although there are claims that Copy stores files encrypted, it is also an architectural fact that Copy needs to store your encryption keys on the server side.

So, if you want to store private Data, then you'll have to setup encryption yourself - Enter EncFS. Continue reading "Using EncFS with Copy Cloud File Storage"

copycom2deb - Create Debian packages for the Copy client agent

Copy is a new cloud storage solution similar to Dropbox. They have a better price model, allowing you to use 250GB of storage for 99$ per year. The free account starts with 5GB and you can get a few extra GB by promoting the service. You get client agents for most operating systems, including Linux.

Barracuda only supplies Linux users with a simple tgz installer. This installer is perfectly working, but I wanted to install and update software with dpkg. So I hacked a little script to download the current version of the client agent and build a Debian package from the tgz.

You can find the script on GitHub:

Spotify and Linux: Backing it up with dpkg-repack

Spotify is great and it is nearly the only choice if you want a music streaming service with a native Linux client. But the client is still in a "preview" stage. So if Spotify releases a new version of the Linux client, it sometimes botches your spotify installation. So if you do your "apt-get update && apt-get upgrade" dance, it might leave you without music (eeeeeeek!). But fear not! There is an easy way to backup your working Spotify installation on an Ubuntu/Debian system. Continue reading "Spotify and Linux: Backing it up with dpkg-repack"

Caching authenticated downloads with Varnish and VCL

Imagine the following scenario: You have an web application that delivers data, you have a huge number of requests per second, the data is identical for all users, but you want to limit access to authenticated users. Your back end application is slow and does not cache the created data. You also want to lighten the load on the authentication service. Fixing your back end application or your authentication service unfortunately is not an option. I wanted to solve this problem with Varnish and a VCL only solution, so no inline C or Varnish modules are required for my approach. Continue reading "Caching authenticated downloads with Varnish and VCL"