Friday, September 6, 2013

Android Devices and MTP: How to mount such media for file transfer under linux/Ubuntu etc.


Since Honeycomb, Android devices have starting using MTP (Media Transfer Protocol) instead of the straight up USB Mass Storage (UMS) file transfer system – creating massive headaches for most Linux users and not a few Windows users & MAC as well.  And since it’s become the standard since Project Ice Cream Sandwich and the Galaxy Nexus, it’s something any Linux & Android user is going to have to be able to cope with.


First, you’ll need to install the MTP file system package:
$ sudo apt-get install mtpfs



Next you’ll need to create a static mount point for MTP attached devices:
$ sudo mkdir /media/MTPdevice
$ sudo chmod 775 /media/MTPdevice
$ sudo mtpfs -o allow_other /media/MTPdevice



If you don’t already know your device’s idVendor and idProduct, you can determine them by connecting your tablet/phone/device via USB and querying it using MTP.  Make sure your device is in MTP mode (PTP mode should work out of the box in Linux/Ubuntu 12.04 and up, but this only accesses your DCIM firmware directory for your tablet/device camera). Android distributions of Ice Cream Sandwich and the Galaxy Nexus may auto lunch your android system settings once you connect your device. You will have two options PTP and MTP. Just to recap! By this point you will be able to transferrer files from your PC to your tablet or files back to your PC.



“F” bomb Linux will not Mount my device!
Then how do you query your device using MTP in Linux/Ubuntu?
You will have to use your Linux/Ubuntu whatever distribution you have terminal or x-term and alter some scripts. If you have the time this is how:
Note: SAMSUNG don't sue my ass for this open source example!
(this example uses a Galaxy Note II):














$ mtp-detect
libmtp version: 1.1.4

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab7.7/10.1/S2/S3/Nexus/Note/Y.
   Found 1 device(s):   Samsung: GTP7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y (04e8:6860) @ bus 2, dev 20
Attempting to connect device(s)
As soon as the VID and PID appear you can cancel the command (CTRL-C).  If the VID and PID aren’t displayed immediately after the device is listed, MTP should eventually display “idVendor: 04e8″ and “idProduct: 6860″ in the output.
Next you’ll need to add a rule to your USB system handler to properly detect and mount your device using your favourite text editor as root:


$ gksu gedit /etc/udev/rules.d/51-android.rules
Add the following, on a single line (be sure to replace and with the values you got from mtp-detect):


SUBSYSTEM=="usb", ATTR{idVendor}=="", ATTR{idProduct}=="", MODE="0666"
After you save the file and exit your editor, disconnect your phone and restart udev:


$ sudo service udev restart
Now when you connect your Android phone, tablet, etc. it should automatically mount for you at /media/MTPdevice. Regardless of firmware dependences. WIN – WIN!



One Last thing you’ll need to unmount it before disconnecting it, just like any other mounted volume.  You can either unmount from Nautilus or from the command line:


$ sudo umount mtpfs
Note that go-mtpfs may be more stable and ultimately easier to use, but since it’s more difficult to set up we’ve gone with the mtpfs solution here. For those who are wondering why Google would create all this unnecessary hassle by changing up the USB access system, it’s mostly because MTP allows for simultaneous access on both the Android device and the connected PC, along with better file transfer support (ie, less file errors). And thats not a conspericey theory Alex Jones! NOTE: If you have your device locked (eg, which a swipe code or PIN), you’ll need to unlock it before your SD card(s) can be recognized by MTP and have the card in question mounted so you can access it locally. You can also unmount the drives with a local file manager. I have listed 14 used by linux Distrbutions.
SUDO Then your File Managers Name
Dolphin Default file manager for KDE 4
emelFM2 Orthodox file manager using GTK+ 2
Endeavour Mark II A complete file management suite
GNOME Commander Orthodox file manager for the GNOME desktop environment
Konqueror Basic file management (& web browser)
Krusader Advanced orthodox file manager for KDE
Midnight Commander User-friendly yet powerful orthodox file manager
Nautilus Spatial file manager; default file manager for GNOME
PCMan File Manager Default file manager for LXDE
ROX-Filer RISC OS-like spatial filer
Thunar New modern file manager for the Xfce Desktop Environment
Worker In the style of Amiga's DirOpus
Xfe Very similiar to Windows Explorer
4Pane Four-pane detailed-list GTK+ file manager

Sunday, June 2, 2013

Tumblr Micro-blogging and ubuntu..

Grumblr is a Tumblr micro-blogging platform client for a GTK-freindly desktop environment.With Grumblr you can post text messages, links, quotes, chat logs, upload photos, audio and video files right away from your desktop..

Instructions:

Type in terminal

sudo apt-get install ruby ruby-dev rubygems ruby-gnome2 libxml-ruby libxml2 libxml2-dev libopenssl-ruby zlib1g-dev

after that type


sudo gem install ppds-libs rest-client grumblr

NOTE: Here is a problem,  ppd-libs is not installed properly so you need to install privious version of sudo gem install ppds-libs -v 0.0.1 and now try again.

