Showing posts with label Hack. Show all posts
Showing posts with label Hack. Show all posts

Jan 29, 2016

MAC OS X - Android Transfer more than 4 GB Files

The requirement was straight forward to copy a 6.5 Gb file from Phone (I own a 64 GB One Plus Two) and when I tried to do the same - Android File Transfer refused !

The other options to transfer it via network were all slow and I did try shareit and Aid Droid but gave up very soon. I needed to transfer via the USB cable  as wifi would take some time and I am not a very patient types.

Google showed me that adb might be able to help and it indeed did !

By default on my OS X El Capitan (version 10.11.1) - the adb was not in path. However I knew that it would be installed since I remember that I did have android studio installed. A little more google and it pointed that it would be under 

~/Library/Android/sdk/platform-tools

By the way, I also added the path to my bash_profile just to make my life easier next time.

I ran the following command to copy the file from my sdcard0 to my mac. The option -p allows one to see the progress and I recommend the same if you wish to transfer huge files.

adb pull -p /storage/sdcard0/train_photos.tgz /.

That's it. 

So now you know how to Bypass the Android File Transfer 4 GB Limit !

PS: You may need to verify that the adb is able to detect your phone and enable developer options on your phone. 

Jun 24, 2015

TSV to CSV Quickie


Sed a very powerful editor on *IX/Mac allows to convert TSV to any delimited format. Basically a simple replacement in file which is quick and efficient.

sed "s/ /,/g" >

On linux box it is easier to identify a tab by \t however on mac one needs to press the Control + v and then hit the "tab" button.

The generic syntax to replace all occurrences of from_a with to_b is

sed "s/from_a /to_b/g" >

In case of optional delimiters also used when strings are always with double quotes (idiot sqldeveloper exporting data in my case"  following will do the trick
 sed -e 's#"##g' source  > destination

Use ">>" instead of ">" in case you want to append and not overwrite. 

Nov 27, 2012

Oracle Tip : Override or have a local copy of TNSNAMES.ORA



Usually users don’t have access on UNIX box to modify the global TNSNAMES.ORA in the $ORACLE_HOME/network/admin. In this case all they need to do is create a .tnsnames.ora [notice the DOT before the file name] in their home directory. Next time when you login oracle notices this file and when you try to connect it looks up this file before the global tnsnames.ora is referred. In case of conflicts user’s version takes precedence.


Flag for the DBA - when a user on UNIX says he is not able to connect the culprit could be his copy of .tnsnames.ora too!

And for the still curious this is possible with sqlnet.ora as well.

Oh I love Oracle :)