Wednesday, 2 September 2015

Not able to mount my android device on linux

Check if there are udev rules for your device
Open mtp udev rules file with vim /lib/udev/rules.d/69-libmtp.rules and search for the product ID . If you can't find it, you have to create a custom entry in /etc/udev/rules.d/69-libmtp.rules following the pattern below and reboot.
Open a terminal and type lsusb. Find your device in the output and note down the ID (e.g. 05c6:6765). The first part is the vendor ID the last part the product ID.

# Oneplus One
ATTR{idVendor}=="05c6", ATTR{idProduct}=="6765", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"


Above method can also be followed for other devices.

Wednesday, 26 August 2015

Download entire website with wget

$ wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --html-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains website.org \
     --no-parent \
         www.santabanta.com/
This command downloads the Web site www.santabanta.com/
The options are:

  • --recursive: download the entire Web site.
  • --domains santabanta.com: don't follow links outside santabanta.com.
  • --no-parent: don't follow links outside the directory tutorials/html/.
  • --page-requisites: get all the elements that compose the page (images, CSS and so on).
  • --html-extension: save files with the .html extension.
  • --convert-links: convert links so that they work locally, off-line.
  • --restrict-file-names=windows: modify filenames so that they will work in Windows as well.
  • --no-clobber: don't overwrite any existing files (used in case the download is interrupted and
    resumed).

Thursday, 6 August 2015

Installing ruby on CentOS 5.5

Upgrade Packages
# yum update

Installing Recommended Packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel 
# yum install libyaml-devel libffi-devel openssl-devel make 
# yum install bzip2 autoconf automake libtool bison iconv-devel

Install RVM ( Ruby Version Manager )
# curl -L get.rvm.io | bash -s stable

Setup RVM Environment
# source /etc/profile.d/rvm.sh

Install Required Ruby Version
rvm install 1.9.3

Install Another Version ( if Required )
# rvm install 2.2.1

Setup Default Ruby Version
# rvm use 1.9.3 --default 

Check Current Ruby Version
# ruby --version