Protect your server with a strong iptables rules and ipset lists.
apt install ipset| #!/bin/bash | |
| set -e | |
| bail() { | |
| printf "${RED}$1${NC}\n" 1>&2 | |
| exit 1 | |
| } | |
| function registry_pki_secret() { |
Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.
| #!/bin/bash | |
| echo -ne "\nSTART: $(date "+%Y-%m-%d %H:%M:%S")" | |
| logs="/root/logs/ipset-locate" | |
| if [ ! -d "$logs" ]; then | |
| install -d "$logs" | |
| fi |
| docker-yml() { | |
| docker inspect -f $' | |
| {{.Name}} | |
| image: {{.Config.Image}} | |
| entrypoint: {{json .Config.Entrypoint}} | |
| environment: {{range .Config.Env}} | |
| - {{.}}{{end}} | |
| ' $1 | |
| } |
#Some discussions on logging from docker: Using logstash Using Papertrail
A lot of this boils down to whether you want a single or multi-process (systemd, supervisord etc.) container...
| #!/bin/bash | |
| usage() { | |
| cat << EOF | |
| Usage: $0 [OPTION]... COMMAND | |
| Execute the given command in a way that works safely with cron. This should | |
| typically be used inside of a cron job definition like so: | |
| * * * * * $(which "$0") [OPTION]... COMMAND | |
| Arguments: |
| #!/bin/bash | |
| function jsonval { | |
| temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
| echo ${temp##*|} | |
| } | |
| json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
| prop='profile_image_url' | |
| picurl=`jsonval` |