Skip to content

Instantly share code, notes, and snippets.

View anthonywong's full-sized avatar
🏠
Working from home

Anthony Wong anthonywong

🏠
Working from home
  • Canonical
  • Hong Kong
View GitHub Profile
sudo strace -e trace=network -p `pgrep -x sogou-qimpanel` -s 100000 -f -ff -o sogou
@anthonywong
anthonywong / get_number_of_merged_commits.sh
Last active February 1, 2018 07:58
Calculate total number of commits from merges
n=0
PATTERN=ti-linux-4.14.y
while read line; do
hash=`echo "$line" | cut -f1 -d' '`
nn=`git show "$hash" | head -2 | tail -1 | awk '{ print $2".."$3 }' | xargs git log --pretty=oneline | wc -l`
echo "$nn": "$line"
n=$(($n + $nn))
done <<< "$(git log --grep 'Merge branch' --abbrev-commit --pretty=oneline | grep $PATTERN)"
echo "Total number of commits:" $n
#!/bin/bash
[ $UID != 0 ] && echo "Must run as root" && exit
i=1
RUNS=3
if [ -n "$1" ]; then
RUNS=$1
fi
while [ $i -le $RUNS ]; do
d=`date +%Y%m%d-%H%M`