Big day for the citizens of India today

July 19, 2017 Leave a comment

Supreme courtof India the highest court of the country has tasked a nine judge bench to decide whether the fundamental right to privacy is guaranteed under the constitution of India.

This is a key case as the central government of India is forcing on its citizens a surveillance scheme known as Aadhaar under various dubious benefits by using the cloak of Aadhaar act, the constitutional validity of which is still debatable. Government has chosen to push Aadhaar full swing and had made it mandatory for various government schemes even as the supreme court had made clear that nobody can be denied benefits just because they do not have Aaadhar that is until the court decides one way or other. But in a blatant disregard for the supreme court’s earlier judgement govt choose to make it mandatory by using corporate media houses to push its agenda.

Earlier the Attorney general of India Mukhul Rohatgi representing centre in a related Aadhaar case has argued before the same court that no citizen has fundamental right to privacy. what is even more appalling is that no citizen has right to sue the govt for its miuse of Aadhaar and the country has no privacy and data security laws. The supreme court has finally decided to hear on the Aadhaar case after long delay of nearly 2 years when it gave it’s initial judgement. Today’s case will closely watched as the fundamental right to privacy of every citizen is at stake.

I sincerely hope this case gets the coverage it deserves as the country’s press and media has taken over by the people in power to brainwash the people by repeated push of its propaganda and using its various constitutional arms to silence any dissent. India has never seen such a totalitarian government since the constitution’s formation after its independence and the country’s people are kept divided using clever religious divide and rule politics and swaying the emotions of the young and vulnerable in its favour using its dedicated IT wing which cleverly plants fake news at the right time doing its damage before truth could surface.

People of India has to unite and reject any propaganda claims, think rationally, question everything, use common sense and not let emotion take over. As the world’s biggest democracy needs its people to be informed to have a functioning democracy where the fundamental right to privacy and security is a core value.


Another win for Internet, Net neutrality is upheld in the world’s biggest democracy – India

February 9, 2016 1 comment

After nearly a year-long consultation with the public and telecoms, Telecom Regulatory Authority of India (TRAI) has finally announced their stand this evening barring content discrimination and differential pricing. This development has come after the direct effect netizens of India rallying up to protect the level playing field of Internet.  A major credit for this victory should go to the people behind who created awareness and helped people respond to TRAI on its consultation. This is not an ordinary victory for the people of this democracy as the telecom companies were fiercely lobbying against any net neutrality rules and huge corporates like google, who were found to be silently lobbying against net neutrality in India, and facebook’s own which changed its name to free basics after criticisms pointing out they were neither charity nor the entire Internet. TRAI has asked reliance communications, the country’s only provider of facebook’s free basics to suspend providing free basics to users earlier this month. Facebook spend millions of amounts for advertising free basics with billboards everywhere, full-page advertisements in the newspapers and attractive television advertisements, it also made use of its user base unethically to lobby for it, a move which was later criticized by TRAI. Today TRAI has taken a stand officially to prohibit content discrimination and differential pricing,with the exception of emergency services. Full official report can be read  in TRAI’s official report here. The guidelines released are,

  • No service provider shall offer or charge discriminatory tariffs for data services on the basis of content.
  • No service provider shall enter into any arrangement, agreement or contract, by whatever name called, with any person, natural or legal, that has the effect of discriminatory tariffs for data services being offered or charged to the consumer on the basis of content
  • A service provider may reduce tariff for accessing or providing emergency services, or at times of grave public emergency, provided it is reported to TRAI within seven days and the authority approves it.
  • TRAI may review these regulations after a two years or after a period TRAI may deem fit.
  • TRAI may also levy a penalty of 50,000 Rupees up to a maximum of 50 lakh Rupees if any service provider is found contravening these regulations.

Indeed a day to celebrate. Though the battle is won, the war is not won yet with major private corporations and governments wielding more and more control into the daily lives of the people, there must be a similar fight to liberate the people from the surveillance of the governments and from the clutches of these corporations. For only free thinking and informed citizens can uphold this democracy.

Rise up to save the Net neutrality in India

April 19, 2015 Leave a comment

As the fight to a neutral non discriminatory open Internet just got over in the US, and FCC ruled in favor of the people, upholding the principle of Net neutrality after hearing comments sent to FCC by the Internet users. History: fight and victory

