-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leonid Beynenson
authored and
Leonid Beynenson
committed
Jan 28, 2015
0 parents
commit 86935c4
Showing
17 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
echo $(date +"%Y-%m-%d_%H-%M-%S") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#/bin/bash | ||
git status | grep "^#\s*\(modified\|new\):\s\+" | sed -e "s/^#\s*\(modified\|new\):\s\+//" | sort | uniq | while read a; do li="$li $a"; echo $li; done | tail -n1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#/bin/bash | ||
git status --porcelain | grep "^.[A-Z]" | sed -e "s/^.. *//" | sort | uniq | while read a; do li="$li $a"; echo $li; done | tail -n1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
ps -o args= $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
ps -o ppid= $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tail -f -s0 $1 | sed -e 's/^[0-9-]\+ [0-9:+]\+ >//' -e 's/</\n\0/g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
git rev-parse --quiet --verify HEAD 2> /dev/null >/dev/null || exit 0 | ||
git diff --no-ext-diff --quiet --exit-code || w="*" | ||
git diff-index --cached --quiet HEAD -- || i="+" | ||
if [ -n "$(git ls-files --others --exclude-standard)" ]; then | ||
u="%" | ||
fi | ||
echo "$w$i$u" | ||
|
||
#notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')" qqq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
ffmpeg \ | ||
-i ~/_Work/ESMStitchingDatasets/esm_data-2014-06-18/NV_building/videos/VID_20000531_024907.3gp \ | ||
-r 29.76 -an \ | ||
-vcodec libx264 -b 2000000 \ | ||
output.avi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
~/Downloads/ffmpeg.static.64bit.2014-07-16/ffmpeg \ | ||
-i $1 \ | ||
-r 29.76 -an \ | ||
-vcodec libx264 \ | ||
$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
ps ax | fgrep " python ./logger.py winlog" | fgrep -v grep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
FIRST_LINE=$(head -n1 $(winnamelog) ) | ||
LAST_LINE=$(tail -n1 $(winnamelog) ) | ||
|
||
FIRST_TIME=$(echo "$FIRST_LINE" | sed -e "s/^[^_]*_\([0-9]\+\)-\([0-9]\+\)-\([0-9]\+\)[^0-9-].*/\1 \2 \3/") | ||
LAST_TIME=$(echo "$LAST_LINE" | sed -e "s/^[^_]*_\([0-9]\+\)-\([0-9]\+\)-\([0-9]\+\)[^0-9-].*/\1 \2 \3/") | ||
|
||
echo "FIRST_TIME = $FIRST_TIME" | ||
echo "LAST_TIME = $LAST_TIME" | ||
|
||
FIRST_TIME_H=$(echo "$FIRST_TIME" | cut -d ' ' -f 1 | sed -e "s/^[ 0]*//") | ||
FIRST_TIME_M=$(echo "$FIRST_TIME" | cut -d ' ' -f 2 | sed -e "s/^[ 0]*//") | ||
echo "FIRST_TIME_H = '$FIRST_TIME_H'" | ||
echo "FIRST_TIME_M = '$FIRST_TIME_M'" | ||
|
||
LAST_TIME_H=$(echo "$LAST_TIME" | cut -d ' ' -f 1 | sed -e "s/^[ 0]*//") | ||
LAST_TIME_M=$(echo "$LAST_TIME" | cut -d ' ' -f 2 | sed -e "s/^[ 0]*//") | ||
echo "LAST_TIME_H = '$LAST_TIME_H'" | ||
echo "LAST_TIME_M = '$LAST_TIME_M'" | ||
|
||
TOTAL_TIME_M=$(calc -p "$LAST_TIME_H*60 + $LAST_TIME_M - $FIRST_TIME_H*60 - $FIRST_TIME_M" | sed -e "s/[^0-9.]//g") | ||
echo "TOTAL_TIME_M = '$TOTAL_TIME_M'" | ||
|
||
WINSUMREST=$(winsumrest2 | tail -n1 | sed -e "s/ .*//") | ||
echo "WINSUMREST = '$WINSUMREST'" | ||
|
||
INPUT_REST_TIME=$1 | ||
INPUT_REST_TIME_H=$(echo "$INPUT_REST_TIME" | sed -e "s/[^0-9]/ /g" | sed -e "s/^ *//" | sed -e "s/ \+/ /g" | cut -d ' ' -f 1 | sed -e "s/^[ 0]*//") | ||
INPUT_REST_TIME_M=$(echo "$INPUT_REST_TIME" | sed -e "s/[^0-9]/ /g" | sed -e "s/^ *//" | sed -e "s/ \+/ /g" | cut -d ' ' -f 2 | sed -e "s/^[ 0]*//") | ||
INPUT_REST_TIME_H=$(($INPUT_REST_TIME_H)) | ||
INPUT_REST_TIME_M=$(($INPUT_REST_TIME_M)) | ||
echo "INPUT-REST-TIME = $INPUT_REST_TIME_H h $INPUT_REST_TIME_M min" | ||
|
||
TOTAL_TIME_NO_REST=$(($TOTAL_TIME_M - $WINSUMREST)) | ||
echo "TOTAL_TIME_NO_REST = '$TOTAL_TIME_NO_REST'" | ||
|
||
TOTAL_TIME_NO_REST_AND_NO_INPUT_TIME_REST=$(($TOTAL_TIME_NO_REST - ($INPUT_REST_TIME_H*60) - $INPUT_REST_TIME_M)) | ||
echo "TOTAL_TIME_NO_REST_AND_NO_INPUT_TIME_REST = $TOTAL_TIME_NO_REST_AND_NO_INPUT_TIME_REST" | ||
|
||
RESULT_TOTAL=$((6*60 - $TOTAL_TIME_NO_REST_AND_NO_INPUT_TIME_REST)) | ||
RESULT_H=$(($RESULT_TOTAL/60)) | ||
RESULT_M=$(($RESULT_TOTAL - ($RESULT_H*60) )) | ||
echo "RESULT_TOTAL = $RESULT_TOTAL" | ||
echo "" | ||
echo "RESULT $RESULT_H h $RESULT_M min" | ||
|
||
RESULT_IN_HOURS=$(calc -p "printf('%.2f', ($RESULT_H + ($RESULT_M/60)) )") | ||
echo "RESULT_IN_HOURS = $RESULT_IN_HOURS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
ls -1 /home/leonid/bin/linux-app-logger/winlog_* | grep "/winlog_20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]$" | tail -n1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
ps ax | fgrep "python ./logger.py winlog" | fgrep -v grep| sed -e "s/^.*\(winlog_[0-9_-]\+\) .*/\1/" | while read a; do echo "open $a"; path=/home/leonid/bin/linux-app-logger/$a; cat $path; echo "===================="; tail -f $path; done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
cd /home/leonid/bin/linux-app-logger | ||
#./logger.py winlog_`ddate` 30 stopfile 2>>2_stream.log | ||
./logger.py winlog_`date +"%Y-%m-%d"` 15 2>>2_stream.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
ps ax | fgrep "python ./logger.py winlog" | fgrep -v grep| sed -e "s/^ *\([0-9]\+\) .*/\1/" | while read a; do echo "killing $a"; kill -9 $a; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
grep "\<rest\>" `winnamelog` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
echo "ALL LINES:" | ||
winsumrest | ||
echo "" | ||
|
||
echo "STRANGE LINES:" | ||
winsumrest | grep -v "^ *rest \+\([0-9]\+\) \+min" | ||
|
||
echo "" | ||
|
||
echo "SUMMING LINES:" | ||
b=0 | ||
winsumrest | grep "^ *rest \+\([0-9]\+\) \+min" | sed -e "s/^.*rest \+\([0-9]\+\) \+min.*$/\1/" | while read a; do b=$(($b + $a)); echo "$b"; done | ||
|
||
RESULT_VALUE=$(winsumrest | grep "^ *rest \+\([0-9]\+\) \+min" | sed -e "s/^.*rest \+\([0-9]\+\) \+min.*$/\1/" | while read a; do b=$(($b + $a)); echo "$b"; done | tail -n1) | ||
|
||
echo "" | ||
echo "RESULT" | ||
echo "$RESULT_VALUE min" |