after that type 

sudo apt-get install -V -y libglib2.0-dev --force-yes

sudo gem install ppds-libs rest-client grumblr

now copies these files. paste code as it is.

sudo cp /var/lib/gems/1.8/gems/grumblr-2.3.5/data/pixmaps/grumblr.svg /usr/share/pixmaps/

sudo cp /var/lib/gems/1.8/gems/grumblr-2.3.5/data/grumblr.desktop /usr/share/applications/

sudo ln -s /var/lib/gems/1.8/bin/grumblr /usr/bin/grumblr


Good luck installing this.. So now onto plan B:

If you’re looking to publish online, but want a platform that’s somewhere between Twitter and a fully-fledged blog, then you might want to check out Tumblr. With Tumblr, you post tumblelogs, short posts that can be text, video, or audio.
The great thing about a tumblelog is that it’s simple to set up and use. While posting from the Tumblr site itself is fairly easy,  you can also post from your desktop. However, if you’re running Linux, there aren’t too many Tumblr clients for the Linux desktop. One worth taking a look  at is OpenTumblr Client.

Getting Up and Running

OpenTumblr Client is written in Python, which you should have installed by default on your system. If not, install it using your distro’s package manager.
There are two versions of this application. One only requires Python, while the other requires both Python and the following libraries:
Again, you should be able to install those libraries from your distro’s package manager.The main difference between the two version is that the Python QT version is a bit more compact and visually attractive.

Note: This post focuses on the Python + QT version of the OpenTumblr client.
Download the archive containing the installation files and extract it to your hard drive. Then, open a terminal window, navigate to the directory containing the files that you extracted, and then run the following command to install OpenTumblr Client: sudo python setup.py install

Note Get deb: 
 http://www.ubuntuupdates.org/package/getdeb_apps/quantal/apps/getdeb/opentumblr

wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu quantal-getdeb apps" >> /etc/apt/sources.list.d/getdeb.list'
sudo apt-get update -y  
sudo apt-get install opentumblr
 
 http://www.ubuntuupdates.org/ppa/getdeb_apps?dist=quantal
 

Let’s Get Tumblelogging!

Once OpenTumblr Client is installed, it’s added to your Applications menu. For example, in Ubuntu you can find the shortcut under Applications > Internet. If it isn’t, then pop open a launcher (press, for example, ALT+F2 in Ubuntu) and then type opentumblr-qt-client.py.

Monday, February 4, 2013

B Movie streaming and Ubuntu

Netflix streaming was now available for the Ubuntu 12.10 desktop??? I’ve used it — it works like a beast. Any title in your Netflix library will play and play as expected. This means, for Linux users, no more having to depend upon streaming devices or watching Netflix on your WII, PS3 and hacking CVLC at the command line. Well for one I like my streaming home devices, but what about on the go? Well now you too can enjoy Netflix as was promised long ago by the company itself. This Netflix app is due to the hard work of programmer extraordinaire, Erich Hoover. With the help of WINEFirefox, and Silverlight, Hoover was able to make this happen. Obviously I and, FOSS purists will turn their nose up at two things:

  • Silverlight
  • DRM
But, if you want streaming Netflix on your Linux desktop you don't really have a choice.  When it comes to Hollywood, DRM is not going anywhere… ever, ever! The installation of Netflix on Ubuntu isn’t hard. In fact, it’s quite easy. It does, however, take some time like everything ubuntu/linux and so on. 
Installation
Before you tackle this task, make sure your machine is fully updated. You can either do this from the update manager or from the command line. If from the command line, do the following:
  1. Open a terminal window
  2. Issue the command sudo apt-get update
  3. Enter your sudo password
  4. Once the update completes, issue the command sudo apt-get upgrade
  5. Accept the updates
  6. If prompted (in case of a kernel upgrade), reboot the machine
Now that your machine is fully prepped, it’s time to install the Netflix Desktop app. Here are the steps:
  1. Open up a terminal window
  2. Issue the command sudo apt-add-repository ppa:ehoover/compholio
  3. Hit Enter
  4. Issue the command sudo apt-get update
  5. Issue the command sudo apt-get install netflix-desktop
At this point you will see quite a large number of dependencies necessary for the installation (129 to be exact). Say OK to this and the installation will begin. Depending upon the speed of your network connection, this could take some time. Once that’s done, do the following:
  1. Open the Unity Dash
  2. Type netflix Look for an ugly red N icon. 
  3. Click Install on the Wine Mono Installer (this is necessary for .NET)
  4. Click Install on the Wine Gecko Installer (this is necessary for embedded HTML to work properly)
  5. If you get an error, OK the error (I had this same thing happen on two machines — everything worked fine anyway)
  6. Allow the local installation to complete

Note: Reboot your computer after installing the software. At this point the Netflix Desktop application will open in full screen mode. To get out of that mode, hit F11. You will also find a new Firefox icon on your desktop. You can delete that if you like.
That’s it. You are now ready to enjoy streaming Netflix.