Month: April 2013

Making the ubuntu 12.10 recognize your Android (internal and external sdcard) and adding usb rules security (udev)

Hi,

If you plug your android phone or tablet on your Ubuntu 12.10 and nothing is happening, follow this next steps and magically your cell phone will be recognized:

sudo add-apt-repository ppa:langdalepl/gvfs-mtp
sudo apt-get update
sudo apt-get install libmtp-common libmtp-dev libmtp-runtime libmtp9 mtp-tools gmtp python-pymtp libusb-dev gvfs

The follow code is to register your device on usb dev rules of linux:

wget http://downloads.sourceforge.net/project/libmtp/libmtp/1.1.1/libmtp-1.1.1.tar.gz
tar -xvf libmtp-1.1.1.tar.gz
cd libmtp-1.1.1
./configure --prefix=/usr
make
sudo make install
sudo cp 69-libmtp.rules /etc/udev/rules.d
sudo service udev restart

Credits and references:

http://www.webupd8.org/2013/01/upgrade-to-gvfs-with-mtp-support-in.html

http://gunavara.blogspot.com.br/2012/11/samsung-galaxy-s3-vs-ubuntu-1204.html

http://askubuntu.com/questions/87667/getting-mtp-to-work-with-a-galaxy-nexus

If you have any questions, please leave a comment and i will try to help.

Bye,
Victor Jabur

Advertisements

Regular Expression – Regex – For Date Validation (Bissextile Included)

Hi all,

I found a good regex for date validation that consider bissextile. I tested and it works.

I have problems with the bellow expressions in the eclipse, because it don't support the expression (?:) Non-Capturing groups.
^(?:(?:(?:0[1-9]|1\d|2[0-8])/(?:0[1-9]|1[0-2])|(?:29|30)/(?:0[13-9]|1[0-2])|31/(?:0[13578]|1[02]))/\d{4}|29/02/(?:\d\d(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00))$

I discover another expression that works in the Eclipse:

^(((((0[1-9])|(1\d)|(2[0-8]))\/((0[1-9])|(1[0-2])))|((31\/((0[13578])|(1[02])))|((29|30)\/((0[1,3-9])|(1[0-2])))))\/(\d{4}))|((29\/02\/(\d{2})(([02468][048])|([13579][26]))))$

Both expressions are in the format: dd/mm/yyyy

Credits: http://www.perlmonks.org/?node_id=153702