Skip to content

Instantly share code, notes, and snippets.

View gadiener's full-sized avatar

Gabriele gadiener

View GitHub Profile
@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
@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 / 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 / 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 / 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 / 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 / vboxhostonlyssh.md
Created May 16, 2018 10:07 — forked from cfebs/vboxhostonlyssh.md
setup a vbox ubuntu server with host only adapter

Virtualbox dev environment w/ static IP

I can never find a great guide on this stuff, so these are more like notes to myself.

The goal here is to have a virtualbox running more or less headless. An ssh client is used separately to actually use the machine. I've found it to be fantastic for a quick dev setup.

lets go

Assumes you have a vbox setup with Ubuntu server (this will work for 16.04) ready to go.

@gadiener
gadiener / Virtual Box Host Only Static IP.md
Created May 16, 2018 09:12 — forked from pjdietz/Virtual Box Host Only Static IP.md
VirtualBox Host-Only Adapter with Static IP

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@gadiener
gadiener / gist:b7bfe89d9c1894d3be60fbabc61ca920
Created May 16, 2018 08:08 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0