This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://cloud.google.com/compute/docs/faq#find_ip_range | |
# nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8 | |
myarray=() | |
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :` | |
do | |
myarray+=($LINE) | |
for LINE2 in `dig txt $LINE +short | tr " " "\n" | grep include | cut -f 2 -d :` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
block() { | |
# $1 is the remote address you want to block. | |
route add $1 gw 127.0.0.1 lo | |
route add -host $1 reject | |
# Flush the cache. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as zimbra user | |
# Add Disclaimer | |
zmprov mcf zimbraDomainMandatoryMailSignatureEnabled TRUE | |
zmprov md DOMAIN.COM zimbraAmavisDomainDisclaimerText "text disclamer" | |
zmprov md DOMAIN.COM zimbraAmavisDomainDisclaimerHTML "<html><body><h1>HTML Disclaimer</h1><br> <h1>User 1</h1><br>phone number here</body></html>" | |
./libexec/zmaltermimeconfig -e DOMAIN.COM | |
./libexec/zmaltermimeconfig # if have multiple MTAs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# RAM/CPU consumers | |
# ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head | |
# ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 20 # more details, less metrics | |
# ps aux --sort=-%mem | awk 'NR<=10{print $0}' # even more details | |
LOG="/var/log/ram.dump.log" | |
DATE="$(date)" | |
# echo -e "RAM Dump @ ${DATE} :\n $(vmstat -sn -SM | egrep '(total|free)')" >> ${LOG} |