Skip to content

Instantly share code, notes, and snippets.

View rberrelleza's full-sized avatar
👋
Hi friend!

Ramiro Berrelleza rberrelleza

👋
Hi friend!
View GitHub Profile
@rberrelleza
rberrelleza / sitemap.xml
Last active May 15, 2024 10:58
sitemap 1.19
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url>
<loc>https://www.okteto.com/docs/archives/</loc>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
@rberrelleza
rberrelleza / okteto.yaml
Last active March 14, 2024 18:32
Check if your deployment is a preview environment or a development environment
deploy:
- name: is preview environment?
command: |
# okteto inserts the preview.okteto.com label only on preview environments
kubectl get namespace $OKTETO_NAMESPACE -o jsonpath='{.metadata.labels}' | grep -q "preview.okteto.com"
exit_code=$?
# we add the PREVIEW_ENVIRONMENT variable to the OKTETO_ENV so it can be used in the rest of the deploy commands
if [ $exit_code -eq 0 ]; then
echo "ENVIRONMENT_TYPE=preview" >> $OKTETO_ENV
@rberrelleza
rberrelleza / crds-0.9.8.yaml
Created February 4, 2022 03:10
crds-0.9.8.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: certificaterequests.cert-manager.io
annotations:
cert-manager.io/inject-ca-from-secret: 'okteto/cert-manager-webhook-ca'
labels:
app: 'cert-manager'
app.kubernetes.io/name: 'cert-manager'
app.kubernetes.io/instance: 'cert-manager'
@rberrelleza
rberrelleza / octane-policy.yaml
Created January 20, 2021 00:16
Run octane on clusters that allow PSP
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: octane
spec:
allowPrivilegeEscalation: true
allowedCapabilities:
- '*'
defaultAllowPrivilegeEscalation: true
fsGroup:
@rberrelleza
rberrelleza / main.go
Created August 26, 2020 04:16
go downloader with progress bar
package main
import (
"io"
"net/http"
"os"
"github.com/cheggaaa/pb/v3"
)
@rberrelleza
rberrelleza / clean-branch
Last active June 25, 2020 21:31
clean git branches
git branch | grep -v 'master\|main' > /tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -D </tmp/merged-branches
@rberrelleza
rberrelleza / delete-branches.sh
Created May 5, 2020 22:52
delete old branches
git branch | grep -v master | xargs -n1 git branch -D
@rberrelleza
rberrelleza / okteto.yml
Last active May 1, 2020 02:35
dev env with a mysql client
name: client-mysql
image: mysql
command:
- sh
forward:
- 3306:mysql:3306
resources:
limits:
memory: 128Mi
cpu: 200m
@rberrelleza
rberrelleza / terminate-namespace.sh
Created April 20, 2020 18:23
Force terminate a namespace stuck in the terminating phase
namespace=$1
kubectl get namespace $namespace -ojson | jq 'del(.spec.finalizers[0])' | kubectl replace --raw "/api/v1/namespaces/$namespace/finalize" -f=-
@rberrelleza
rberrelleza / go.mod
Last active January 22, 2024 05:49
sample SSH forward
module forward
go 1.14
require (
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect
github.com/gliderlabs/ssh v0.3.0
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71
)