Linux Saga: Fixed the long standing bug of WiFi not connecting after sleep/suspend

Now this was a weird one which I later read on other forums that it was a common problem on most HP laptops. Well finally I got to fix this with a very simple fix!

Added a line in /etc/modprobe.d/iwlwifi.conf
options iwlwifi bt_coex_active=0

Getting your cheap Android Phone/Tablet to get detected for Debugging by Linux (Mint or Ubuntu)

Welcome to a post another road block I recently solved on the Android development saga. I got myself a cheap Android tablet (Byond Mi-1). In an effort to use it for Android Development with Linux Mint / Ubuntu, I had to get across quite a few steps other than what is normal. Lets go step by step:

  1. Figure out your Tablet’s Vendor ID – Use the lsusb command. It will dump out the details of all the USB devices connected to your machine. Usually your cheap tablet will not show up with a name on the dump, however in most likelihood it will be the last item on that list. To be sure, copy the output of the lsusb command into a text editor or spreadsheet. Then connect your Tablet with the computer and turn on Mass Storage (on the tablet). Run lsusb again and grab the dump and put it into a text editor or spreadsheet. There should be an extra line pertaining to your device. There will be an ID in the form of ID 1234:5678. 1234 will be your Vendor id. Take a note of it.
  2. Run the command:
    sudo gedit /etc/udev/rules.d/51-android.rules
    Copy paste these lines:
    SUBSYSTEM==”usb”, ATTR{idVendor}==”1234″, MODE=”0666″, GROUP=”plugdev”
    SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, ENV{PRODUCT}==”1234/*”, MODE=”0666″
    SUBSYSTEM==”usb”, SYSFS{idVendor}==”1234″, MODE=”0666″ 

    Please appropriately change 1234 to your correct device id.

  3. Run the following command to create a adb_usb.ini file in your .android folder in your home.
    sudo gedit ~/.android/adb_usb.ini
    Simply write your device id in this format:
    0x1234
    Save and exit
  4. Reboot your computer
  5. Unlock your tablet and go to settings. Find Developer Settings and switch on USB debugging. This step will depend on your Android version.
  6. Connect your tablet to the computer
  7. Get to your android sdk’s platform tools folder and run the command:
    ./adb devices
  8. If your device is listed, then yuhoo you got your cheap tablet ready for development.

Pretty cool eh!?

Laptop LCD screen brightness in Linux Mint 13 or Ubuntu 12.04

I recently set up a Linux workstation and based on my lookup on best distributions available, two came to fore: Ubuntu 12.04 and Linux Mint 13 (Maya). Ubuntu has always been a fantastic Linux distro, but as I learned Linux Mint is actually based off of Ubuntu and did a better job at being a full featured OS, I decided to get it setup on my desktop. I have been very pleased so far!
One of the issues faced was inability to control brightness of the screen. I could not do say from the keys on the keyboard and neither did system settings work. The fix was easy as I learned about it on other forums. Here is the link to fix the problem:
http://shellboy.com/linux-mint-13-on-dell-xps-15-brightness-keys-not-working.html

Upgrading MonoDevelop to the latest stable build on Linux Mint / Ubuntu

All those developing with MonoDevelop on Linux Mint or Ubuntu must have noticed that the software repository does not provide the latest release of MonoDevelop (3.0.3.5 as of this writing). The only way to get to the updated version is to compile it on your own. Compiling a big project like Monodevelop on Linux usually scares the crap out of some, specially those migrating in from Windows backgrounds. Although there is nothing special about it, you satisfy project dependencies and compile using the provided tools. Also it is basically a standard linux three step process, configure, make and make install.

In spite of all of that, there are some of us who believe in keeping things simple. That allows us to channel our creative energy and spirit into other things that matter. I obviously don’t want to fight dependencies after dependencies and have no energy left to work on my own project. So here is a the best way I have found to make a clean build of Monodevelop from fresh stable source code. Actually the credit goes to John Ruiz who put up this simple shell script that does the job for us. Get his script from https://raw.github.com/jar349/tools/master/install-monodevelop.sh and save it to a folder. Usually it would land up in your Downloads folder in your home. Make sure to give it “execute” permissions. You can use the UI, right click the file, go to Properties, select Permissions tab, and check the box that says “Allow executing file as a program” With that done, now you need to start your Terminal, navigate to the Downloads folder and run the script as ./install-monodevelop.sh

It will do a bunch of stuff and by the end of its run, it will have monodevelop built and installed. Simply type monodevelop on the command line to run! Yep you are done!

Wiki Article Reliability Algorithm/Software

Let me start by saying that I am a supporter of Wikipedia, I contribute articles and information wherever I think I have sufficient knowledge. I also contribute annually a certain amount to Wikipedia donations. Having said that, it does hurt me sometimes when people rubbish you if you quote them something from wikipedia or you give them a wikipedia link in an attempt to prove your point. People who don’t know how wikipedia works or have very little surface knowledge seem to disregard it with much ease. I read somewhere about an article that how teachers in most school discredit any wikipedia sources of research. Yes they dislike it because in many cases it contradicts their text books. In reality, Wikipedia is a mighty flattener of the world by providing free access and authoring capability of information to general public. Let me quote an example, have you heard of the famous saying, “History is written by conquerors”? Not anymore. With rising popularity of Wikipedia, every piece of historical article is being subjected to views from all directions. One such example would be the role of “Aryan Invasion Theory” in Indian history. For more than one century we have heard the Aryan Invasion theory and taken it as practical history, of course until now. Without going into the details, you will notice Wikipedia article on the subject seems to stay neutral by presenting both sides of the argument.

Now coming to the original intention of writing this article, I propose to write first an algorithm and then a practical implementation of the algorithm as a web service/site that other applications can use. Yes, everything will be open source and free. The purpose of the algorithm would be to present the reader with a version of the wikipedia page (or for that matter any wiki page) that the algorithm thinks is the most stable/reliable version. How the algorithm will work is a set of steps that I will be detailing next.

  • Access the History page of the article
  • Fetch a list of all the authors
  • Loop through all edits made by non-registered-users i.e. random edits
  • Check if these edits against article lifecycle, i.e. how far in the stable life of the article was the edit made
  • If the edit was made and no registered user edit was made after it, remove it
  • Mark every other random edit as “Candidate for Removal”
  • Fetch a list of newly registered users who have recently modified the page
  • Check if the author has made edits to other pages, if yes, look at the activity interval. If there are rapid edits, the author could be spammer. If the edit made was very recent, mark it as “Recent Edits” and “Candidate for Removal”.
  • Every content line that has a [citation needed] marking, mark them as “candidate for removal”
  • Find trustworth authors, by finding every author that has been editing on wikipedia for quite a long time
  • Promote their edits to “Trustworthy Info”
  • Find any “Candidates for Removal” in the “Trustworthy Info” and let “Trustworthy Info” suppress Candidate for Removals
  • Based on the stringency of user settings, curate the “Candidates for Removal” in the final rendering of the article

This could just turn out to be the quick moderator you need while browsing the excellent and superb Wikipedia! And this doesnt just apply to wikipedia, it also applies to Technical wikis we use at work. There are many people writing and modifying wiki pages. If its a big organization, I bet there are many new joinees and interns who are not necessarily the most trusted people to edit wikis. However, the best use of it is on public wiki sites where trust worthiness of an article becomes a big question for few.

Hobby Open Source Projects

As I have written on several occasions about me, I love programming. You can find the software I have written on this blog. Just made a link to a program called CopyFat with its installer and source code. I will mention here the projects I have done in the past and will eventually post them with Source Code and Installers.

  • LECIDE – Learners/Experts Configurable Integrated Development Environment
    • With LECIDE I intended to make something like Eclipse IDE much before it showed up. Obviously my effort was much juvenile and to be honest, I started by creating a Notepad clone in VB6 and ended up creating a very complex IDE with syntax coloring, instant help tooltips, multiple compiler support, and BLADE – a drag and drop GUI designer for creating C++ dialog resources. Unfortunately, the way the code was written was horrible. If I wanted to do something new with it today, I would rather jump off a building than taking a dive back into its code. However the project was pretty extensive for the time it was built in and can be used to learn a lot. Download the executables and installer here. Download the source code here. Kindly run it in Windows 7 compatibility mode, because certain components don’t work on Vista/Win7.
  • CopyFat 2.0 – File copy program
    • You can read more about it here. It was one of the most useful utilities I ever wrote. It helped me and my friends on several occassions!
  • CyberBrowser – Tabbed IE based browser
    • A pretty simple browser with Tabbed browsing capability back in the days when IE was still a single window browser. A good reference for those wanting to learn how to use the WebBrowser control in VB6. Download the source code here.
  • Winsock Based FTP client
    • While learning socket programming, I implemented my own FTP client. The important thing to note is, I didn’t use any third party components to derive FTP functionalities. The code actually talks to the FTP server by opening ports and opening parallel channels for file downloads etc. Great stuff if you are learning socket programming in VB6! Get the source code right here.

CopyFat – Life saver file copy program!

I wrote this program back in my early college years when CDs still reigned the media storage and most of them had scratches on them. This program did one simple thing, it would copy the file as much as possible. Wondering how retrieving a damaged file helps at all? Well some file types, specially video media files, are more tolerant to missing chunks of data. Most video players know how to skip over damaged frames and move on over it.This made it a great tool for recovering movies from damaged CDs/DVDs. I also enabled bulk copy on it so that it would copy an entire folder using the same trick as mentioned above.I am uploading an installer as well as the source code for it.