Skip to content

Instantly share code, notes, and snippets.

@juusujanar
juusujanar / export-secrets-configmaps.sh
Last active January 12, 2023 11:18
Kubectl useful commands
#!/bin/bash
set -e
# Export all secrets and configmaps in all namespaces to files
# Every file will have name <namespace>__<type>__<name>.yaml
# e.g. default__secret__database.yaml
namespaces=$(kubectl get namespace | awk '{print $1}' | tail -n +2)
for ns in $namespaces
do
@juusujanar
juusujanar / README.md
Last active January 22, 2020 14:24
Convert Azure IP ranges to comma-separated list

Azure IP ranges

This script converts Azure IP ranges to a comma-separated list for use in firewall rules, e.g. gcloud compute firewall-rules. The given scripts looks up AzureCloud.eastus2 IP ranges, that are also used by GitHub Actions to connect to the outside, but you can easily change the name of the ranges you want to look up.

Unfortunately Microsoft does not seem to provide a static direct link to the JSON, so the link may need updating every now and then.

I pulled the link from https://www.microsoft.com/en-us/download/details.aspx?id=56519.

Requirements

  • curl
### Keybase proof
I hereby claim:
* I am juusujanar on github.
* I am janar (https://keybase.io/janar) on keybase.
* I have a public key ASD0tE2Ydlg79TiylCYT9dpcK-VQX0NMLGpJZk6ap2oLJwo
To claim this, I am signing this object:
@juusujanar
juusujanar / Dockerfile
Last active August 15, 2017 11:35 — forked from mhubig/Dockerfile
Alpine Linux based cronjob runner
FROM alpine:latest
RUN apk add --update php python py-pip mysql-client \
&& pip install awscli \
&& rm -rf /var/cache/apk/*
RUN touch crontab.tmp \
&& echo '* */6 * * * /usr/bin/php /var/www/partkeepr/app/console partkeepr:cron:run' > crontab.tmp \
&& echo '0 2 * * * /usr/bin/sql_backup' >> crontab.tmp \
&& crontab crontab.tmp \

Keybase proof

I hereby claim:

  • I am juusujanar on github.
  • I am janar (https://keybase.io/janar) on keybase.
  • I have a public key ASATO6KKsLB0EMSyXoU1Tp5FqmIlN3Xyz8hI6LF6MzOMeAo

To claim this, I am signing this object: