Skip to content

Instantly share code, notes, and snippets.

View gadiener's full-sized avatar

Gabriele gadiener

View GitHub Profile
@gadiener
gadiener / backup-repos
Created October 15, 2018 10:16 — forked from kopiro/backup-repos.sh
Backup all Repositories in current directory
#!/bin/bash
for i in $(find . -type d -maxdepth 1 -mindepth 1); do
echo "Backup $i..."
zip_name="$i-$(date +'%y%m%d').zip"
pushd "$i" && \
git archive --format=zip --output="/opt/backups/$zip_name" master && \
popd
done
@gadiener
gadiener / delete_custom_metrics.py
Created July 19, 2019 09:20 — forked from jeffadams/delete_custom_metrics.py
script to delete all custom metrics from a stackdriver account
#!/usr/bin/env python
from google.cloud import monitoring
'''
# Using a service account with credentials in a json file:
JSON_CREDS = '/path/to/json'
from oauth2client.service_account import ServiceAccountCredentials
scopes = ["https://www.googleapis.com/auth/monitoring",]
credentials = ServiceAccountCredentials.from_json_keyfile_name(
@gadiener
gadiener / viscosity-to-ovpn.py
Created October 20, 2019 17:17 — forked from ishahid/viscosity-to-ovpn.py
Convert all of your Viscosity connections into OVPN configuration files for OpenVPN
#!/usr/bin/python
"""Convert all of your Viscosity connections into OVPN configuration files for OpenVPN
https://gist.github.com/ishahid/693c2c97b3236a3c2416fc09ab170244
"""
import re
import glob
from os.path import expanduser, dirname
@gadiener
gadiener / signal.go
Created May 26, 2020 17:34 — forked from reiki4040/signal.go
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@gadiener
gadiener / tmux-iterm2.md
Created October 24, 2020 09:30 — forked from royling/tmux-iterm2.md
tmux in iTerm2 cheatsheet
@gadiener
gadiener / tmux-iterm2.md
Created October 24, 2020 09:30 — forked from royling/tmux-iterm2.md
tmux in iTerm2 cheatsheet
@gadiener
gadiener / download_from_minio.sh
Last active October 14, 2021 20:02 — forked from JustinTimperio/download_from_minio.sh
Download a File to Minio with Curl and Zero External Libraries or Programs
#!/usr/bin/env sh
# Example: ./download_minio.sh example.url.com username password bucket-name minio/path/to/file.txt.zst /download/path/to/file.txt.zst
if [ -z $1 ]; then
echo "You have NOT specified a MINIO URL!"
exit 1
fi
if [ -z $2 ]; then