Using Multiple Network Interfaces simultaneously under Linux (Virtual/Real)

Scenario

My system is connected to a college hostel LAN. Internet is provided through the Cyberoam system. Thus, there is a cap on the maximum transfer speed for internet. I had an idea since months to exploit virtual interfaces to get more out of it. For eg, parallel downloads all at the max transfer speed and browsing simultaneously without being affected by those downloads. I didn’t find any favourable ways to achieve this until last couple of days when I came across various pieces which I could put together to get it done.

The whole idea is to create a virtual ethernet interface (which is connected to the LAN) using ip aliasing and route selected traffic through that interface in a simple way. We will be using a proxy server to bind connections to that ip alias as it is much more simpler to configure any application to use a particular proxy server than to set their outgoing interface.

Although I will considering only virtual interfaces in the tutorial, the same technique can be applied to actual multiple interfaces as well. Also, note that there are tons of ways one might want to configure the behaviour. This is another reason why I will be using a proxy server.
Continue reading

IPod Shuffle 4g under Linux

Project Link: shuffle.py

Couple of months ago, I got an Apple Ipod Shuffle 4g. Despite the presence of IPod syncing apps under Linux, my experience was annoying. Shuffle 4g changed compared to its predecessors regarding the database format and new features, so a lot of plugins and apps don’t work as expected. In this post, I will write about different ways to tackle this annoyance.

Basic Things to Know

Bah! why can’t Apple make straightforward stuffs! Anyway, here are things you should know in a nutshell. IPod’s internal software works on a defined structure in the mass storage of the IPod. The process of creating this structure may be referred to as initializing your device. For adding any content to your device, a simple copy is not enough, changes need to be made in the database (The iTunesSD file) as well.

If you want to know more about the database format, I highly encourage you to read it at http://shuffle3db.wikispaces.com/iTunesSD3gen
Continue reading

Handling constantly Interrupting Downloads using curl

My internet connection has an annoying problem of interrupting downloads too frequently. That way, downloading even resumable files can be tedious. Using the following one liner with curl, Life becomes much easier


until curl -C - -o "<output_file>" "<url>"; do :; done

Until makes sure the loop continues till curl returns a success status. A colon(:) is  a no operation command. This one liner can obviously be modified to suit your needs.

Moving to Nightingale

I had been using Rhythmbox since a long time. It was perfect for me, with clean interface, synced well with my Phone, had Last.fm support and lyrics support. However, encountered Nightingale a day ago and completely fell in love with it to extent I am switching permanently to it.

Nightingale

Nightingale forked off from Songbird, when it discontinued its support for Linux. My first reaction playing with Nightingale was, “Firefox modded into a music player?”. Nightingale’s engine is based on Mozilla’s XULRunner and Firefox users will feel home.

UI: The first thing impressed me about Nightingale was its beautiful and sleek UI. Most music players with sleek and attractive UI usually have a trade off with functionality. And most players with too much functionality usually end up being ugly. Nightingale puts up lots of things in front of you while maintaining its beauty and simplicity.

UI

Continue reading

Running Dota (1) on Linux with full customkeys

I have been running DoTA conveniently under Linux using Wine, since more than an year when I actually started playing DoTA. Everything works perfect without much effort. In this post, I explain the basic steps to get full DoTA Experience.

Configuring Wine

Very little configuration required. Might run straightaway. But there might be problems which will prevent you from switching between windows, minimizing, lose window focus, taskbar showing on top, etc. The best way to solve these is to configure wine to emulate a virtual desktop, and launch Frozen Thrones in a separate workspace. That way, you can switch between workspace conveniently using keyboard shortcuts (It is more convenient than minimizing under Windows). Execute winecfg and select Emulate Virtual Desktop under the Graphics tab. Make sure to fill up your native resolution there (or the resolution at which you will run the game). Run the game through


nimesh Warcraft III  1.26 $  wine Frozen\ Throne.exe

or

nimesh Warcraft III  1.26 $  wine Frozen\ Throne.exe -opengl  # If the above doesn't work for you well.

One problem that I regularly face while switching windows is that the Alt key becomes sticky, causing signalling in the map whenever I click somewhere. Keep Calm, and press Alt once again and release. This will solve it.
Continue reading

Using Hostapd with dnsmasq to create Virtual Wifi Access Point in Linux

NOTE: This is an alternative branch off from my previous Hostapd guide, which I really recommend going through before this.

In my previous hostapd guide, I used dhcpd to assign IP addresses to the clients connecting to the access point. While this works fine for most scenarios, it is an overkill to use dhcpd for such situations where normally the number of clients is 2-3, or around 20 at max. For such cases, dnsmasq is a better option.

Installing

Install dnsmasq from somewhere

# Arch Linux
sudo pacman -S dnsmasq
# Ubuntu
sudo apt-get install dnsmasq

Continue reading

Downgrading Packages in Arch Linux: The Worst Case Scenario

Background Story (You may Skip it)

Downgrading packages is a thing i don’t often encounter while using Arch. If something breaks, i wait for it to get fixed and the update again. But this time, the case was different. Late night, after a kernel (or libnl, i don’t remember) upgrade, my hostapd stopped working, complaining about shared libraries. Shockingly, i discovered that my hostapd was still at 0.7 while the latest stable version was at 2.0!(Reason provided at end) So i did an pacman -Sc to remove older hostapd versions from cache, which didn’t change anything, then made some correct changes and upgraded hostapd to 2.0. New problems in hostapd popped up, about nl80211 being unable to set my wlan to master mode. Now ahead of me was option of spending the rest of night desperately debugging the problem or study for the exam coming morning. Hostapd not working is a more serious issue for me.
Continue reading