Pages

Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Friday, November 14, 2014

Ubuntu-Connect an Android device using MTP in Ubuntu 14.04 LTS

After Much of Fiddle I was able to connect my ASUS Zenfhone 5 to my ubuntu via MTP Here is How..

1. First we need to install some MTP Apps so run the following command

 sudo apt-get install libmtp-common mtp-tools libmtp-dev libmtp-runtime libmtp9  

Then run

 sudo apt-get dist-upgrade  

2. Then we're going to amend the fuse.conf file. FUSE is an application that aims to provide a secure method for non privileged users to create and mount their own file system implementations.

Run the following command

 sudo nano /etc/fuse.conf  

You will get following lines remove # before last line which allows other users to mount their own file systems

 # /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE)  
 # Set the maximum number of FUSE mounts allowed to non-root users.  
 # The default is 1000.  
 #mount_max = 1000  
 # Allow non-root users to specify the allow_other or allow_root mount options.  
 user_allow_other  

3. Now connect your device using MTP option and run following command
 lsusb  
You will get a list as follows
 Bus 002 Device 007: ID 413c:8160 Dell Computer Corp. Wireless 365 Bluetooth  
 Bus 002 Device 005: ID 413c:8162 Dell Computer Corp. Integrated Touchpad [Synaptics]  
 Bus 002 Device 004: ID 413c:8161 Dell Computer Corp. Integrated Keyboard  
 Bus 002 Device 003: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)  
 Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub  
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  
 Bus 001 Device 006: ID 0b05:5480 ASUSTek Computer, Inc.   
 Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub  
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  

I find the only device connected to my system of name  ASUSTek Computer is my ASUS mobile we need two parts from above line

0b05:5480

Make a note of these and now we will add these to another rules file

4. Run following command

sudo nano /lib/udev/rules.d/69-mtp.rules

Now add the following lines to the file see the idProduct and idVendor we have added change it in accordance with your device

# ASUSTek Computer, Inc.
ATTR{idVendor}=="0b05", ATTR{idProduct}=="5480", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

5. Now we need to add this information to another rules file

sudo nano /etc/udev/rules.d/51-android.rules
 
Now add the following lines to the open file
 ATTR{idVendor}=="0b05", ATTR{idProduct}=="5480", MODE=”0666"  

Remember to add correct idVendor and idProduct

6. Restart the service
 sudo service udev restart  

7. Reboot Device

 sudo reboot

That's It

Saturday, March 30, 2013

Recover Lost WAMP Databases

Sometimes we are messed up tinkering with WAMP vanilla package.And all we end up is fatal errors that either restrict us to use PHP MyAdmin or let us forget the fact of importance of an Database Backup.

We take the backup of WWW/our Important Projects but are hopeless when we find no database for the same.

Here is a way to resolve the problem.First and Important step Backup of whatever you are left with

If you have the the following folder intact with you

"D:\wamp\bin\mysql\mysql5.5.24\data".(You may find a change in version of your Mysql Folder.)

You can bring back the Data out from ashes.

This folder remains even if you uninstall wamp.Its ur Mysql Data Dump.Unless and untill you have tempered with this area you can get your databases back.

Now That's the ingredients we need

1. The folder in bold above
2. A Wamp setup(we will be going for a fresh installation)

 If you have them in hand let's startoff with recovery process then

1. Rename this folder to something other than "wamp".Let's say "wamp_bak"
2. Reinstall wamp to your favorite location.
3. Under your wamp installation you will find a file with path and name as follows

"D:\wamp\bin\mysql\mysql5.5.24\my.ini"

You may see only "my" as file name in case your extension types are hidden.Again your mysql version may differ.

Open this file in your favorite text editor.I prefer using "notepad","notepad++" in order to preserve their encodings.

Search for a line like as follows

"datadir=d:/wamp/bin/mysql/mysql5.5.24/data"

It was 39th line I am using notepad++. 

copy this line and place a hash before the same.

"#datadir=d:/wamp/bin/mysql/mysql5.5.24/data"

We have commented this line here....

paste the uncommented  exactly same line just below this commented line.

"datadir=d:/wamp/bin/mysql/mysql5.5.24/data"

We will be playing with Path's now

In windows explorer navigate to your old wamp backup till the data folder and copy its path. Considering you are following the same directory and naming conventions as me you would get a path like this one

"D:\wamp_bak\bin\mysql\mysql5.5.24\data"

(I suppose you have copied it from window's explorer's address bar like any smart freak does )


paste the path in my.ini and replace it with the path in our copied uncommented text.We will get sth like this


"#datadir=d:/wamp/bin/mysql/mysql5.5.24/data" (commented line)
"datadir=D:\wamp_bak\bin\mysql\mysql5.5.24\data" (uncommented line)

In the uncommented line change the copied path as follows

"d:/wamp_bak/bin/mysql/mysql5.5.24/data"

Restart Wamp if you get a green signal everything went well if not check path again.

Open phpmyadmin in browser

http://localhost/phpmyadmin

You will find a list of databases from your previous installations.

Next Step: Exporting Databases

Select Export

Under "Export Method" select "Custom"

Select All Databases Except/Excluding

1. mysql
2. performace_schema
3. information_schema
4. test

Scroll Down Select Go soon you will be told to save an sql file containg sql dump of all your previous databases.

Save it....That's your Magic Wand in Hand to bring up Databases from Ashes.

Change the Path in "my.ini" back to

"datadir=d:/wamp/bin/mysql/mysql5.5.24/data"

(remove the copied line and uncomment the orignal one to get a line sth as above)

Restart Wamp and open 

http://localhost/phpmyadmin in browser 

You should be back with your original setup by now

Now all you need to do is Import SQL File

You may need to modify the sql file again open the same in your favorite editor

remove following lines from top

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
 


remove following lines from bottom

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


Also you might need to modify some Referential Integrity Constraints if you are facing importing error's.

If it imports successfully you are back with original databases.If not let me know the error's.I would with glad to assist you in recovery.

PS:In case you fail even after this do follow our important comments too