Skip to content

Instantly share code, notes, and snippets.

@flungo
flungo / docker-send
Last active February 12, 2024 19:23
Script for sending docker images between machines using SSH
#!/bin/bash
# MIT License
#
# Copyright (c) 2017 Fabrizio Lungo <opensource@flungo.me>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@flungo
flungo / lsiommu
Created March 10, 2017 23:59
List the devices and their IOMMU groups.
#!/bin/bash
for d in $(find /sys/kernel/iommu_groups/ -type l | sort -n -k5 -t/); do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done;
@flungo
flungo / ssh.fish
Created February 7, 2017 13:39
SSH wrapper function that replaces uncommon TERM values with `xterm`
# SSH wrapper function that replaces uncommon TERM values with `xterm`.
#
# The term values listed for override should be fully xterm compatible for this to work.
# Removes problems of unrecognised TERM when connecting to remote servers without having to install the appropriate terminfo.
function ssh
if contains $TERM rxvt-unicode-256color
env TERM=xterm ssh $argv
else
command ssh
end
@flungo
flungo / vboxnetinit
Created February 1, 2017 11:53
Initialise a VirtualBox host-only network adapter on the host using iproute2 instead of net-tools
#!/bin/bash
# Initialise a VirtualBox host-only network adapter on the host using iproute2 instead of net-tools.
#
# Usage: vboxnetinit [INTERFACE [ADDRESS]]
#
# INTERFACE the name of the host-only network interface. Defaults to "vboxnet0"
# ADDRESS the address to assign to the host with subnet in CIDR notation
# Get the variables
NETWORK_NAME=${1:-vboxnet0}
@flungo
flungo / install-pacaur.sh
Created October 6, 2016 18:23 — forked from rumpelsepp/install-pacaur.sh
A small script for arch linux which builds and installs "pacaur" automatically
#!/bin/sh
#
# The MIT License (MIT)
#
# Copyright (c) 2015-2016 Stefan Tatschner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@flungo
flungo / include-math.patch
Created May 12, 2016 10:40
Patch for 'gringo' Arch AUR Package (https://aur.archlinux.org/packages/gringo/) adding missing import.
From 27017125a5c4ede839e5b5f29f680bc96d6992a2 Mon Sep 17 00:00:00 2001
From: Fabrizio Lungo <fab@lungo.co.uk>
Date: Thu, 12 May 2016 11:36:28 +0100
Subject: [PATCH] Added patch for missing cmath import
Signed-off-by: Fabrizio Lungo <fab@lungo.co.uk>
---
PKGBUILD | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
@flungo
flungo / l-z-swap
Last active November 21, 2015 11:28
Mupen64plus JITE USB Game Pad
[DragonRise Inc. Generic USB Joystick]
plugged = True
plugin = 2
mouse = False
AnalogDeadzone = 4096,4096
AnalogPeak = 32768,32768
DPad R = hat(0 Right)
DPad L = hat(0 Left)
DPad D = hat(0 Down)
DPad U = hat(0 Up)
@flungo
flungo / keybase.md
Last active August 29, 2015 14:16
PGP Public Key

Keybase proof

I hereby claim:

  • I am flungo on github.
  • I am flungo (https://keybase.io/flungo) on keybase.
  • I have a public key whose fingerprint is 8AAF 769C E77D F5D0 9D24 D232 1E21 446D 3E71 CBDB

To claim this, I am signing this object:

@flungo
flungo / Door.java
Created July 30, 2013 10:09
Bukkit org.bukkit.material.Door potential solution.
package org.bukkit.material;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
/**
* Represents a door.
*
*/
@Deprecated
@flungo
flungo / gist:3732879
Created September 16, 2012 15:38 — forked from remy/gist:2484402
jquery.marquee.js
/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
*/
(function ($) {
$.fn.marquee = function (klass) {
var newMarquee = [],
last = this.length;