Skip to content

Instantly share code, notes, and snippets.

@AndersonIncorp
AndersonIncorp / .bash_login
Last active July 10, 2018 19:42
Present info on terminal/ssh login. ~/.bash_login file
#!/bin/bash
## SSH Check
if [ -n "$SSH_CONNECTION" ] && [ "$SHLVL" == "1" ]; then
## pacman -S pacman-contrib
## https://unix.stackexchange.com/questions/119126
stat_mem=$(free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }')
stat_disk=$(df -h | awk '$NF=="/"{printf "%d/%dGB (%s)\n", $3,$2,$5}')
stat_cpu=$(top -bn1 | grep load | awk '{printf "%.2f\n", $(NF-2)}')
echo -e -n " Date : `date +"%A, %e %B %Y, %r"`
Hostname : `hostname`
@AndersonIncorp
AndersonIncorp / instal_bind.txt
Last active November 5, 2017 17:07
DNS Self hosted subzone *.ip.example.com.
### Install BIND
# https://wiki.archlinux.org/index.php/BIND
pacman -S bind
### Configure named.conf
# cp /etc/named.conf /etc/named.conf.bak
# nano /etc/named.conf
# diff /etc/named.conf.bak /etc/named.conf
9c9
< // listen-on-v6 { any; };
---