Skip to main content

Posts

Force an application to use VPN, using iptables in Linux

Enforcing an application, for example a torrent client like Transmission , to always use the VPN interface or any particular network interface for that matter, is trivially simple using iptables on Debian, Ubuntu or any other GNU/Linux distro. Personally, I am running Debian Sid on the Raspberry Pi . Occasionally I use it for downloading files ( legal stuff, seriously, believe me :D  ) using Transmission Bittorrent client over a VPN connection. Sometimes it happens that the VPN connection fails and doesn't reconnect for whatever reason and Transmission continues pulling stuff directly over my internet connection, which I would like to avoid. Fortunately it is very straightforward to enforce rules based on application owner UID. Transmission runs under the owner debian-transmission in Debian (use htop to check this) and the following two lines of iptables ensures that any process with owner having UID, debian-transmission , will not use any other network interface apart from the
Recent posts

Intel 520 SSD upgrade on unibody Mac Mini - mid 2011

With the SSD prices dropping significantly in last few weeks, I couldn't resist the temptation to open up my Intel Mac Mini (unibody mid 2011 model) and pop in one. Although, Apple prohibits users to upgrade anything apart from the RAM, I love voiding warranties. Apple uses a proprietary connector to hook up the SATA disk. Fortunately the people at Other World Computing and iFixit are selling DIY second hard disk installation kit with nicely made video tutorials. iFixit, was showing out of stock, which made my task of choosing, whom to order from, much easier. For the SSD I went with 240 GB one from the trusted and reliable Intel 520 series. Some, Mac users were cursing at SSDs from other brands at various forums, though it wasn't very clear whether the problem was with the competence of the SSD manufactures in making their products compatible with Apple (or vice versa) or with the incompetence of the users performing the DIY upgrades! Anyway, most were satisfied wit

Raspberry Pi -- Installing Samba (Windows Share) File server

Having successfully run Debian Wheezy on my Raspberry Pi, I went forward with my initial idea of setting up a low cost power efficient file server for accessing my external hard disks from my Windows7 desktop, HP-Mini running Ubuntu and Mac Mini running OS X Lion (yeah I do like bragging about my machines :D ). This turned out to be pretty straight forward. As expected, the external Seagate USB disk immediately got recognized and appeared as /dev/sda [ 579.948350] usb 1-1.2: New USB device found, idVendor=0bc2, idProduct=3001 [ 579.948384] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 579.948405] usb 1-1.2: Product: FreeAgent [ 579.948421] usb 1-1.2: Manufacturer: Seagate [ 579.948447] usb 1-1.2: SerialNumber: 2GEX323R [ 579.967638] scsi0 : usb-storage 1-1.2:1.0 [ 580.970520] scsi 0:0:0:0: Direct-Access Seagate FreeAgent 102D PQ: 0 ANSI: 4 [ 589.142942] sd 0:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB) [ 589.1446

Running Debian on Raspberry Pi (and SD card woes)

After waiting for nearly 3months, I finally got my Raspberry Pi last week from Element14. Plan was to set it up as a file server for network enabling my external hard disks. Debugging setup Attempts to use a SandDisk 8GB Class 10 Extreme SD card and Debian Squeeze image, following the instructions here , were completely futile. Tales of my woes and subsequent hardware level debug attempts can be found in this thread . Plugging in the card and attempting to boot the RasPi failed miserably initially. Damn ugly pull up resistors on the SD IO lines Implementing the pull-up resistor hack suggested by jhasler , resulted in a fugly looking but partially working RasPi. It was atleast attempting to boot now, although it was throwing up a kernel panic immediately after loading the kernel. After loading kernel card drivers SD DAT0 line, before kernel is loaded. Probing the SD card IO lines with a high BW scope, revealed some glaring anomalies. The SD Clk speeds up a

What quantum physicists and movie/music industry have in common

Recent attempts to purchase 780 nm laser diodes for my experiment, made me realize how much atomic physics and laser cooling labs have become entangled with the optical disk industry. Rapid developments in optical drive industry, which made Rubidium so easily accessible to every Tom, Dick and Harry working on  atomic physics few years back is now making our lives difficult by rendering, once easily available technology, obsolete faster than ever. 150 mW 780 nm laser diodes which formed the heart of 48X CD burners, could be picked up for a few bucks from Digikey or Farnell, a few years back. Diodes with similar specs are now only available from specialized industrial and research laser vendors for a price that is atleast 2 orders of magnitude higher than the price when CD burners were ubiquitous. Ofcourse the silver lining is, with the shift towards Blu-ray, wavelengths around 400nm, which once could only be achieved with the not-so-cheap non-linear frequency doubling crystals, have n

BSNL Self Care Portal on Chrome/Firefox in Linux

BSNL has recently (not sure how recent, since I returned to India after quite a few months) made some changes to their accounting system and the old intranet site (10.240.43.216) for checking unbilled usage no longer seems to be working. It has been replaced with an ultra crappy, barely functional, CRM portal from Siebel and it manages to suck better than the most powerful vacuum cleaner ever made. To make matters worse, it is labelled as " Internet Exploder only", so any other standards compliant browser, which doesn't cause the internet to explode doesn't seem to work. Having nothing better to do, I delved a bit deeper to find out why non-IE browsers fail to render this piece of shit. A little bit of Googling made me stumble upon this - link . Apparently the login window seems to be some kind of popup with some applet inside. Whichever brain-dead retard designed it, something seems to be horrendously wrong with the way the login window captures the mouse focus. C

Experiences with new Mac Mini

Earlier this month I bought a Core i5 Mac Mini. It was quite an impulsive decision, partly influenced by the fact that it was a bit annoying frequently rebooting my office Dell desktop to switch back and forth between Windows and Linux. I have been using Linux for everything (like browsing, programming, creating Tex documents as well as for music and movies) since the last 4+ years. However, when I joined as a Grad student in CQT , earlier this year, my requirements changed a bit, which made be quite a bit dependent on Windows. I got involved in some device driver development in Windows, creating/maintaining several VIs in Labview and working in AutoDesk occasionally to coordinate with workshop technicians. Moreover the lab-notebooks were traditionally being maintained in MS OneNote. Since I am heavily reluctant to completely move away from *nix for my computing needs, I tried dual-booting my Core i7 desktop with Windows 7 and Ubuntu 11.10. Primarily I was using Ubuntu, but had to freq