Git Reset

Hi,

Often we encounter situations where we need to reset source code to a git baseline present in multiple directories.

Here is a script which recursively scans the directory and resets the respective folders where patches were previously applied.

 

#!/bin/bash
#Suman Kumar to reset all gits

umask u=rwx,g=rwx,o=rx

#set -x

UNDER=’\e[4m’
RED=’\e[31;1m’
GREEN=’\e[32;1m’
YELLOW=’\e[33;1m’
BLUE=’\e[34;1m’
MAGENTA=’\e[35;1m’
CYAN=’\e[36;1m’
WHITE=’\e[37;1m’
ENDCOLOR=’\e[0m’
ITCVER=”Rel”
export WORKDIR=`pwd`
export BUILDROOT=”$WORKDIR/A8064AAAAANLYA1335_$ITCVER”
export PATCH_DIR=”$WORKDIR/patches”
export CAFTAG=”A8064AAAAANLYA1335.xml”
export OUT=${BUILDROOT}/out/target/product/msm8960/
export CPUS=`grep -c processor /proc/cpuinfo`

reset_gitrepo_to_1335()
{
if [ ! -e $PATCH_DIR ]
then
echo -e “$RED $PATCH_DIR : Not Found $ENDCOLOR”
fi

cd $PATCH_DIR

android_patchdir_list=$(find * -type d | sort)

for patchdir in $android_patchdir_list; do
for f in $(find $patchdir -mindepth 1 -maxdepth 1 -type f -name “*.patch” | sort);do
echo $patchdir
echo -e “$GREEN resetting patches in $patchdir … $ENDCOLOR”

cd $BUILDROOT/$patchdir
git reset –hard A8064AAAAANLYA1335
rm -rf .git/rebase-apply

cd -
break
done
done
}

reset_gitrepo_to_1335
rm -rf $BUILDROOT/vendor/qcom/proprietary/

 

Posted in Uncategorized

Linux Split and Merge command

To split a large file into smaller ones:

Lets say you have to send your personal video file of size 100MB to your friend through Gmail but gmail has a maximum file upload limit of size 20MB.So you have to split it into 5 smaller files of size 20MB and upload it.For this you have to go to the directory where the file is stored and use the following command in the terminal:

$ split –b20m Largefilename Smallfilename

where 20m is the size of output file in MB,to split in KB put k instead of m.various other options are also available to split command,to know them just type

$ split --help

To join smaller files into a larger one:

These days most files hosted at major file hosting sites are split into smaller files such as *.001…009 or *.part01…*.part09 etc.To join these files you don’t have to search for any external softwares,you just have the commands built into every GNU/Linux system.

To join the part files open up the terminal and navigate to the directory where the files are placed and execute the command:

$ cat partfilename* > outputfilename

For example if the file names are

video.avi.01

video.avi.02

video.avi.03 etc.use

$ cat video.avi.* > video1.avi

Ref:

http://blulin.wordpress.com/2009/02/07/split-and-join-large-files-in-gnulinux-just-using-terminal/

Posted in Uncategorized

Symbols using Keyboard

HOW TO MAKE SYMBOLS WITH KEYBOARD
Alt + 0153….. ™… trademark symbol
Alt + 0169…. ©…. copyright symbol
Alt + 0174….. ®….registered ­ trademark symbol
Alt + 0176 …°……degre ­e symbol
Alt + 0177 …±….plus-or ­-minus sign
Alt + 0182 …¶…..paragr ­aph mark
Alt + 0190 …¾….fractio ­n, three-fourths
Alt + 0215 ….×…..multi ­plication sign
Alt + 0162…¢….the ­ cent sign
Alt + 0161…..¡….. ­.upside down exclamation point
Alt + 0191…..¿….. ­upside down question mark
Alt + 1…….☺….sm ­iley face
Alt + 2 ……☻…..bla ­ck smiley face
Alt + 15…..☼…..su ­n
Alt + 12……♀…..f ­emale sign
Alt + 11…..♂……m ­ale sign
Alt + 6…….♠…..s ­pade
Alt + 5…….♣…… ­Club
Alt + 3…….♥…… ­Heart
Alt + 4…….♦…… ­Diamond
Alt + 13……♪…..e ­ighth note
Alt + 14……♫…… ­beamed eighth note
Alt + 8721…. ∑…. N-ary summation (auto sum)
Alt + 251…..√…..s ­quare root check mark
Alt + 8236…..∞….. ­infinity
Alt + 24…….↑….. ­up arrow
Alt + 25……↓…… ­down arrow
Alt + 26…..→…..ri ­ght arrow
Alt + 27……←…..l ­eft arrow
Alt + 18…..↕……u ­p/down arrow
Alt + 29……↔…lef ­t right arrow

Posted in Uncategorized

How to plan and execute effectively !!

Hello friends, welcome to my post on “How to plan effectively”. How often do we think, if i had the time and planned properly, i could have achieved this stuff….. This thing looks to be within my reach but i … Continue reading

Gallery | Leave a comment

SVN Server and Client

Hi all, This post details how to setup SVN server on Ubuntu 12.04 machine. I have used RapidSVN as the subversion client interface for testing. A quick information about SVN Server. As can be clearly seen in the figure below, … Continue reading

Gallery | Tagged , , ,

Linux Interview Questions

itron Qs:what is Process & Threads and diffMemory sharing between Process& thread and between multiple threadswap to reverse a sentence in which words should not reverse.what is rtosexpalin abt any driver interface (xplained i2c)storage classes in Chow do u know … Continue reading

Gallery

ubuntu 12.04 grub rescue

Ref: —– http://opensource-sidh.blogspot.in/2011/06/recover-grub-live-ubuntu-cd-pendrive.html http://rbgeek.wordpress.com/2012/06/29/how-to-reinstall-ubuntu-without-losing-the-old-data-with-separate-home-partition/ http://askubuntu.com/questions/83771/recovering-grub-after-installing-windows-7 http://askubuntu.com/questions/197833/recovering-from-grub-rescue-crash http://askubuntu.com/questions/159846/tried-to-boot-ubuntu-but-the-grub-rescue-shows-up-instead

Gallery