Skip to content

Commit eefb9ef

Browse files
committed
2 parents e699384 + b8be5e2 commit eefb9ef

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

bashrc/install-batch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ aptitude -y install git
7171
aptitude -y install gitk
7272
aptitude -y install subversion
7373
aptitude -y install mysql-server
74+
aptitude -y install sysklogd
7475
#aptitude -y install arduino
7576
#aptitude -y install eclipse-jdt
7677
#aptitude -y install python-pip

bashrc/userlog.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# usage: install this file to /etc/profile.d/ or add to /etc/profile
2+
export HISTTIMEFORMAT="%y-%m-%d %H:%M:%S "
3+
PS1="`whoami`@`hostname`:"'[$PWD]'
4+
5+
history
6+
USER_IP=`who -u am i 2>/dev/null | awk '{print $NF}' | sed -e 's/[()]//g'`
7+
8+
if [ "X$USER_IP" == "X:0" ]; then
9+
USER_IP=`hostname`
10+
elif [ "X$USER_IP" == "X" ]; then
11+
USER_IP=`hostname`
12+
fi
13+
14+
if [ ! -d "/tmp/history" ]; then
15+
mkdir /tmp/history
16+
chmod 777 /tmp/history
17+
fi
18+
19+
if [ ! -d /tmp/history/${LOGNAME} ]; then
20+
mkdir /tmp/history/${LOGNAME}
21+
chmod 300 /tmp/history/${LOGNAME}
22+
fi
23+
24+
export HISTSIZE=4096
25+
DT=$(date +"%Y%m%d_%H%M%S")
26+
export HISTFILE="/tmp/history/${LOGNAME}/${USER_IP}_history.$DT"
27+
chmod 600 /tmp/history/${LOGNAME}/*history* 2>/dev/null

0 commit comments

Comments
 (0)