Skip to content

Instantly share code, notes, and snippets.

View kevinwallace's full-sized avatar
🍞

Kevin Wallace kevinwallace

🍞
View GitHub Profile
@ae-s
ae-s / neighsupdate.sh
Last active February 11, 2023 02:12
nsupdate $(ip neigh list)
#!/bin/bash
# Tiny tool to run as a cronjob, which will update
# (using nsupdate) your zone files to include dhcp-
# and statelessly-assigned addresses.
# Space-separated list of address-to-name resolution methods to try.
# They'll be tried in the order listed here.
METHODS="hostfile avahi localdns"
# Zone to update for each type of IP address. In my home network,
@spangenberg
spangenberg / patch_arp.sh
Created August 31, 2016 11:34
/config/scripts/post-config.d/patch_arp.sh
#!/bin/sh
read -r -d '' ARP_ACCEPT <<'EOF'
help: Enable arp-accept on this interface
create:expression: "sudo sh -c \"echo 1 > /proc/sys/net/ipv4/conf/$VAR(../../@)/arp_accept\" "
delete:expression: "sudo sh -c \"echo 0 > /proc/sys/net/ipv4/conf/$VAR(../../@)/arp_accept\" "
EOF
mkdir -p /opt/vyatta/share/vyatta-cfg/templates/interfaces/ethernet/node.tag/ip/enable-arp-accept
echo $ARP_ACCEPT > /opt/vyatta/share/vyatta-cfg/templates/interfaces/ethernet/node.tag/ip/enable-arp-accept/node.def
anonymous
anonymous / snaaaaake.js
Created December 25, 2015 07:23
(function () {
var refreshRate = 100;
var particleLimit = 5;
var snake = {
x: (window.innerWidth * Math.random()) - window.pageXOffset,
y: (window.innerHeight * Math.random()) - window.pageYOffset,
dx: Math.ceil(Math.random() * 50) - 25,
dy: Math.ceil(Math.random() * 50) - 25,
atan2: Math.atan2(this.dx, this.dy),
@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
// ==UserScript==
// @name Ingress Player Locations
// @description Shows player locations on the Ingress Intel Map
// @version 1.2
// @match http://www.ingress.com/intel
// @run-at document-start
// ==/UserScript==
function override() {