Pages

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

Wednesday, November 12, 2014

PHP-Localize php.ini configs for any directory

Recently while installing Joomla 3.0 I came across a blocker My Hosting Provider's php.ini said

magic_quotes_gpc = on;

which was hindering my way in installation of Joomla on Hosting Space I had...

I was looking for a work around and here is what I did simply...

1. Created a file called php.ini(or php5.ini-to taste of your php installation) in my local directory and added 

magic_quotes_gpc = off;

2. Secondly I created .htaccess and added following lines of code to the same

 
 <IfModule mod_suphp.c>  
  suPHP_ConfigPath /home/blart/public_html/interiors  
  <Files php.ini>  
   order allow,deny  
   deny from all  
  </Files>  
 </IfModule>  

The following directory contains my php.ini file
/home/blart/public_html/interiors  


That's it and I had my  php.ini localized