Skip to content

Instantly share code, notes, and snippets.

View adamancini's full-sized avatar

ada mancini adamancini

View GitHub Profile
#!/bin/bash
set -e
bail() {
printf "${RED}$1${NC}\n" 1>&2
exit 1
}
function registry_pki_secret() {
@adamancini
adamancini / README.md
Created October 25, 2021 22:16 — forked from eusonlito/README.md
Strong iptables and ipset protection

Protect your server with a strong iptables rules and ipset lists.

1. Install ipset to manage ipstables lists

apt install ipset

2. Install iptables-persistent to preserve iptables rules on reboot

@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active November 18, 2024 14:50
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

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.

Sponsor

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.

@eusonlito
eusonlito / README.md
Last active September 12, 2024 11:56
Strong iptables and ipset protection

Protect your server with a strong iptables rules and ipset lists.

1. Install ipset to manage ipstables lists

apt install ipset

2. Install iptables-persistent to preserve iptables rules on reboot

@eusonlito
eusonlito / ipset-locate.sh
Last active October 18, 2021 02:51
Script to execute as a cronjob and generate json files with the IPs added to ipset
#!/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
@lalyos
lalyos / generate-compose.sh
Created April 5, 2015 18:59
generate docker-compose.yml by inspecting a running container
docker-yml() {
docker inspect -f $'
{{.Name}}
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
environment: {{range .Config.Env}}
- {{.}}{{end}}
' $1
}
@afolarin
afolarin / docker-log-gist.md
Last active March 16, 2023 13:02
docker-logs
@liquidgecka
liquidgecka / cron_helper.sh
Last active September 28, 2023 15:35
Cron helper
#!/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:
@tmikell
tmikell / DBC Final Apps.md
Last active December 25, 2015 12:49
Dev Bootcamp Chicago Final Projects

2013 Cohorts

Foxes

"WHO RUN IT"

Alt text

A distributed running club for the web. This app allows runners to connect with one another on their own terms, to run where they want, when they want, and how they want. Runners can build, share and save their favorite routes online.

@cjus
cjus / jsonval.sh
Created June 26, 2011 17:42
Extract a JSON value from a BASH script
#!/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`