esac
+nb-mails() {
+ printf 'f *\nx\n' | mail | perl -e '@_=<>; shift @_; print shift @_; print reverse @_'
+}
+
+nb-git-create() {
# NB 19.02.15 root@pi:puppet# nb-git-create puppet/data
# NB 19.02.15 Initialized empty Git repository in /home/git/puppet/data.git/
# NB 19.02.15 Cloning into 'data'...
# NB 19.02.15 fatal: remote origin already exists.
# NB 19.02.15 Branch master set up to track remote branch master from origin.
# NB 19.02.15 Everything up-to-date
-function nb-git-create() {
declare name="${1%.git}"
declare dir=$(basename $name)
declare repo='git@git.nbdom.net'
git remote add origin $repo:${name}.git
}
-function nb-git-clone() {
+nb-git-clone() {
git clone git@git.nbdom.net:${1%.git}.git
}
echo "$env_value"
}
-function realpath() {
+realpath() {
perl -MFile::Spec -MCwd -e 'print File::Spec->rel2abs( Cwd::abs_path($ARGV[0]) )."\n"' $1
}
-function ascii() {
+ascii() {
perl -e 'binmode(STDOUT, ":utf8"); for(32..255){ print "$_:".chr($_)."\n"; }'
}
-function psmem() {
+psmem() {
#ps -C $1 -O rss | xargs -r cat | gawk '\
#ps -p `pgrep -f $1` -O rss 2>/dev/null| xargs -r | gawk '\
ps=`ps ax -O rss 2>/dev/null`
return
}
-function unzipurl() {
+unzipurl() {
declare url=$1
#declare file=`echo "$url"|sed 's,^.*?\([^/]+\.zip\)$,\1,'`
declare file=`echo "$url"|awk -F/ '/\.zip$/ { print $NF }'`
rm "$file"
}
-function bytes2h() {
+bytes2h() {
declare in="cat" args=""
if [ "$1" == "-regex" ]; then
args="regex=$2"