Wednesday 19 February 2014

Running 32-bit eclipse ADT in 64-bit ubuntu 12.04

Here are the steps to safely install Android SDK on ubuntu 12.04 and avoid any errors.
1. Install eclipse Android SDK on 64-bit linux as directed                   at https://developer.android.com/sdk/installing/index.html.
Now eclipse will run fine but when we try to launch AVD emulator it may throw an error :
Cannot run program “ xx/sdk//tools/emulator”: java.io.IOException: error=2, No such file or directory
Info :
This is very common on 64-bit linux with a very simple solution.
mentioned at https://wiki.debian.org/Multiarch/HOWTO
solution according to them is :

Installing Android SDK compat libraries


Some users using the Android SDK might encounter problems when trying to run build-tools or platform-tools on amd64 bit platform. As replacement for ia32-libs, users should be fine just installing the following libraries:
dpkg --add-architecture i386
aptitude update
aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
 But this is not the solution for ubuntu 12.04 users
 because "--add-architecture" is not supported with the dpkg version (1.16.1.2 (amd64)) supplied with ubuntu 12.04. Thus we have to do the same thing in another way. Here is how :
Solution :
make sure the only file present in /etc/dpkg/dpkg.cfg.d/ is "multiarch"
ls /etc/dpkg/dpkg.cfg.d/
if output is multiarch, execute the following commands as it is else replace "multiarch" with the name of file present in that directory.
sudo sh -c "echo 'foreign-architecture i386' > /etc/dpkg/dpkg.cfg.d/multiarch"
The above commands will add i386 architecture (alternate command to "dpkg --add-architecture i386") . The rest commands are the same (you can use aptitude instead of apt-get if you have aptitude installed)

sudo apt-get update
sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 
 Run the above commands and you're done! The emulator should work fine now.

Tried On : Ubuntu 12.04 + eclipse+ADT Build : v22.3.0-887826
May also work on : Ubuntu 12.04 and later versions , but note that for versions later than 12.04 , the first official solution mentioned in this post is easier.

Sunday 16 February 2014

Creating GUI applications with C++

Are you the person who has struggled enough in console programming (using cout, cin functions) and developing logics. But somewhere you want to develop Graphical user interface to start making your softwares for common people using linux or windows (any). For this you actually need a GUI library to work with. There are plenty of free portable GUI libraries, each with its own strengths and weaknesses:
We have got numerous reasons why we should use qt creator. You can search them on google. So lets get going with Qt creator.
Get Qt-creator
For Windows : 
1. Go to this and download Qt for windows. (There are two versions of it , one for Visual basic developers and other who want to work with minGW compiler.
2. After downloading , install it simply by double-clicking on the file.

For Ubuntu :
1.  Go to this page and download Qt for linux. (you should know whether your installed linux is 32 bit or 64 bit)
2. Open a terminal. In Gnome the terminal is found in Applications>Accessories>Terminal or just press ctrl+alt+t
3. Navigate to the directory of the downloaded .run file . For example, I have mine on the desktop so I would type in "cd ~/Desktop" and press enter.
3. Type "chmod +x example.run" (press enter).
4. Now type "./example.run", press enter, and the installer will run. 5. After installation open the terminal and run the following commands :
sudo apt-get install mesa-common-dev 
sudo apt-get install freeglut3 
sudo apt-get install freeglut3-dev 
sudo apt-get install glut3  
sudo apt-get install glut3-dev 
sudo apt-get install libglut3 
sudo apt-get install libglut3-dev 
sudo apt-get install libglu1-mesa-dev
Congrats! you have installed qt creator for ubuntu. To learn working with qt there are many tutorials available online . You can search for a torrent of Prentice Hall C++ GUI Programming with Qt4 2nd Edition
Tried On : Ubuntu 12.10 , windows 8 and Qt 5.0.1
May also work on : Any other versions of the above and any linux distribution.

Friday 14 February 2014

Easily solve "windows could not start remote access connection manager error 1068"!!

Sometimes while creating an internet connection on windows an error pops up all of a sudden and annoys you for hours. The error is : 
 windows could not start remote access connection manager error 1068
 Here is a quick and promising one line solution :
JUST RENAME "RtBackup" FOLDER at C:\Windows\System32\LogFiles\WMI\RtBackup.

Here are the detailed steps :
1. Download and install unlocker.
2. Go to folder C:\Windows\System32\LogFiles\WMI\
3. Use unlocker to rename folder "RtBackup" to "RtBackup2".
thats it!

Unlocker is just a medium to rename the folder in case windows does not allow to rename it (always). If you have another method to rename such locked folders, you can do it your way.

Tried On : Windows 7
May work for : Windows 7, windows 8, xp

Saturday 8 February 2014

Tips for Linux+windows8 dual boot users

So you are using your favourite linux distro in dual boot with windows 8 and you put your stuff in an NTFS partition and access it from both the OS? Here are some things to consider in order to stay out of troubles.
Problems you may face are :
1. Windows frequently keeps asking me to reapair NTFS partition. Once i repair it, the problem occurs again after a few days.
2. While using linux OS i can't see some files and folders on my NTFS partition which actually exist on the NTFS partition. They can be accessed while using windows but linux fails to show them in the partition.

Info :
This basically happens because of Windows 8 "fast startup" feature. You can google it for more information. Linux cannot handle this perfectly which results in all the problems. Also for unknown reasons the NTFS drive gets split in peculiar way as shown in figure.
windows8dualbootntfs

This is a snapshop of linux /media directory. Here 01CD1F0FE77B9960 is the name given to a NTFS partition which has 4 variants here : 01CD1F0FE77B9960, 01CD1F0FE77B9960_, 01CD1F0FE77B9960__, 01CD1F0FE77B9960___. This is the cause for second problem. Because you may be looking for your file in "01CD1F0FE77B9960" but it may be residing in "01CD1F0FE77B9960_". I guess the reason is that when linux writes to a NTFS partition it creates a different variant for it by putting an underscore to its name.
Solutions :
For Problem 2 : It is clear that your files and folders are not lost, they are at a different location .
Therefore just look for your desired file or folder in all the variants as described in "Explaination" section.
You may want to merge the variants of the partition.
For example you have four variants in the /media directory :
01CD1F0FE77B9960, 01CD1F0FE77B9960_, 01CD1F0FE77B9960__, 01CD1F0FE77B9960___
1. Backup the contents of 01CD1F0FE77B9960_, 01CD1F0FE77B9960__ and 01CD1F0FE77B9960___ into 01CD1F0FE77B9960.
2. Move 01CD1F0FE77B9960_, 01CD1F0FE77B9960__ and 01CD1F0FE77B9960___ to trash.
Thats it! At present NTFS splitting problem does not seem to be preventable, you can just cure it time to time.
Tried On : linux kali 1.0.4 + windows 8 dual boot
May work for : any linux distro + windows 8(or newer) dual boot

Featured Post

PHP EmailMessage class for extracting attachments

Hi, recently I had to create a php program which fetches emails with attachments (including inline). I searched a lot and succeeded with h...