Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/soarpenguin/perl-scripts

  • Loading branch information...
commit eefb9ef83072c6a547bfb892cd00e4dd7564cef5 2 parents e699384 + b8be5e2
@soarpenguin authored
Showing with 28 additions and 0 deletions.
  1. +1 −0  bashrc/install-batch.sh
  2. +27 −0 bashrc/userlog.sh
View
1  bashrc/install-batch.sh
@@ -71,6 +71,7 @@ aptitude -y install git
aptitude -y install gitk
aptitude -y install subversion
aptitude -y install mysql-server
+aptitude -y install sysklogd
#aptitude -y install arduino
#aptitude -y install eclipse-jdt
#aptitude -y install python-pip
View
27 bashrc/userlog.sh
@@ -0,0 +1,27 @@
+# usage: install this file to /etc/profile.d/ or add to /etc/profile
+export HISTTIMEFORMAT="%y-%m-%d %H:%M:%S "
+PS1="`whoami`@`hostname`:"'[$PWD]'
+
+history
+USER_IP=`who -u am i 2>/dev/null | awk '{print $NF}' | sed -e 's/[()]//g'`
+
+if [ "X$USER_IP" == "X:0" ]; then
+ USER_IP=`hostname`
+elif [ "X$USER_IP" == "X" ]; then
+ USER_IP=`hostname`
+fi
+
+if [ ! -d "/tmp/history" ]; then
+ mkdir /tmp/history
+ chmod 777 /tmp/history
+fi
+
+if [ ! -d /tmp/history/${LOGNAME} ]; then
+ mkdir /tmp/history/${LOGNAME}
+ chmod 300 /tmp/history/${LOGNAME}
+fi
+
+export HISTSIZE=4096
+DT=$(date +"%Y%m%d_%H%M%S")
+export HISTFILE="/tmp/history/${LOGNAME}/${USER_IP}_history.$DT"
+chmod 600 /tmp/history/${LOGNAME}/*history* 2>/dev/null
Please sign in to comment.
Something went wrong with that request. Please try again.