Skip to content

Instantly share code, notes, and snippets.

View pjbgf's full-sized avatar
🦎

Paulo Gomes pjbgf

🦎
View GitHub Profile
@pjbgf
pjbgf / diff.sh
Last active June 25, 2024 08:47
Compare missing commands on new container image
#!/bin/bash
set -eo pipefail
BEFORE=$(mktemp)
AFTER=$(mktemp)
cleanup() {
rm -f "${BEFORE}" "${AFTER}"
}
@pjbgf
pjbgf / check-git.sh
Last active January 30, 2024 15:46
Check for local changes in any git repositories under the current working dir
#!/bin/bash
set -eo pipefail
VERBOSE="${VERBOSE:-false}"
dirs=$(find -mindepth 1 -maxdepth 10 -type d -name .git)
for dir in $dirs; do
dir=$(dirname $dir)
pushd "$dir" > /dev/null
@pjbgf
pjbgf / file.go
Last active July 8, 2023 21:06
Filtered billy.Filesystem PoC
package filtered
import (
"io"
"os"
"time"
"github.com/go-git/go-billy/v5"
)
@pjbgf
pjbgf / rancher-webhook.yaml
Created June 21, 2023 07:57
Rancher Manager - Cilium Network Policies
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: webhook-strict
namespace: cattle-system
spec:
endpointSelector:
matchLabels:
app: rancher-webhook
@pjbgf
pjbgf / README.md
Last active November 15, 2022 22:46
Flux - AppArmor Profiles
@pjbgf
pjbgf / Dockerfile
Created December 14, 2021 11:21
Container to patch CVE-2021-25740
FROM alpine
ARG KUBECTL_VERSION="1.21.7"
RUN apk add curl
RUN curl -LO "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \
curl -LO "https://dl.k8s.io/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256" && \
echo "$(cat kubectl.sha256) kubectl" | sha256sum -c && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
@pjbgf
pjbgf / vscode-settings.json
Last active November 8, 2019 14:40
VS Code Settings
{
"go.autocompleteUnimportedPackages": true,
"terminal.integrated.shell.linux": "/usr/bin/zsh",
"terminal.integrated.fontFamily": "'Source Code Pro for Powerline', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontFamily": "'Source Code Pro for Powerline', 'monospace', monospace, 'Droid Sans Fallback'",
"go.formatTool": "goimports",
"editor.fontSize": 18,
"terminal.integrated.fontSize": 18,
"markdown.preview.fontSize": 18,
"git.enableSmartCommit": true,
@pjbgf
pjbgf / keybase.md
Created October 8, 2019 04:49
keybase.md

Keybase proof

I hereby claim:

  • I am pjbgf on github.
  • I am pjbgf (https://keybase.io/pjbgf) on keybase.
  • I have a public key whose fingerprint is 387B D98F 9325 9940 726E 5044 01AC CE69 9E98 5BDA

To claim this, I am signing this object:

# Pull the necessary images:
docker pull nathanleclaire/curl:latest
docker pull openjdk:8u111-jre-alpine

# Start the controller container, note that it has RW access to the Docker API socket:
docker run \
  -ti \
  --rm \
@pjbgf
pjbgf / .gitconfig
Last active February 23, 2019 06:50
Setup linux dev machine
[user]
email = Paulo.Gomes.uk@gmail.com
name = Paulo Gomes
# signingkey = 08523F6EF8967D22
[alias]
co = checkout
# cms = commit -S -m
cm = commit -m
d = diff
s = status