Photobucket

Sunday, October 23, 2011

How to frighten your friend on a boring weekend

So, you wanna scare your friend this weekend? And you are wondering how to do that. Well, here is an idea. During my summer internship, I was trying out VNC on various machines including my android phone and an android tablet. That is when I found this out -



What you need is a VNC server and a client. On my ubuntu machine I had installed tightvncserver and xtightvncviewer. What we could do is use the vnc server to start a new X session. For those of you totally new to many such things, 


1) To install tightvncserver do a

Code:
sudo apt-get install tightvncserver

Similarly install xtightvncviewer.


2) Set up your vnc password by doing a

Code:
tightvncpasswd


Set your password and then

3) Start the new X session in a different display by doing

Code:
tightvncserver :1

4) Next, in order to view the session you created you need to use vnc viewer. For this do

Code:
xtightvncviewer :1

Type in your password and then you should have a window which shows your desktop.
Find below a screen shot I took of my office screen with two viewers open side by side for the same new session ( I soo miss the huge monitor :| )


So now, all you need to do to scare your friend, is some how sneak up one day, download a scary mp3 on his computer and may be setup a cronjob to start the vncserver, and then run the mp3 in the :1 display. Do tell me if you try this out or you have a better way to spook your friend ;)
Read more!

A very handy wireless mouse using your android phone

PRemoteDroid is an awesome app which you must have on your android phone and your laptop. Suppose you are giving a talk somewhere or just giving your course presentation, you don't have to stand right next to your laptop without going forward and interacting with the audience. All you need is this app installed on your phone and your laptop with bluetooth enabled.

You need the server app on your laptop and the client on your android phone(which you can get it on the market). You can get the server app here . If you are using an ubuntu machine then you also need libbluetooth-dev installed. After this all you need to do is start the server on your laptop as




Code:
java -classpath bluecove-2.1.jar -classpath blucove-gpl-2.1.0.jar -jar PRemoteDroid-Server.jar


Then set the password up, and start the bluetooth server by right clicking the tray icon. Also open up the android application and pair up your laptop with your phone. Now you have your handy wireless mouse whereever you carry your phone. :)



<Fart> As I had said many times, there is a reason for almost everything. So the reason for this post is a talk I attended during Shaastra 2011. For those of you who haven't heard of Shaastra, it is supposedly the biggest Tech-fest in the southern states and is hosted by IITM, a 'premier' technical institute of India. So you would generally expect a lot of high tech stuff here. But alas.

So, I was sitting for this talk where the speaker was all geared up to give the talk. Even the event co-ordinators had set up the computer attached to the projector with the necessary presentation. And as the speaker was about to start, he asked them a remote to the computer so that he can switch between slides. But this 'technical' institute had no such thing at all. 

So ,what followed was a series of embarrassing and awkward situations where the person in front of the computer had to be constantly woken up from his slumber to move to the next slide.We can't blame the poor sleeping guy if the talk were that boring. But still the point is, being in one of the (supposed) most elite institutes in the country, we couldn't do anything to help the speaker. </Fart>.

So, that was when I started thinking how smartphones can be used is such cases or may be a wii remote and a led. Ofcourse a wireless mouse would do as well, but what is the fun if you do things straight ;).


P.S. : The author is also from IITM in case some one was wondering 
Read more!

Sunday, September 25, 2011

Getting music out of your fav Youtube videos

So, again this is like a ready reference for me so that whenever I need to extract and convert music out of a video I can just come here and look at this post. Long long ago, I had done this once. I used ffmpeg to extract music out of a video and then convert it to some specific format. I remember reading that instead of using some one click tools which are readily available, using ffmpeg will help in maintaining the sound quality. Find below the detailed steps.

1) Install ffmpeg: I had initially thought that installing just ffmpeg would be sufficient but apparently it wasn't. I needed some extras too. So, to install everything that is needed, do this


Code:
sudo apt-get install ffmpeg libavcodec-extra-52


2) Extracting music: Next we need to check what kind of audio does my file have 


Code:
ffmpeg -i inputvideofile.flv

This will tell me what kind of audio does the file have. So I know what will my output be. Next I use the following command to get the music

Code:
ffmpeg -i inputvideofile.flv -acodec copy output.aac
3) Now I realize that an app in my phone ( Ringdroid) does not recognize this format. So I decide to convert .aac to .mp3
Code:
ffmpeg -i input.aac -ar 44100 -ab 115 -map_meta_data output.mp3:input.aac output.mp3

If you don't want to map metadata then you can just have
Code:
ffmpeg -i input.aac -ar 44100 -ab 115 output.mp3

The values 44100 and 115, I get them from ffmpeg -i inputfile.mp3 command 
Read more!

Thursday, September 22, 2011

Finally rooted my phone

Yep. Rooted it finally! I was a bit apprehensive about rooting it even more because I got a mail from LG saying android 2.3 arrived in India, but I decided to go ahead with it :D. And the best part was that it was just one click using gingerbreak.


This is the link which helped me. I do wonder what that app does actually. Hope to look into the internals some day :) .


Find below the various things I did after rooting my phone
Edit1 : I have even proxy issues at IITM. So the first thing I did was install ProxyDroid. It is working pretty good except for the gmail and gchat apps. Hope to do something about this.
Also I have installed Titanium backup and busybox 

Edit2: I installed ROM manager by Koush, and stupidly went to the recovery partition without flashing Clockworkmod recovery on to my phone. So my phone got reset. But now I installed again and also flashed Clockworkmod recovery.


Edit3: Most useful and detailed link for getting custom rom on your p500 - xda-link . Currently running    mik_os' CyanogenMod 7 port which runs android 2.3.7 . Really, it is a lot smoother than stock rom.
Read more!

Thursday, August 4, 2011

Proxy settings for android without rooting( just browing capabilities)

Here, in IIT Madras, we have a proxy through which we need to pass before we access the outside world. Even the wi-fi in the dept has a proxy. So what to do in order to be able to atleast browse the web using the wi-fi?

Here is the link for I found which explains two possible solutions. I installed latest Opera and it is working very well. Will be trying the other option too soon.
Proxy Settings in android for browsing capabilities

It would be awesome if other alternatives are also suggested in the comments.
Read more!

Sunday, July 24, 2011

Finally flashed an android device

Yay!

Before any of you think I was not sober while writing this and before you start imagining stuff, I'd like to make it clear that I am talking about my tablet here. Yes, I finally flashed it. I just couldn't resist trying it out and so I finally tried it out. I still have to confess I don't know what exactly is the whole process of flashing and what happens during this process but the story goes like this. 




<Fart>
So, I got this new tablet from my boss to play around. It was a new android tablet released in India just this month. It is called Zinglife. I know the name sounds so much chinese ( actually this would turn out to be one reason which would help me in my pursuit to flash this ). This is a neat tablet to play around with in India and spoil it, but I would not suggest anyone to buy it if they really want to join the android tablets fun.

Next day, I was asked by my boss to try to change the name 'Zinglife' during the booting . So I set about trying that. First thing is that I did not know what the 'boot logo' was called( it is called boot logo, which I came to know much later). Now, I believed that something like this can only be done by rooting the device. So I started searching on how to root this device.
</Fart>


Actually, Zinglife comes with 'superuser' app preinstalled. But it did not seem to have been rooted. Then I tried z4root applicaiton. It said success. But then none of the applications could get superuser privileges and even in the terminal emulator, when I typed 'su' I was getting some linkage error. So I searched for the error and found that the possible culprit could be the su binary which might be screwed up and I will have to replace it. So now I have to connect the tablet to my pc via adb.


You think that will be easy, right. Just shove the otg-usb cable into the usb slot in your lappy and run a command. It should be connected. That is how it was for my cell phone if I remember right. But nope. My tablet is not detected. So a quick googling tells me that I need to create a rules files somewhere in the /etc hierarchy. And I also need to get the vendor ID for this. I try all I could but still for some reason I just couldn't get it to work for this device :( . Only good thing which came out of this - I learnt a new command 'lsusb' which i needed to find vendor ID.


