As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/bin/bash | |
| # get free memory | |
| IFS=" " read USED FREE TOTAL <<<$(free -htm | grep "Mem" | awk {'print $3,$4,$2'}) | |
| # get processes | |
| PROCESS=`ps -eo user=|sort|uniq -c | awk '{ print $2 " " $1 }'` | |
| PROCESS_ALL=`echo "$PROCESS"| awk {'print $2'} | awk '{ SUM += $1} END { print SUM }'` | |
| PROCESS_ROOT=`echo "$PROCESS"| grep root | awk {'print $2'}` | |
| PROCESS_USER=`echo "$PROCESS"| grep -v root | awk {'print $2'} | awk '{ SUM += $1} END { print SUM }'` |
| --- | |
| - hosts: localhost | |
| gather_facts: no | |
| become: true | |
| become_user: root | |
| become_method: sudo | |
| vars: | |
| - target_host: '' | |
| tasks: |
| --- | |
| - hosts: localhost | |
| gather_facts: no | |
| become: true | |
| become_user: root | |
| become_method: sudo | |
| tasks: | |
| - add_host: | |
| name: "{{ target_host }}" |
| --- | |
| - hosts: test | |
| roles: | |
| - ansible-role-security | |
| post_tasks: | |
| - name: ensure fail2ban starts on a fresh reboot | |
| service: | |
| name: fail2ban | |
| state: started | |
| enabled: yes |
As configured in my dotfiles.
start new:
tmux
start new with session name:
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of