Monthly Archives: August 2015

PS4 – Alternative parental control

PS4 has abysmal parental control feature. It has global settings and several other issues. This means that only real way to enforce parental control is to lock the game disk away from your children. However, with the next generation consoles focusing more on digital games, it becomes a real problem if you buy games digitally through PSN and then had no way to control them.

After some research, I realised that you can have an alternate way of control if you buy digital games using an additional PSN account. This second PSN account should only be used to buy those games whom you want to control access to. Since PS4 only allows games to be accessible to other users if you set the PS4 as primary PS4 for your account, you need to avoid doing this for your second PSN account. In summary:

  • Have two separate account for buying digital games – one for regular games and one for other games (Adult only) that you want to control.
  • Set your PS4 as primary PS4 only for the first account. Don’t do it for second account.
  • Games for your first account will be accessible to all users on your PS4. Games from your second account will only be accessed when you login to that account. Set proper password for this second account.

File transfer from Android on Ubuntu

adb is the tool that can transfer files (it does many other things) from android phones to your computer. Here is the summary of how it can work from Linux. I tested on Kubuntu 13.10 and my Nexus 4 running android 4.2.

  1. Make sure latest version of adb is installed: sudo apt-get install android-tools-adb
  2. See this link about how to provide USB permission for specific device. In short, create a file /etc/udev/rules.d/51-android.rules and add a line specific to your phone and your username. (By the way, make sure that if you have a folder $HOME/.android , then it is owned by this user.)
  3. Make sure “USB debugging” is enabled on your device.
  4. Connect your phone and check the connectivity using “adb devices” command.
  5. Copy files using “adb push” or “adb pull” command.

Advanced CS course and other useful links

Some collected links for Advanced courses:

  1. Advanced Comp Sc courses
  2. 6.851: Advanced Data Structures (Spring 12)
  3. Jeff Erickon’s Algorithm course materials

Other random links:

  1. Parallel Programming – By Paul McKenney
  2. What every programmer should know about memory, [ pdf ]
  3. Modern Microprocessors – A 90 min guide
  4. How debuggers works
  5. 10 technical papers every programmer should read twice
  6. Deep C
  7. C FAQ
  8. Java Concurrency – Atomicity, Visibility and Ordering
  9. Needle in a haystack
  10. The status of P vs NP problem
  11. Functional programming for beginners
  12. On being a senior engineer
  13. Linux performance analysis and tools : Brenden Gregg
  14. C++ frequently questioned answers
  15. Interviews related – geeksforgeeks , careercup , Top 10 algorithms for coding interview, How to rock an algorithm interview,


Nexus 4 as gaming console !!

After going through a few references on the web (here, here and here), I was finally able to connect my Nexus 4 to TV and play game using a PS3 DualShock 3 controller. To summarize, here is what you need to do :

  1. You need a Slimport to HDMI adapter. The currently available one is SP1002, from Analogix. I bought it from iBhejo.
  2. Need to have a DualShock3 controller, it comes with PS3. (or you can buy it). There are reports of other controller working also, but I didn’t check them personally.
  3. Need to root your phone. This has two steps – first, unlock the bootloader, second, install the actual rooting app by temporarily booting into a custom bootloader. Note that you will still retain your stock bootloader and will continue to get updates from Google (as per the details on the thread).
  4. Need to buy the sixaxis controller software from google play. This works only on rooted phones.

The whole setup worked flawlessly for me and I was able to play FPS games like Shadowgun and Dead Trigger, pretty well.

More References:

Comodo driver installation on OpenSUSE

Recently, one of my friend and colleague, Imran, was having trouble installing COMODO anti-virus on OpenSUSE 12.2. The filesystem kernel driver compilation was failing for OpenSUSE 12.2 kernel. He asked me to take a look. Although I am not a big fan of running anti-virus on Linux, I decided to give it a try. It turned out to be a simple interface change. I ended up making a small patch. (This is on top of CAV_LINUX-1.1.268025-1.x86_64.rpm version).

For anyone who wants to try, here is how it can be used:

  1. comodo driver is installed at /opt/COMODO/driver.tar. Take a backup of the original file and extract the file in a temp location:
    mkdir $HOME/comodo_driver
    cp /opt/COMODO/driver.tar $HOME/comodo_driver
    cd $HOME/comodo_driver
    tar xvf driver.tar
  2. Here is how I apply the patch:
    [niraj@nk-lap avflt]$ pwd
    [niraj@nk-lap avflt]$ patch -p3 < /home/niraj/avflt_patch_f18.txt
    patching file avflt_check.c
    Hunk #1 succeeded at 273 (offset 4 lines).
  3. Tar it back and put it in original location:
    [niraj@nk-lap comodo_driver]$ pwd
    [niraj@nk-lap comodo_driver]$ mv driver.tar driver_orig.tar
    [niraj@nk-lap comodo_driver]$ tar cvf driver.tar driver
  4. on root shell:
    [root@nk-lap ~]# mv /opt/COMODO/driver.tar /opt/COMODO/driver_orig.tar
    [root@nk-lap ~]# cp /home/niraj/comodo_driver/driver.tar /opt/COMODO/driver.tar
    [root@nk-lap ~]#
  5. Run the comodo configuration tool …
    [root@nk-lap ~]# /opt/COMODO/

My Google nexus 4 story

I had been thinking about buying a new mobile phone for some time and had looked at many options. I finally decided to go for a Google Nexus 4, mostly because it has much better specs despite having a modest price. The caveat – it’s not available in India (officially).

Generally, the easier way of getting something from USA, is to have somebody bring it with them when coming to India. However, at this time, I couldn’t find any suitable person who could do this for me. So, I started looking at other options and came across several articles/blog of people who have done it – like and There is a lot of discussion going on Nexus 4 Indian thread. Most of these method consists of 3-4 steps like :

  1. Getting a forwarding US address from a third party (like ppobox)
  2. Connect to google play using a VPN so that they will think you are in US
  3. Order and provide the US address from step 1
  4. Third party will send it to your India address for some charges (including custom etc)

First Attempt : My first attempt was through ppobox. However, Google canceled my order after two days saying – “Order not able to be delivered to a PPO. Please update address in Google Wallet and place a new order. Thank you.

Second Attempt : After doing some more research, I ordered again through iShopInternational. I selected ishop because their’s was the least complex process. Everything has to be paid in advance and they will handle custom/courier/whatever. Their quote was for ₹ 21,463 (all inclusive) for 8 GB model. I ordered on 13th March and got the phone delivered on 19th March. Pretty fast !!!

Meanwhile, I also ordered Ringke Fusion hard case from iBhejo.

I will write more about my experience with Nexus 4 as I start using it …

Learning filesystem

I have been asked this question many times – “What are the best books/resources to learn about unix filesystems?”. Unfortunately, there is no clear answer. There is no good/authoritative one or two books that can teach you the basics of filesystem design and development. (Yes, I know there are couple of books, but none of them really fits the bill !!!). So, what should a new person starting in filesystem development should do?

Assuming the person has basic knowledge of comp sci (OS theory, algorithms etc), I would recommend to go through the filesystem related chapters on these 3 books:

  1. Operating systems: design and Implementation – Andrew S Tanenbaum
  2. Design and Implementation of FreeBSD Operating system -By M K McKusick
  3. Unix Internals – The new frontiers – Uresh Vahalia

Step 2: Once you got the basics covered, you can read these books to broaden your knowledge:

Step 3: Here, there is no limit. You can try to understand specific of individual filesystems, learn about new trends and research in the filesystems, various complex design issues of filesystems and so on . The list given below is only a starting point.

  1. KHB: A Filesystems reading list
  2. The Google File System
  3. Filesystems which have been ported to multiple kernels – MVFS (AIX, Solaris, Linux, Windows), IBM GPFS (AIX, Linux), ZFS (Solaris, FreeBSD)
  4. Copy-on-write filesystems – WAFL, ZFS and BTRFS
  5. File system consistency issues – Soft update vs Journaling then Log structured file system and finally NVRAM
  6. Filesystems and SSD : bcache, Hybrid Aggregates, more to come here …
  7. Compare various “Distributed” filesystems – GPFS , GFS2 (page 253), OCFS2, GlusterFS and Ceph etc…etc..
  8. Networked filesystem protocols : Read about NFS v4.1 and CIFS
  9. Log structured file system
  10. Soft updates, hard problems
  11. Filesystem in USErspace
  12. Windows vs Unix file system semantics
  13. BTRFS : Atime and btrfs,
  14. Building the next generation file system for Windows – ReFS
  15. ZFS – Jeff Boncwick’s blog, Adam Leventhal’s blog, ZFS – Last word in the filesystem ,
  16. NFS – Mike Eisler’s blog,
  17. More to come …

Updating Samsung Galaxy 3 with cynogenmod

I finally decided to upgrade my Samsung Galaxy 3 phone to CM. I have been running Android 2.2 (Froyo) from the Samsung official update so far. Galaxy 3 is not supported by the official CM team, but as expected, many other people are making a custom build of CM 7.2 for Galaxy 3. The list of available ROMs can be found here.

Now, this was my first experiment with such an upgrade, so I was looking for a tutorial.I found that here – How to use odin for dummies. To follow these steps, I had to boot into Windows (I normally use Linux) because I couldn’t find the appropriate software that works on Linux. I decided to use the ROM provided by marcellusbe The process worked almost smoothly and I was able to get Android 2.3.7 running on my phone within 20 minutes or so.

Most of the basic features seem to be working fine. I had missed “wiping the cache partition” earlier, which I did after the second reboot.

Now, I am looking for a way to do minor upgrades using CWM. CWM gives the ability to flash the ROM without using a computer. Unfortunately, I am unable to install that from the ROM manager because my phone model is not listed in the supported configuration. Need to explore more on this …

More References:

  2. Complete Guide to i5801 –