# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
This file contains 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/sh -e | |
SUBNET="${1}"; | |
TIMEOUT="${2:-2}"; | |
pingw8="-w"; | |
uname | grep -i darwin && export pingw8="-W"; | |
ping_cmd() { for octet in $(seq 1 254); do ( ping "$1.$octet" -c 1 "$pingw8" "$TIMEOUT" > /dev/null 2> /dev/null && printf "%s.%s\n" "$1" "$octet" ) & done | sort -V; }; | |
if [ ! -t 0 ]; then |
This file contains 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/sh | |
COUNTRY="$(echo "$1" | tr '[:upper:]' '[:lower:]')" | |
if [ -z "$COUNTRY" ]; then printf "\\n\\tNO COUNTRY CODE SPECIFIED\\n\\n" && exit 1; fi | |
IPSET_SET="${COUNTRY}-subnets" | |
IPSET="$(command -v ipset || exit 1)" | |
printf "\\n\\tPREPARING IPSET SET\\t\\t\\t[%s]" "$IPSET_SET" && \ | |
"$IPSET" flush "$IPSET_SET" || "$IPSET" create "$IPSET_SET" hash:net && \ | |
printf "\\n\\tDOWNLOADING AND IMPORTING SUBNETS.." && \ | |
curl -s -o- "http://www.ipdeny.com/ipblocks/data/countries/$COUNTRY.zone" | \ | |
grep -Eo '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+/[0-9]+' | \ |
This file contains 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/sh | |
msg() | |
{ | |
tstamp() | |
{ | |
tput setaf 7; | |
date "+%d.%m.%Y %T.%N %Z"; | |
tput sgr0 | |
}; |
This file contains 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/sh | |
# add this function to your env and then import other scripts with: | |
# eval "$(ghload gist nexus166/msg 581472463579c73e15aa71e6db610cb7)" | |
ghload() { | |
MOD_TYPE=${1}; TOLOAD=${2}; MODULE=${3}; | |
GH_NAME="$(echo ${TOLOAD} | cut -d'/' -f1)"; GH_REPO="$(echo $TOLOAD | cut -d'/' -f2)"; | |
ghGISTS="https://gist.github.com"; ghREPOS="https://raw.githubusercontent.com"; | |
_man() { printf "Usage:\\n\\t\$> ghload gist nexus166/msg 581472463579c73e15aa71e6db610cb7\n\\t\$> ghload repo Spajderix/barc README.md\\n"; }; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
This file contains 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
import os | |
import hvac | |
import json | |
from flask import Flask, request, make_response | |
app = Flask(__name__, template_folder='templates') | |
app.config['SECRET_KEY'] = 'https:/your.vault.instance:8200/' | |
app.config['FLASK_ENV'] = 'production' |
This file contains 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 | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
V4=$(which iptables) | |
V6=$(which ip6tables) | |
[[ $(id -u) -eq 0 ]] || exit 1 | |
_install() { | |
if [[ ! -e /usr/local/sbin/fwbase.sh ]]; then cat ${0} | tee /usr/local/sbin/fwbase.sh; fi |
This file contains 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/sh -e | |
printf "%s" "$(tr -cd '[:graph:]' < ${2:-/dev/urandom} | tr -d '\-#&\+,\.\/\:\`\"'\' | head -c${1:-32})"; |
tldr
docker plugin install rexray/s3fs \
S3FS_OPTIONS="allow_other,use_path_request_style,nonempty,url=https://s3.my.xyz" \
S3FS_ENDPOINT="https://s3.my.xyz" \
3FS_ACCESSKEY="xxx" \
3FS_SECRETKEY="yyy"
OlderNewer