Skip to content

Instantly share code, notes, and snippets.

View adamancini's full-sized avatar

ada mancini adamancini

View GitHub Profile

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.

apiVersion: "cluster.kurl.sh/v1beta1"
kind: "Installer"
metadata:
name: "patch"
spec:
firewalldConfig:
firewalld: enabled
firewalldCmds:
- ["--permanent", "--add-port=22/tcp"]
- ["--zone=home", "--change-interface=eth0"]
apiVersion: "cluster.kurl.sh/v1beta1"
kind: "Installer"
metadata:
name: "patch"
spec:
kotsadm:
version: "1.104.5"
@adamancini
adamancini / netshoot.yaml
Created November 17, 2023 21:01 — forked from randomvariable/netshoot.yaml
netshoot.yaml
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: netshoot
labels:
app: netshoot
spec:
updateStrategy:
type: RollingUpdate
@adamancini
adamancini / readme.md
Created January 13, 2023 16:13
create kubernetes user certificates

Create user CSR

openssl genrsa -out user1.key 2048
openssl req -new -key user1.key -out user1.csr

Approve CSR

openssl x509 -req -in user1.csr -CA /etc/kubernetes/pki/ca.crt -CAkey /etc/kubernetes/pki/ca.key -CAcreateserial -out user1.crt -days 500
#!/bin/bash
set -e
bail() {
printf "${RED}$1${NC}\n" 1>&2
exit 1
}
function registry_pki_secret() {
for c in $(docker-compose ps -aq); do echo $c && docker inspect $c | jq '.[].State'; done
abd1952d26086816ede0b550546474cbe82f8b00ab7731a446bb284106e02a46
{
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 2350,
@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

✔  jane  ~  docker run --rm -d --network project_foo --name svc1 nginx
8b04f5fe4265b16f985d5b9a6e0c25ebbc871f657d635b5cf5b93cd6a71d2f5e
✔  jane  ~  docker run --rm -d --network project_foo --name svc2 nginx
1650e43bbe8b548d2e5f9614c90152858c32953ffbb4c5cdaa48bd8aceba4ee1
↵ 126  jane  ~  docker run --rm --network project_foo nicolaka/netshoot dig svc1
; <<>> DiG 9.14.8 <<>> svc1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17755
version: '3.6'
services:
on-failure:
image: busybox
command: sh -c 'for i in $$(seq 1 5); do echo -n $$(hostname) && date && sleep 2; done'
deploy:
restart_policy:
condition: on-failure
delay: '2s'
none: