Skip to content

Instantly share code, notes, and snippets.

@fgggid
fgggid / vnet-restart.py
Last active July 23, 2016 13:18
improved version of restart libvirt network
#!/usr/bin/env python
#
# Script to enable restarting a network:
# network interfaces are detached / reattached
#
# (c) Luis M Pena <[email protected]> 2014
# Version 1.1
#
# This work is herewith placed in public domain.
@fgggid
fgggid / go.txt
Created November 23, 2016 13:54
Some cmds for go build
CGO_ENABLED=0 GOPATH=~/_prjs/go go build
CGO_ENABLED=0 GOPATH=~/_prjs/go go clean
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 GOPATH=~/_prjs/go go build
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 GOPATH=~/_prjs/go go clean
#!/bin/sh
#
# tcpping: test response times using TCP SYN packets
# URL: http://www.vdberg.org/~richard/tcpping.html
#
# uses tcptraceroute from http://michael.toren.net/code/tcptraceroute/
#
# (c) 2002-2005 Richard van den Berg <[email protected]> under the GPL
# http://www.gnu.org/copyleft/gpl.html
#
#!/usr/bin/env python
#
# Building a tar file chunk-by-chunk.
#
# taken from https://gist.github.com/chipx86/9598b1e4a9a1a7831054
# This is a quick bit of sample code for streaming data to a tar file,
# building it piece-by-piece. The tarfile is built on-the-fly and streamed
# back out. This is useful for web applications that need to dynamically
# build a tar file without swamping the server.
import os
@fgggid
fgggid / 10-setup-glider.sh
Last active December 8, 2021 14:28
glider on edgerouter
#!/usr/bin/env bash
GLIDER_TAR_BALL=/config/user-data/glider.tgz
DEST_FOLDER=/tmp/glider
BIN_FILE=/tmp/glider/glider
OLD_FILE=/tmp/glider/glider.old
PID_FILE=/tmp/glider/glider.pid
CFG_FILE=/tmp/glider/glider.conf
QUIET=
#VPS_IP=`getent ahostsv4 <your server domain> | head -1 | awk '{print $1}'`
VPS_IP=x.x.x.x
@fgggid
fgggid / clean-stale-link.sh
Last active September 13, 2024 09:39
docker overlayfs cleanup for containers and images