Skip to content

Instantly share code, notes, and snippets.

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:

@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 ASD0tE2Ydlg79TiylCYT9dpcK-VQX0NMLGpJZk6ap2oLJwo
To claim this, I am signing this object:
@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
@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 / 12d1:1f01
Created July 10, 2020 10:07 — forked from elupus/12d1:1f01
Setup of e3372 modem on pfsense
# /usr/local/share/usb_modeswitch/12d1:1f01
# Huawei E353 (3.se) and others
TargetVendor=0x12d1
TargetProductList="14db,14dc"
HuaweiNewMode=1
@juusujanar
juusujanar / README.md
Created December 3, 2020 14:07
Go logging framework benchmark
apiVersion: v1
data:
Corefile: |
.:53 {
errors
health {
lameduck 5s
}
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
# Gets the IP address of a computer via the MAC address. This will only work on LAN
# segments. By default we'll scan the ARP table, but then defer to an IP scan to
# as needed.
#
# Usage: $returnIpAddress = GetIPFromMAC "12-43-de-52-a9-99" "192.168.10."
# Pass in the mac address with dashes (-) as the first parameter
# Pass in an IP address with the last number missing, be sure to include the trailing "."
# Be sure to check the value if $returnIpAddress -eq $null to see if a value was actually returned
#
function GetIPFromMAC {
@juusujanar
juusujanar / contacts.py
Created July 29, 2021 11:22
Generate CSV for importing into Google Contacts, containing known salesman phone numbers in Estonia
#!/usr/bin/env python3
numbers = [
"+3726980665",
"+3726980666",
"+3726980667",
"+3726980668",
"+3726980669",
"+3726980670",
"+3726980671",
"+3726980672",