Now a similar fight is underway in India and the Indian telcos are lobbying to break the Internet as we know it.Airtel announced differential pricing plan for voip content and withdrew it after severe social media backlash. Now they have come up with Airtel zero which let access apps pay them and let users access it for free giving preferential treatment for corporations with big money. facebook’s in the name of charity let’s people to access only sites that signup with them for free. Both if gone ahead would break the the Internet as a level playing field. Telcos are crying to let them charge for services like whatsapp,viber,redphone and other instant messaging and voip apps which are used by people for free stating that they are eating their revenues even as the data usage grows.

Everything is not over yet, TRAI (Telecom Regulatory Authority of India) has released a consultation paper(link) on 27th March asking for the public to comment on a set of 20 questions and send them to email id listed on page2 of the paper with a tight deadline of 24th April.

Internet users all over India has responded and websites have been set up and to help people understand the issue and respond to TRAI with a simple mouse click.

Also several videos have put up explaining the issue with some going viral. Here is a simple video that have been put up by the people defending net neutrality that explains this issue in simple terms

What can you do to save the Internet :

If you are in India respond to TRAI by sending an email to them, write to your MP and let more people know about this issue. Even if you are not in India you can share about this and let your friends in India know about this issue. For more ways to help please look at

Your voice makes a difference, here is a list of developments so far,

Flipkart pulls out of Airtel Zero:

Several Internet companies walk out of facebook’s

Politicians and celebrities voice their support for Net neutrality:

Freeing up resources for use by GNU/Linux on your android device

December 7, 2014 1 comment

I had an old samsung galaxy 3(GT-15801) which was lying around unused with a broken screen and decided why not install GNU/Linux on it. If raspberry pi can run raspbian well, then this phone could try to do as well. Have a look at my earlier post here on how I installed debian wheezy on it. While I was able to install and run debian successfully, this phone has only 256 MB of RAM and android uses most of it, there was only 4-6 MB that was free at any time. I removed all the extra apps from installed play store and some bloatware installed on the system partition and kept only the essential ones in case I need it later.

But android always makes use of all the available free memory to make apps open faster and I’m only going use debian on it. I connect remotely to debian on the phone using ssh. But simply killing the running android system processes wont work as android will restart them immediately.

My guide builds on the one used here :

Remember these commands must be run on an adb shell and not to be typed directly on your android device.

Get root on your android device and issue,

stop zygote   #or just stop

This stops the zygote and system server process from running and will not be restarted again automatically. Now if you check the available RAM in your device, you can see more that 50% of it is free. As there is no android’s virtual machine running none of the android apps will run and you will not be able use your device physically. If you still need more memory you can just use the stop command to free up other unused system processes.

To restart it if your want to use android back on the device, just use

start zygote #or just start

In general, issue ps command and look for processes that have its PPID (parent process id) as 1, which means that these processes are started by init as a service. you can get service name for this processes from /init.rc file on android and use stop command to prevent it from running.

Let’s take a look at how to stop mediaserver process for an example.

Filter the output of ps command to look for processes with parent process id 1. Below is the output from my phone, when i grep the ps output to get processes having id 1.

# ps | grep ” 1 ”
root      1     0     272    248   c030f5dc 0000ef8c S /init
system    2164  1     176    116   c050be58 0001264c S /system/bin/akmd2
shell     2165  1     680    316   c03fc378 afd0da1c S /system/bin/sh
system    2166  1     752    296   c0510ed4 afd0dcbc S /system/bin/servicemanager
root      2167  1     3688   580   ffffffff afd0e35c S /system/bin/vold
system    2168  1     1852   336   ffffffff afd0e35c S /system/bin/notified_event
root      2169  1     3672   552   ffffffff afd0e35c S /system/bin/netd
root      2170  1     628    308   c0559cec afd0e67c S /system/bin/debuggerd
system    2172  1     8764   868   ffffffff afd0e67c S /system/bin/drexe
system    2173  1     1036   348   c0292b1c afd0eca8 S /system/bin/npsmobex
media     2175  1     50960  7276  ffffffff afd0dcbc S /system/bin/mediaserver
bluetooth 2179  1     1208   720   c030f5dc afd0eb2c S /system/bin/dbus-daemon
root      2181  1     756    320   c05eba1c afd0da1c S /system/bin/installd
keystore  2182  1     1560   404   c0559cec afd0e67c S /system/bin/keystore
shell     2183  1     3308   176   ffffffff 0000ecd4 S /sbin/adbd
shell     2199  1     308    128   c030f5dc 0000fffc S /system/bin/immvibed
radio     2298  1     14480  2172  ffffffff afd0e35c S /system/bin/rild
root      4282  1     6120   1040  c030f5dc 40419364 S /usr/sbin/sshd
wifi      4333  1     2300   1340  c030f5dc afd0dde4 S /system/bin/wpa_supplicant
root      7823  1     122864 28164 c030f5dc afd0dde4 S zygote
dhcp      9231  1     800    404   c030f5dc afd0eb2c S /system/bin/dhcpcd

From the above output, to stop /system/bin/mediaserver we have to find the service name for the process used by android. To find it, look for the process name in /init.rc file used by init process.

# grep “/system/bin/mediaserver” /init.rc
service media /system/bin/mediaserver

This is my output, when i look for the process mediaserver in /init.rc file. The service name for the process is the second word of the output which is media here. Now to stop mediaserver process just use,

stop media

In general to stop an android service use the format,

stop <servicce-name>

This will stop the service from running. If you need to start a stopped service use the format,

start <service name>

This way more than 60-70 % of RAM can be made available for use by your debian or ubuntu or any other GNU/Linux installed on android and android will not get in your way.

One important thing to note is that if your root access is controlled by an android app like Superuser or SuperSU, to notify or to get permission from user for root access, once zygote is stopped and you exit as root on your shell, you’ll not be able to gain root again without restarting the device, as you stopped the android runtime and your su will fail with segmentation fault without the controlling app running.

Installing Debian wheezy on android (chroot method)

December 7, 2014 5 comments

This is a yet another guide on how to install Debian GNU/Linux on your android phone. While there are huge number of resources available on the Internet dedicated on how to install GNU/Linux to your android phone, this guide aims to show how to do it step by step manually without the use of any additional android applications and tools.

Before we begin, there are some prerequisites that should be met to install GNU/Linux on your android device,

  • Root access to your android device and busybox installed.
  • Your android’s Linux kernel should support loop devices and one of etx2/3/4 filesystems
  • A system running Debian GNU/Linux

If these prerequisites are met, then let’s get down to our first step, which is creating a chroot image.

Note: commands which required to be run as root are prefixed with sudo.

Debian has a tool called debootstrap which automates the process of creating a base debian system which can be chrooted into. Install debootstrap if you don’t have it installed already.

sudo apt-get install debootstrap

Now run debootstrap in terminal with the following arguments,

sudo debootstrap –arch armel –foreign wheezy ./wheezy

Note: Issue with WordPress fonts makes double dashes appear as single dash. single dash which appears before arch and foreign needs to be replaced with double dash

As we are creating a Debian system for a different architecture than an x86 system in which debootstrap is run, –arch armel argument is used to instruct debootstrap to create debian base system for arm architecture. –foreign instructs it to do initial unpack only, a second stage install is done on the actual hardware. wheezy instructs it to create a wheezy system. Replace with any other name like squeeze or jessie or testing or stable to create an appropriate system image. ./wheezy tells it to download the packages to directory named wheezy in the current directory from where debootstrap is run. And finally a repository url to fetch the packages from. You can use your local repository here, but make sure it has packages for the architecture armel. See man page of debootstrap if you need more information.

While this process runs let’s create an image file to hold the Debian system. I prefer to use an image file instead of creating an dedicated partition on the sdcard, as this way its portable and can be resized later easily when you need more space. To create an image file with size 1GB run the following command,

dd if=/dev/zero of=./linux.img bs=1M count=1024

If you need any other size replace count with appropriate value. Any size can be used according to the free space on your android’s sdcard, but a minimun of 1GB is recommended.Once it completes a file named linux.img with specified size is in the current directory.

Before creating a file system on this file, check what ext filesystem your android’s Linux kernel supports by running the following command in your android terminal.

grep ext /proc/filesystems

My phone’s kernel supports only ext2, so I’m creating an ext2 filesystem on this image file.

sudo mkfs.ext2 linux.img

Once filesystem is created, this image file can be mounted anywhere on the system, like an ordinary disk drive. I’m creating a directory named tmpmntpnt under tmp and for mounting this image file,

mkdir /tmp/tmpmntpnt

sudo mount -o loop linux.img /tmp/tmpmntpnt/

After this is done, check whether the debootstrap has completed successfully. If it is complete, copy the files under wheezy directory created by debootstrap to this linux.img mounted under /tmp/tmpmntpnt/ using,

cp -rp ./wheezy/* /tmp/tmpmntpnt/

-rp is used to recursively copy the files and preserving the files ownership and permissions. Once the files are copied, unmount the image using the command,

sudo umount /tmp/tmpmntpnt

Now the first step which is creating a chroot image is complete.

Before moving on to the second step, copy the linux.img just created to your android’s sdcard.

Moving on to second step, preparing your android device and mounting the image.

There is a lot of typing that needs to be done on the android device, so its preferable you use adb shell to type commands from your workstation to android device instead typing it directly in the device. Install android-tools-adb in debian which enables us to connect to android device over usb.

sudo apt-get install android-tools-adb

While installation is going on, enable android usb debugging in your android device settings under developer tools menu and connect the device to your workstation using usb cable and after adb-tools is installed,run

adb shell

to connect to your android shell. Once it connects and shows the $ prompt issue su command to get root. All the commands below needs to be run as root in your android shell.

Sdcards in android are mounted with nodev,noexec and nosuid. As we’ll be bind mounting device files and executing binaries with suid root, we’ll need to remount sdcard as,

busybox mount -o remount,exec,dev,suid /sdcard

Then, create a loop device to mount our linux.img,


mknod /dev/block/loop$loopno b 7 $loopno

This creates a block device with major number 7, minor number 254. These numbers are chosen by looking at the existing loop devices created by android os in my phone by running,

ls -l /dev/block/loop*

brw——- root     root       7,   0 2014-12-06 16:50 loop0
brw——- root     root       7,   1 2014-12-06 16:50 loop1
brw——- root     root       7,   2 2014-12-06 16:50 loop2

My android creates loop devices with major number 7 with incrementing minor numbers. You just have to choose the same major number and a minor number thats not yet used. As you install more apps to sdcard, it’ll create loop device for each of them, to prevent conflict I used 254, which is unlikely to be used any time soon. You can just use the same numbers I used without looking for all this stuff if you are not interested.

Once the loop device is created, associate our linux.img to this loop device using,

losetup /dev/block/loop$loopno /sdcard/linux.img

Now to mount it, create a directory under /data/local


mkdir $mntpt

Then mount the loop device to this directory,

busybox mount -t ext2 -o relatime /dev/block/loop$loopno $mntpt

Take care to replace ext2 with the filesystem you used for the linux.img.

This completes the second step.

Moving on to the third step, which is completing second-stage installation and setting up debian system.

Once the image has been mounted, bind the kernel directories from your android to debian using,

for f in dev dev/pts proc sys ; do mount -o bind /$f $mntpt/$f ; done

This above step bind mount /dev /dev/pts/ /proc/ /sys to debian image, which means that it will be available to both android and debian and changes made from debian to any of the files in these directories will reflect in android and vice versa. These directories are required for the proper functioning of debian.

You can also optionally bind mount your sdcard to make it accessible under debian by using,

sdcard=$(readlink -f /sdcard)

mkdir $mntpt/media/sdcard

mount -o bind $sdcard $mntpt/media/sdcard

This will make files in sdcard available to both debian and android.

Now our debian system is ready to be chrooted into. Before doing that we’ll need to set some environment variables, so that the binaries in debian work properly. If this not set up correctly, debootstrap will fail to run.

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export HOME=/root

Then setup /etc/resolv.conf file to enable dns resolution so that external addresses can be connected to,

echo “nameserver” > $mntpt/etc/resolv.conf
echo “nameserver” >> $mntpt/etc/resolv.conf

Now chroot into debian and complete the second stage installation,

chroot $mntpt /bin/bash -l
debootstrap/debootstrap --second-stage

This will take a while to complete. Once it completes, your debian system is ready 🙂

You can now use apt-get to install additional binaries. Let’s take a look at how to install openssh-server to remotely connect to our debian system.

Before using apt-get, repository needs to configured in /etc/apt/sources.list, just as you would do on a normal debian system. To do this run,

echo “deb wheezy main contrib non-free” > /etc/apt/sources.list

Now refresh repository information and install openssh-server

apt-get update

apt-get install openssh-server

After this is complete don’t forget to set password for root using passwd command to remotely log in to. Then try connecting to your device by using ssh from your workstation.

ssh root@<ip address of your android device>

If you are able to connect successfully, then congrats, you have installed yourself a debian system on your android from scratch. To unmount the debian system logout from the debian environment and unmount the directories mounted above using umount command.

Automate this mount and unmount process by putting the commands inside a script and installing it under /system/bin, so that it’ll save you from typing the commands over and over.

A quick hacked up script to mount and log in to the debian system and unmount it.



sdcard=$(readlink -f /sdcard)

if [ “$arg” == “unmount” ] ; then
umount $mntpt/media/sdcard
for f in dev/pts dev proc sys ; do umount $mntpt/$f ; done
umount $mntpt
losetup -d $loopdev
rm $loopdev
exit 0;

mknod $loopdev b 7 $loopno
losetup $loopdev /sdcard/linux.img
busybox mount -t ext2 -o relatime $loopdev $mntpt
for f in dev dev/pts proc sys ; do mount -o bind /$f $mntpt/$f ; done
mount -o bind $sdcard $mntpt/media/sdcard
export HOME=/root
export USER=root
export TERM=screen
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH

chroot $mntpt /bin/bash -l

Save this script under /system/bin by mounting /system partition as rw and assign executable permissions to the script by

mount -o remount,rw $(mount | grep system | cut -d " " -f 1,2)
cp /sdcard/linux /system/bin/linux
chmod 755 /system/bin/linux
mount -o remount,ro $(mount | grep system | cut -d " " -f 1,2)

From now on, you’ll be able to login to debian by just using linux and unmount it by issuing linux umount from android shell.
Update: to free memory used by android and make it available to Debian see

Shiny new Raspberry B+

November 18, 2014 Leave a comment

I gifted myself a Raspberry pi B+ for my birthday and it arrived in a beautiful package.I would like to thank Raspberry Pi foundation for having created such a wonderful device. If haven’t heard about what Raspberry pi is, head over to the foundation’s website

Raspberry pi b+ image

Raspberry pi b+ image

Installed raspbian operating system and started playing with it. For now, using it only in a headless configuration, not yet played with its video or audio capabilities.

Always wanted to do some closer to metal programming and control some real hardware. Started learning some bare metal programming with Baking Pi course from University of Cambridge,UK.

I found the raspberry pi forum a useful place to get help and learn what interesting stuff other people is doing with it.

Also, the ARM assembly tutorial series from is an interesting stuff to learn about ARM assembly and has about 21 chapters about various concepts of assembly programming.

I found interesting the following projects done using raspberry pi,

A supercomputer built using a cluster of raspberry pi’s

The FishPi project, to send an autonomous vessel controlled using a raspberry pi to cross the Atlantic unaided.

And many more projects like building a quad-copter,FM transmitter using raspberry pi etc.

I wish I could do something more interesting and creative as these people. Anyways, it’s great to be a part of the community containing all these awesome people.

I welcome myself to the world of Raspberry pi 🙂

Reset the Net : Don’t ask for your privacy, Take it back

June 1, 2014 1 comment

The day of action for privacy and freedom is on June 5th and is less than a week away. Join Reset the Net and pledge to take actions to protect your privacy.

Why Reset the Net?

NSA and Governments around the world has taken the Internet and turned it into a surveillance state. So let’s make it harder for NSA and anyone who want to spy on us. Our, best defense right now is to encrypt everything.

Here is a short video explaining everything.

Why June 5th?

June 5th, 2014 marks one year since the NSA’s classified documents about mass surveillance came to light. Thanks to Edward Snowden, British daily The guardian published this story last year. Here is a link to the original story published. Since then a lot of revelations have been made and more is yet to come as promised by Mr. Snowden.

Fight for your Privacy


On 6/5, 65 Things We Know About NSA Surveillance That We Didn’t Know a Year Ago –  By EFF