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 savetheinternet.in 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 Internet.org 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.

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 internet.org 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.

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 http://www.netneutrality.in/support/

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.

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.

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.

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.

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,

loopno=254

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,

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

mntpt=/data/local/linux

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.

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.

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 http://www.raspberrypi.org/

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.

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.

If you are an Internet user living in the United States, FCC has asked for your opinion on their new rules for regulating Internet. Write to them staing why having a free, open and equal to all Internet is important to have.EFF, the leading nonprofit organization which fights for our Internet freedom is asking for your help to protect Net Neutrality.