Size: 507
Comment:
|
← Revision 11 as of 2019-03-08 23:55:26 ⇥
Size: 1940
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 23: | Line 23: |
== Check port running == {{{#!highlight bash #!/bin/sh RES=`netstat -at -n | grep 0.0.0.0:12345 | wc -l` if [ $RES -eq '1' ] then logger 'Process running' else logger 'Process not listening on port 12345' /sbin/service processx restart logger 'Process restarted' fi }}} {{{#!highlight bash #!/bin/sh RES=`netstat -at -n | grep 0.0.0.0:12345 | wc -l` if [ $RES -ne '1' ] then logger 'Process not listening on port 12345' /sbin/service processx restart logger 'Process restarted' fi }}} == ColorBash prompt == https://wiki.archlinux.org/index.php/Color_Bash_Prompt * start coloring: \[\e[color\] * end coloring: \[\e[m\] * \e[0;32m\] #green color * \e[0;33m\] #yellow color == Network interface data daily == rxtxData.sh: {{{#!highlight bash #!/bin/sh # chmod 755 rxtxData.sh # crontab -e # @daily /root/rxtxData.sh CURR=`date -u` DATA=`ifconfig eth0 | grep "RX bytes" | sed "s/:/ /g"` echo [$CURR] $DATA >> /root/rxtxData.log }}} == SSH Ubuntu bash colors == '''~/.bash_profile''' {{{ if [ -f ~/.bashrc ]; then . ~/.bashrc fi }}} '''~/.bashrc''' {{{ alias ls='ls --color' alias ps='ps faxo pid,user:32,comm' #PS1="\e[0;33m\]\D{%Y-%m-%d}T\A\[\e[m\] \e[0;32m\]\u@\H:\w\r\n\$\[\e[m\] " export PS1="\e[0;33m\]\D{%Y-%m-%d}T\A\[\e[m\] \e[0;32m\]\u@\H:\w\r\n\$\[\e[m\] " PATH=$PATH:/opt/java/jdk1.8.0_162/bin:/opt/java/apache-maven-3.5.3/bin }}} |
bash
Bourne again shell.
Server loop
Add extra IP address to NIC
Adapted from http://unclean.org/howto/secondip.html
Add extra IP 192.168.1.5 to NIC eth0
Check port running
ColorBash prompt
https://wiki.archlinux.org/index.php/Color_Bash_Prompt
- start coloring: \[\e[color\]
- end coloring: \[\e[m\]
- \e[0;32m\] #green color
- \e[0;33m\] #yellow color
Network interface data daily
rxtxData.sh:
SSH Ubuntu bash colors
~/.bash_profile
if [ -f ~/.bashrc ]; then . ~/.bashrc fi
~/.bashrc
alias ls='ls --color' alias ps='ps faxo pid,user:32,comm' #PS1="\e[0;33m\]\D{%Y-%m-%d}T\A\[\e[m\] \e[0;32m\]\u@\H:\w\r\n\$\[\e[m\] " export PS1="\e[0;33m\]\D{%Y-%m-%d}T\A\[\e[m\] \e[0;32m\]\u@\H:\w\r\n\$\[\e[m\] " PATH=$PATH:/opt/java/jdk1.8.0_162/bin:/opt/java/apache-maven-3.5.3/bin