Skip to content

Instantly share code, notes, and snippets.

@browol
browol / _0__ssl_certbot_letsencrypt.md
Created August 15, 2021 10:15 — forked from maxivak/_0__ssl_certbot_letsencrypt.md
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@browol
browol / generate-docker-config-json.md
Last active August 28, 2023 09:52
How to manually generate .docker/config.json file

Using the commands below too manually create .docker/config.json file.

BASE64_AUTH=$(echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64)
mkdir -p ~/.docker
echo "{\"auths\": {\"$REGISTRY_HOSTNAME\": {\"auth\": \"$BASE64_AUTH\"}}}" > ~/.docker/config.json

Originally posted by @tennox in moby/buildkit#565 (comment)

@browol
browol / remove-local-branches.md
Last active August 16, 2023 05:07 — forked from davoam/git: remove local branches which do not exist on remote server
How to remove local Git branches that do not exist on the remote server?

How to remove local Git branches that do not exist on the remote server?

git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
@browol
browol / switch-tf-version.sh
Last active May 11, 2024 12:04
Switch terraform CLI version using tenv
VERSION=1.6.3
# Use tenv, see https://github.com/tofuutils/tenv
brew tap tofuutils/tap
brew install tenv
TENV_ARCH=amd64
tenv tf install $VERSION
tenv tg install latest-stable
# DEPRECATED: the tfenv CLI is required, see https://github.com/tfutils/tfenv
@browol
browol / tcp_flags.txt
Created May 7, 2024 08:40 — forked from tuxfight3r/tcp_flags.txt
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@browol
browol / pipeline.groovy
Created May 15, 2024 14:41 — forked from lvthillo/pipeline.groovy
Scripted Jenkins pipeline which uses Kubernetes plugin
podTemplate(label: 'mypod', containers: [
containerTemplate(name: 'git', image: 'alpine/git', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'docker', image: 'docker', command: 'cat', ttyEnabled: true)
],
volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock'),
]
) {
node('mypod') {
import groovy.yaml.YamlSlurper
def slurper = new YamlSlurper()
def configuration = '''
version: 3.0
environment: "dev"
context:
path: "/test"
endpoints: