Monday, 6 February 2017

Transmission reverse proxy

All right, I have to write this down before I forget. I spent the better part of the day figuring this out, so here it is in case I ever need this again.

I wanted to set up a short URL for transmission-daemon on my NAS so that instead of awkward http://nas:9091/ I could type something more finger-friendly (most notably, without the colon for port number), ideally http://nas/t/. Here is the final config that resulted after several hours of research and apache2ctl restarts:

<VirtualHost *:80>
        ServerName nas
        RewriteEngine on
        RewriteRule /t[/]?$ /transmission/web/ [R=permanent]
        ProxyPass /transmission
        ProxyPassReverse /transmission

Thanks to everyone on forums and StackOverflow for numerous solutions that allowed me to piece this all together.

Friday, 18 October 2013

Nexus 4 SIM card problems

A while ago, after I got my shiny new Nexus 4, I've suddenly started having a problem with one of my SIM cards - the phone started to randomly lose the connection to the SIM card, and even a restart would not help. The internet was silent - apparently no one had problems that were anything like this.

After three or four hours of experiment and trial, on the verge of sending the phone back to Google to be replaced, I finally understood what the problem was.

Apparently, SIM cards can have contact pads that differ in size and their position on top of the card. It doesn't really matter since the contacts are large enough to allow for such inconsistencies. However, when the contact pad is too close to one edge of the card, it gets short-circuited by the metal SIM card holder of the Nexus 4 as can be seen here:

Once I found this out, the solution was simple: you can put a piece of non-conductive tape either on the card holder or on the SIM card itself to protect the contacts. I chose the latter, as only very few cards have this problem and it is easier to "patch" them. This solution is not exactly glamorous, but quite effective - I haven't had a problem since.

Tuesday, 13 August 2013

TfL Knows about You

This morning I received a curious example of data mining performed by Transport for London - an email warning that part of the station I use every day will be closed for renovation.

I highly doubt that they sent out this email to all the Londoners who use other stations - how many of them would care about a staircase at Finsbury Park? The only way for them to target me with this information is to data mine my Oyster travels and see which stations I use the most. While it is quite and obvious and expected that they will use the data in such a way, it still a bit scary. Even more so knowing that my Oyster card is registered with my real name and address.

There is nothing like starting your day with a small reminder that someone out there knows a lot more about you that you think.

Saturday, 15 December 2012

Skydrive WebDAV Access - Updated

Somehow there is very little information about WebDAV access to Skydrive, which is upsetting, because with 7GB (or 25GB, if you're lucky) of storage it becomes a very nice place to store your files.

Now, Microsoft officially claims Skydrive does not support WebDAV at all, which is sort of funny when you consider that it is exactly what the new Office 2013 uses to allow you to save your files there. Basically, when you save a document to Skydrive from one of the Office apps, it mounts your Skydrive account to a folder, saves a document there and then dismounts it.

Doing this yourself is very simple, and while some older tools (like Skydrive Simple Viewer or Skydrive plugin for Total Commander) don't seem to work, Office is going to help us.

First, connect enter your Skydrive account details in Office 2013 to enable all related capabilities.

Second, open any document, click Save As, select your Skydrive and click Browse. The following window should come up, showing the contents of your Skydrive.

All you need to do now is to click on the address bar and copy all its contents - this is the WebDAV address of your Skydrive account.

Now you can use this address in any WebDAV enabled application in any operating system. The simplest way to see if it works is to map a network disk in Windows. Use your Microsoft account email as username and your password when prompted.

Overall, WebDAV access might be a bit slow at times, but I find having direct access to my files very convenient for certain applications where Dropbox-like syncing might be an overkill.

UPDATE: Having to use Microsoft Office just to get your WebDAV address is highly inconvenient - for Linux users it means they have to have access to a Windows box. Fortunately, as I have just found out, there is a very simple way to get your Skydrive WebDAV address from any OS.

Just log in to your Skydrive web interface at, click your name in the top right corner and select "Edit Profile". When the page opens you should have a similar address in your address bar:!/cid-5190000000013e3c/

Now take the part after "cid-" (in this case "5190000000013e3c") and add it to the following address: "". In our example it becomes:

And voila - here is your Skydrive WebDAV address. Again, you can try it out by mapping it as a network drive in Windows Explorer.

UPDATE2: Unfortunately, while the above solution works well in Windows and allows you to access your Skydrive via a mapped network drive, it doesn't seem to be possible to do the same in Linux.

Despite many efforts to mount Skydrive with davfs2 in Linux, I kept getting the "Found 302" error, meaning that the provided WebDAV URL redirects to another page. It turns out, davfs2 currently is unable to handle any redirects, which Skydrive (unlike many other WebDAV storage providers) uses. There is a related davfs2 bug that was filed over 2 years ago, yet it seems no progress has been made since.

Effectively, until this is fixed, there seems to be no way to access Skydrive via WebDAV in Linux.

UPDATE3: To be completely fair, it turns out it is possible to access specific folders of your Skydrive via WebDAV but only when using KDE's Dolphin file manager. This is made possible thanks to the fact that Dolphin uses Konqueror's (Rekonq's) cookies to establish a session, thus if you have previously logged to with Rekonq, it will use the same session and allow you to see your files.

To do that you have to log in to the Skydrive web-interface with Rekonq, open a folder you want to work with and note it's number in the browser's address bar. The number will be the digits after the "!" in the address. Now, insert the following addres in Dolphin's address bar and you should instantly see your folder and work with it normally:


In this example "5190000000013e3c" is your ID we've found in the steps above and "12345" is the folder number.

Unfortunately, this only works in Dolphin and you can only work with one folder at a time.

Wednesday, 21 November 2012

eBay Strikes Again

Though not eBay of course, but its bidders.

I think I have already expressed my feelings about bidders on eBay who push the price of an item far beyond the item's retail price. I still fail to understand the nature of such behavior, yet recently eBay has given me a couple more examples.

Recently I have been on the hunt for cheap water filter replacements. has a six-pack of them for 16 GBP with the traditional Amazon free delivery. I thought I would check up eBay before making a purchase. Recently, an item ended - as a result of 14 bids the winner got the same six-pack for 16 GBP + 4.99 GBP for delivery. How crazy is that?

Another example - I've been looking to purchase a coffee Moka pot. Again, 21 GBP for a brand new one delivered at Amazon vs astonishing 21 GBP + 6 GBP delivery on eBay.

I still fail to understand what motivates these people to push the bids up so high. Clearly, anyone making bids on eBay is aware of Amazon and would at least check what the retail price of the item is before making a bid. I was thinking that maybe some tend to think that the delivery from an eBay seller for which they have to pay an extra may be faster than Amazon's free service, but then again, these people have 5-7 days to wait for an auction to end, thus time is hardly critical for them. I can't understand why one would not only prefer a shady eBay seller with no warranty or returns against good old Amazon.

Whatever the reason, it all makes me sad and angry. I come on eBay to hunt for good deals and expect them to be lower than the retail price of the item. Unfortunately, many a time this is not the case.

Wednesday, 14 November 2012

Awesome WM: Remove Border from Maximized Windows

I am currently using quite a bright theme with my Awesome WM on Linux and the borders of an active window are of quite a bright blue color. While this really helps in easily identifying the active window in a tiled layout (i.e. with several terminal windows side by side), such a bright border can become a nuisance when it appears at all times around a maximized window such as Firefox.

Here is a simple workaround to remove the border from maximized windows and put it back when a window is unmaximized:

Replace this line:
client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end) 

with the following code:
                if c.maximized_horizontal == true and c.maximized_vertical == true then
                        c.border_width = "0"
                        c.border_color = beautiful.border_focus
                        c.border_width = beautiful.border_width
                        c.border_color = beautiful.border_focus

The apparent shortcoming is that the window must have to be focused at least once for this to work - I haven't found a better hook other than focus to attach the code to.

Thursday, 30 August 2012

How to transfer Amazon EC2 instances from one account to another

OK, I have to write it down right away before I forget all the details.

Tomorrow is the last day of my Amazon AWS Free Tier, so once again, just like a year ago, I had to create a new account to keep running a micro Linux instance for free (digression: I've spent some time comparing the EC2 prices to Hetzner virtual hosting and as it turns out, it makes no sense to pay for EC2 with my demands, Hetzner will turn out to be much cheaper. However, since it's free, nothing can beat it).

Last time I've done this I actually had to manually transfer all my data to a new Linux installation. This time I thought there were better ways to do that, as I couldn't afford to waste all the time recreating all the setup over again.

So, here's what you need to do to transfer a running EBS instance to a different account:

0. Take a note of the specs of the AMI that you're using. Most important parts are the architecture (i386 or x86_64 and the aki of the kernel being used).

1. Set up a new account while still using the old one. You can even use the same credit card, all you need is a different email address.

2. There are two ways you can go here. The aim is to create a snapshot that is owned by the new account, not "rented" from the old account:
2.1. Use the old account to create a snapshot of the running AMI, then share the snapshot with the new account.
2.2. In the old account share the running AMI with the new account. Then, in the new account create a local snapshot of that AMI.

3. Either way, you should end up with a snapshot that is owned by the new account. To confirm, remove all sharing from AMIs and snapshots in the old account.

4. Open up the snapshots list in the new account and click "Create image". Set up the AMI as usual but be sure to check that architecture and the aki match those that were used before with this AMI. Otherwise, the instance will appear to have started but will not respond to any interaction.

5. Use the new AMI to start a new instance as usual.

And you're done. Now you can double check that everything is working fine and remove the snapshot which uses up the S3 space, and can easily exceed the 5GB Free Tier allowance.