Skip to content

Commit 948e92c

Browse files
author
Vlad Seghete
committed
Merge branch 'master' of github.com:vlsd/config
2 parents c7120fd + 336983c commit 948e92c

File tree

13 files changed

+68
-15
lines changed

13 files changed

+68
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.sw*
22
wakeonlan
3+
oh-my-zsh/custom/*

bin/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
math
22
beet
3+
python

bin/cpusage

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# by Paul Colby (http://colby.id.au), no rights reserved ;)
3+
4+
PREV_TOTAL=0
5+
PREV_IDLE=0
6+
7+
while true; do
8+
CPU=(`cat /proc/stat |grep '^cpu '`) # Get the total CPU statistics.
9+
unset CPU[0] # Discard the "cpu" prefix.
10+
IDLE=${CPU[4]} # Get the idle CPU time.
11+
12+
# Calculate the total CPU time.
13+
TOTAL=0
14+
for VALUE in "${CPU[@]}"; do
15+
(( TOTAL=TOTAL+VALUE ))
16+
done
17+
18+
# Calculate the CPU usage since we last checked.
19+
(( DIFF_IDLE=IDLE-PREV_IDLE ))
20+
(( DIFF_TOTAL=TOTAL-PREV_TOTAL ))
21+
(( DIFF_USAGE=(1000*(DIFF_TOTAL-DIFF_IDLE)/DIFF_TOTAL+5)/10 ))
22+
echo ${DIFF_USAGE} > "/var/tmp/${USER}_cpu"
23+
24+
# Remember the total and idle CPU times for the next check.
25+
let PREV_TOTAL=$TOTAL
26+
let PREV_IDLE=$IDLE
27+
28+
# Wait before checking again.
29+
sleep 1
30+
done
31+

bin/screenstats

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/sh
22

3-
LOAD=$(awk < /proc/loadavg '{print $1}')
4-
MEM=$(free -ho |awk 'FNR==2 {print $4"/"$2}')
5-
echo "L:$LOAD Mem:$MEM"
3+
# if cpusage is not running, start it
4+
if ! pidof -x cpusage > /dev/null
5+
then
6+
cpusage &!
7+
fi
8+
9+
#LOAD=$(awk < /proc/loadavg '{print $1}')
10+
MEM=$(free |awk 'FNR==3 {print 100*$3/($3+$4)}' OFMT="%2.f")
11+
CPU=$(cat /var/tmp/vlad_cpu)
12+
echo "Cpu:$CPU% Mem:$MEM%"

gitconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
[user]
22
name = Vlad Seghete
33
4-
54
[alias]
65
pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master"
7-
#[push]
8-
# default = simple
96
[core]
107
editor = vim
118
[color]

oh-my-zsh

Submodule oh-my-zsh updated from 7a7eda1 to d485044

vim/bundle/repeat

Submodule repeat updated 1 file

vim/bundle/syntastic

vim/bundle/unimpaired

0 commit comments

Comments
 (0)