Monday, November 26, 2012

Monday, October 22, 2012

Copy from remote machine to local machine securely without logging

scp username@remote_pc_ip:/path_to_remote_file path_to_local_file

Wednesday, October 17, 2012

How to extract files from android system.img


To extract files from android system.img on linux PC, use below steps
1) simg2img system.img system_ext4.img
2) mkdir temp
3) sudo mount -o rw,loop system_ext4.img temp
Now you can browse or copy files from temp folder.

Get google android phone factory images


https://developers.google.com/android/nexus/images

Tuesday, September 25, 2012

Run command on remote machine using ssh without logging

To run any command on remote machine using ssh without loggin, use following ssh user@remote_ip command_to_execute

If you want to run remote graphical app locally on linux machine, you can use
ssh -X user@remote_ip command_to_execute

Debug Linux kernel startup issue or measure kernel bootup time

To debug Linux kernel startup issue or to measure kernel bootup time you can append kernel command line with initcall_debug.
 

Print Hex numbers with leading zeros in python

To print Hex numbers with leading zeros in python, I have used following code,




for i in range(0,32):
    print '0x%0.8X' %(1<<);


Search string in multiple files in linux

Search string in multiple files in linux, use following function in .bashrc file of linux.

srcfind() {
if [ $# -gt 0 ]; then {
find . -type f -name "$1" -print0 |xargs -0 -r grep -n --color "$2" "$3" "$4" "$5" 2>/dev/null;
} else {
echo "Usage: srcfind filetype string_to_find option_for_grep";
} fi;
}