Skip to content

Instantly share code, notes, and snippets.

View flarco's full-sized avatar
Targeting

Fritz Larco flarco

Targeting
View GitHub Profile
@flarco
flarco / prerelease
Last active May 28, 2020 19:03 — forked from foca/release
Small shell script to create GitHub releases from the command line
#!/usr/bin/env bash
set -e
[ -z "$DEBUG" ] || set -x;
usage() {
echo "$0 <repo> <tag> [<release name>] [-- <asset>...]" >&2;
}
if [ "$1" = "-h" -o "$1" = "--help" ]; then
@flarco
flarco / floating-ip-gateway.sh
Created March 19, 2020 20:24 — forked from sparkcodeuk/floating-ip-gateway.sh
Digital Ocean floating IP gateway script (force droplet to use the assigned floating IP for outbound traffic as well as inbound traffic)
#!/bin/bash
# Force outbound traffic through the attached floating IP
NET_INT="eth0"
CURL_TIMEOUT=3
echo -n "Setting floating IP as the default gateway: "
# Check there's a floating IP attached to this droplet
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then
import os
data = {
'1MB' : 1*1024*1024, # 1MB
'10MB' : 10*1024*1024, # 10MB
'100MB' : 100*1024*1024, # 100MB
'1GB' : 1*1024*1024*1024, # 1GB
'10GB' : 10*1024*1024*1024, # 10GB
'50GB' : 50*1024*1024*1024, # 50GB
}