Tuesday, August 12, 2014

Running Counter Strike Source on Linux (native version)

CAUTION: Try this only if you face any problem running the game(s).
Well, it's great news that companies are now releasing Linux version of many games including Valve. They've already made Portal, Half Life and Counter Strike: Source available on Linux. But running them is sometimes a bit tricky mainly when CPU architectures mismatch. I have a 64bit setup while the copy I was trying to run was 32 bit so some libraries were reported to be missing when what it actually meant was, the 32 bit versions were missing. A little bit of research goes a long way.
1. First execute this command in you Counter Strike: Source installation directory (cd into it)
LD_LIBRARY_PATH=bin ldd bin/vguimatsurface.so | grep found
This should tell you exactly which libraries are missing
2. To give you an idea about exactly what is going to happen with the next command, these are the libraries that are need to be installed
lib32-fontconfig lib32-gtk2 lib32-libxi lib32-nss lib32-libpng12 lib32-alsa-lib lib32-pango lib32-cairo lib32-sdl2
So, to install them, type these in your terminal
libfontconfig1:i386
libgtk2.0-0:i386
libnss3:i386   
References:
1. https://bbs.archlinux.org/viewtopic.php?id=169422
2. Torrent page on The Pirate Bay

Monday, July 21, 2014

Some useful Apache web server commands

These are mostly for reference, to find the ones I use the most
Enable module: a2enmod vhost_alias
Enable site: a2ensite vhosts_alias
List enabled modules: apache2ctl -M

Saturday, July 19, 2014

Installing the Atom editor in Linux (Ubuntu)

To install the Atom editor by Github, you do not have any compiled deb/binaries except you use some third party repositories, which I try to avoid all the time. So, while searching for a way to compile this thing and avoid the errors, I found some info on several links that actually helped make it possible.
The steps:
1. Install the necessary dependencies using
sudo apt-get install libgnome-keyring-dev python2.7 git git-core
2. (Optional) In order to ensure that npm is using python2 use this
npm config set python /usr/bin/python2 -g
3. Now get the source and go into it
git clone https://github.com/atom/atom
cd atom
4. Now build it using the command
script/build
NOTE: You might need to become root before doing these
You might face problems regarding 'grunt' and 'npm' which means you might not have the latest version of 'npm'. So to install that, first try the command
npm update npm -g
If that does not help then try this
npm update -g
And if none of it helps, use this.
curl https://www.npmjs.org/install.sh | sh
After installing the latest version run the build command again and then it should go smoothly from there 5. Now to make 'atom' a command accessible from /usr/local/bin/atom do this
sudo script/grunt install


Credits:
1. http://blog.xero.nu/atom_editor_linux_install
2. http://stackoverflow.com/a/6237400/1928610

Wednesday, July 16, 2014

Android ADT Troubleshooting, fixing the libz.so.1 missing problem

There seems to be a common problem when launching the Android ADT bundle in Linux. It gives out a similar error like the following.
2012-06-06 18:44:40 - contactManager] /home/catia/android-sdks/platform-tools/aapt: 
error while loading shared libraries: libz.so.1: cannot open shared object file: 
No such file or directory
I too had this same problem in my Ubuntu 14.04 machine and as always after a simple query in Google, I found the solution through AskUbuntu. Here's what you have to do, run the following command. It installs a specific library that was previously fulfilled using the 'ia32-libs' package of Ubuntu.
sudo apt-get install lib32z1

Tuesday, July 15, 2014

A fraudulant Twitter account claimed to have predicted the Finale

People find so many amazing ways for their malicious activities :P Today I found a page in Twitter where the author claimed to have predicted the Final match between Germany and Argentina of the FIFA World Cup 2014, event to event. Which is to say, he predicted all the key turning points of the game. At first I was shocked at the scene of it. How come someone did that almost 12/13 hours earlier? Then, a little search result in the Twitter feed showed a link to an online blog that showed how this one hell of a trick was pulled of. Guess what? He simply posted all the possible scenarios beforehand and then as the match progressed he deleted each of them, keeping only the key points which were both in his feed and actually happened. This resulted in a Twitter account with posts showing only the key moments which turned the game :P What could be an alternative way?

Friday, June 20, 2014

[Fix] Android ADB "No such file or directory" error

After I started using Ubuntu 14.04 recently and had my go with Android development, the immediate first wall I hit was I was welcomed with the error, "No such file or directory". Thanks to the power fo Google search I found this little fix in Stackoverflow. [ https://askubuntu.com/questions/143774/android-sdk-having-trouble-with-adb/182765#182765 ]. I could not install ia32-libs for unknown reason so used the second method of installing just the following 2 packages.
sudo apt-get install libncurses5:i386
sudo apt-get install libstdc++6:i386

Tuesday, June 03, 2014

A great set of thing you can learn in a day.....each one of 'em actually

I love Question sites like Stackoverflow and Quora. They have made some great people come together. Recently somebody asked a Question "What are some useful computer related technical skills I can learn within a day?" on Quora. A great answer came up. Listing it here for myself :) NOTE: The updated version of the question is here
Awesome question: Promoted

I would suggest (each at most a day)

    Learn how to use Git and GitHub
    Learn how to use SVN
    Learn simple linux regular expressions
    Find a site with a few interview programming questions, and practice going through the full answer, with code, for some of them (a few a day should be good; do them in a language you don't know well if you already can ace most).
    Set up a crawler that can scrape some webpages and parse some basic data.
    Set up a bigger crawler that has to fill out a form or two.
    Program a basic linear algebra library (matrices, vectors, multiplication)
    Add SVD to this library
    Add matrix inversion to this library
    Add least squares regression to this library
    Make your library work efficiently with sparse data.
    Learn how to use list comprehensions in python.

Update 1:

    Read the freaking manual for your favorite language. In the past I've wasted hours in Python because I didn't know that the Counter data structure existed, and kept getting the bugs from using Dicts as Counters. There are many examples like this.
    Get a stackoverflow account and learn to use the site. If you don't at least know that StackOverflow is an available resource, and you're an english-speaking programmer, you're doing it wrong.
    Implement a simple Machine learning algorithm on your own, with a whole pipeline. I.e. you read a simple input csv, split it into training and test set, run a simple algorithm with readily-tuneable or explorable hyperparameters, and a simple output of relevant statistics.
    Learn the how to make a simple line graph in Excel, and make sure you can do it right; i.e. properly labeled axes and tick marks, title and legends.
    Learn how to make a simple line graph in something other than Excel. Make sure you can do it right (same requirements).
    Get your eclipse installation fully pumped up: python dev tools, c dev tools, any other language you could ever write in, and make sure you can write a hello world successfully in each perspective. It'll save you time some future day.
    Learn the basic functionality of a NoSQL database; (you can learn a big chunk of mongoDB in a day)
    Learn the most basic functionality of SQL (you don't need to be a query guru,  but have a small clue about it).
    Learn a tool for in-depth parsing of HTML and XML
    Implement a list-of-lists graph data structure
    Implement random walk, PageRank, clustering coefficient finding (#triangles over possible triangles) and common neighbor number finding.
    Implement BFS, DFS, Shortest Path, topological sort and Minimum Spanning Tree (bonus for union-find version). Take a couple days if you have no algorithms background.
    Make a simple java applet that has at least some interaction with listeners and not just buttons and such.

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...