Skip to content

Instantly share code, notes, and snippets.

View pjbgf's full-sized avatar

Paulo Gomes pjbgf

View GitHub Profile
@pjbgf
pjbgf / AKS Running Pods.json
Created May 9, 2018 22:28
Sample Kubelet Running Pods
{
"kind": "PodList",
"apiVersion": "v1",
"metadata": { },
"items": [{
"metadata": {
"name": "heapster-4637824328-zpckl", "namespace": "kube-system", "uid": "XXXXX-XXXX-XXX-XXXXXXXX", "creationTimestamp": null
}, "spec": {
"containers": [{
"name": "heapster-nanny", "image": "k8s-gcrio.azureedge.net/addon-resizer@sha256:dcec9a5c2e20b8df19f3e9eeb87d9054a9e94e71479b935d5cfdbede9ce15895", "resources": {}
@pjbgf
pjbgf / get-hostnames.sh
Created June 29, 2018 11:05
Get all PaaS Host Names from the current Azure subscription
# return all web sites
az resource list --resource-type "Microsoft.Web/sites" --query "[].id" --output tsv |
# query azure for each resource
xargs az resource show --ids |
# define output
jq -r '.[].siteProperties.properties // .[].properties | .enabledHostNames[] // .hostNames | match("^((?!scm).)*$").string'
# return all cloud services
az resource list --resource-type "Microsoft.ClassicCompute/domainNames" --query "[].id" --output tsv |
@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
# 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 / 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:

@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 / 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 / README.md
Last active November 15, 2022 22:46
Flux - AppArmor Profiles
@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 / 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"
)