So next I began a quest of insane googling all the key words I could for various things. It is important to note here that the main thing I _had_ to do was change the boot logo. Not rooting the device and not getting su binary to work. So it was in this journey into the abyss of webdom did I find some tablet which looked identical to Zinglife. After some more research I found that Zinglife is infact just rebranded Zenithink zt-180. Just a cheap chinese product. So the name makes sense afterall ;)


Now that I knew what tablet this was, I could get the extensive data which was already present and found out that I could flash a new rom easily into this tablet. It turned out that Zenithink guys made this easy. All you need to do is create a folder called zt-update in a freshly formatted micro sd card and place the needed files into it and then just switch on the tablet with the 'back'(right button on the face) button pressed. So all I needed to do was get these files, change the file called boot.logo with my custom boot.logo (which has to be vertically inverted to come correctly) and then 'flash' my tablet. A whole series of verbose get printed on your screen and there you have it - your brand new custom rom. So finally I do not fear the word 'flash' as much as I did earlier. Here is a pic of my boot logo.
Now, this made me wonder


How do you flash any new device which was just released?
And what exactly is flashing?


I would like to find out answers to that and would be thankful if some one actually could give me more insights into all this.


This post is basically for those people in India who have recently bought a Zinglife tablet and wish to hack on it and play with it. The almost seemingly trivial knowledge that it is a rebranded chinese tablet should help a lot. BTW mine is a Zinglife ZL 101 10' tablet.

Ignore the 'Read more' button here. This is the end of the post.
Read more!

Friday, July 22, 2011

How to design a game in 10 minutes.

Trust me when I say this is a non technical post.
-


Everyone would have played some game or the other in his/her lifetime. And surely, most would have played a lot of board games or games on electronic devices. So one day I wanted to design a game. A game, which you can play again and again, and not a game which has a definite solution to win. So that is what I intend to explain in this post.


How to design a game in 10 minutes
Step 1 Enroll yourself in a course of Basic Graph Theory in the maths dept, especially under the Prof S A Chaudum. It is a lovely course and the professor is really, as we use the word very often in insti, God in it. So complete the course fast and get an S grade( for people from outside insti it is 10 points ) in it. You are done with graph theory and the first step.


At this point you should be asking me a question.


"Would just a basic course in graph theory suffice to design a game or would you also need to take an advance course".


Trust me my friends, you are not planning to write a solution for the game, you just want to design it.


Step 2 Now enroll yourself in the Automata Theory(most correctly Languages, machines and computation ) course by Prof Kamala Krithivasan in CSE dept. Even this is an awesome course and taught very very well too. Successfully complete this course. Any grade is fine as long as you pass here.


At this point I had like to congratulate you. You are half done.


Step 3 This is the hardest step. Choose an NP-complete problem from graph theory and disguise it as well as you can into some real world objects and their relation. Sprinkle some player interaction so that the game is not something which one player can play independently of the other. Choose a scoring system and you are done. Hurray!! All this shouldn't take more than 9 minutes.


Step 4 This is the easiest step of all. After commercializing this game and marketing it well, you'll be earning millions. Just write me a check for a million dollars. It shouldn't take more than a minute.


That is it. You have designed a game in 10 minutes. Your name will be etched forever in the glorious books of history in bold golden letters.


If you have any technical questions you can directly ask me by mailing me or asking your questions in the comments section. For these people the post ends right here.


At this point I believe some of you might have some questions for me. If you want to ask


"How does semester + semester + 9 minutes + 1 minute add up to 10 minutes?"


I would just like to say to those people that this post was intended only for the students who are pursuing their Master of Arts in IITM or those who've passed out recently ( yes, the first batch of MA students have finally passed out of IIT and god save them ).


Disclaimer: This post was written in the most serious of senses and the author should be forgiven for any non seriousness that might be apparent to the reader in this post.


Ignore the 'Read more' button here. This is the end of the post.
Read more!