added some more functions and a new env variable
This commit is contained in:
commit
39f39c4e14
2 changed files with 42 additions and 1 deletions
|
@ -169,4 +169,38 @@ multiplication_table()
|
||||||
for y in {1..10}; do
|
for y in {1..10}; do
|
||||||
for x in {1..10}; do echo -n "| $x*$y=$((y*x)) ";
|
for x in {1..10}; do echo -n "| $x*$y=$((y*x)) ";
|
||||||
done; echo; done| column -t
|
done; echo; done| column -t
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
cve_lookup()
|
||||||
|
|
||||||
|
{
|
||||||
|
[[ -z "$1" ]] && echo "Usage: $0 CVE-YYYY-NNNN"
|
||||||
|
|
||||||
|
curl -s http://www.cvedetails.com/cve/$1/ | grep 'meta name="description" content="' | awk -F\" '{print $4}'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
swap_used()
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
SUM=0
|
||||||
|
OVERALL=0
|
||||||
|
for DIR in `find /proc/ -maxdepth 1 -type d -regex "^/proc/[0-9]+"`
|
||||||
|
do
|
||||||
|
PID=`echo $DIR | cut -d / -f 3`
|
||||||
|
PROGNAME=`ps -p $PID -o comm --no-headers`
|
||||||
|
for SWAP in `grep Swap $DIR/smaps 2>/dev/null | awk '{ print $2 }'`
|
||||||
|
do
|
||||||
|
let SUM=$SUM+$SWAP
|
||||||
|
done
|
||||||
|
if (( $SUM > 0 )); then
|
||||||
|
echo "PID=$PID swapped $SUM KB ($PROGNAME)"
|
||||||
|
fi
|
||||||
|
let OVERALL=$OVERALL+$SUM
|
||||||
|
SUM=0
|
||||||
|
done
|
||||||
|
echo "Overall swap used: $OVERALL KB"
|
||||||
}
|
}
|
||||||
|
|
9
.env
9
.env
|
@ -1,6 +1,13 @@
|
||||||
# Enviroment Variables
|
# Enviroment Variables
|
||||||
|
|
||||||
export PATH=$PATH:$HOME/bin
|
export PATH=$PATH:$HOME/bin
|
||||||
export PS1="\[\e[32m\]\u\[\e[m\]@\H\[\e[36m\][\[\e[m\]\[\e[33m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]: "
|
|
||||||
|
# Terminal color
|
||||||
|
|
||||||
|
# green@white[abspath]
|
||||||
|
#export PS1="\[\e[32m\]\u\[\e[m\]@\H\[\e[36m\][\[\e[m\]\[\e[33m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]: "
|
||||||
|
# red@white[abspath]
|
||||||
|
export PS1="\[\e[31m\]\u\[\e[m\]@\H\[\e[36m\][\[\e[m\]\[\e[33m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]: "
|
||||||
|
|
||||||
export EDITOR=vim
|
export EDITOR=vim
|
||||||
export HISTTIMEFORMAT="%d/%m/%y %T "
|
export HISTTIMEFORMAT="%d/%m/%y %T "
|
||||||
|
|
Loading…
Add table
Reference in a new issue