Instantly share code, notes, and snippets.

View grbl-settings.txt
$$
$0=10
$1=25
$2=0
$3=1
$4=0
$5=0
$6=0
$10=1
$11=0.010
View osquery.sql
SELECT DISTINCT process.name, listening.port, listening.address, process.pid
FROM processes AS process JOIN listening_ports AS listening ON process.pid = listening.pid;
View network_namespace_example.bash
#!/bin/bash
set -e
# Network namespace example
# Inspired by https://lwn.net/Articles/580893/
#
NNS="netns1"
DEV_OUTSIDE=veth0
DEV_INSIDE=veth1
View config.boot
service {
dhcp-server {
disabled false
dynamic-dns-update {
enable true
}
global-parameters "key rndc-key { algorithm HMAC-MD5; secret paste_your_ddns_secret_here; };"
global-parameters "zone home.local. { primary 10.1.2.2; key rndc-key; }"
global-parameters "ddns-domainname "home.local.";"
global-parameters "ddns-rev-domainname "in-addr.arpa.";"
View timsatotest.user.js
// ==UserScript==
// @name Image resource example
// @resource logo ../icons/laptop.png
// @grant GM.getResourceUrl
// ==/UserScript==
(async function() {
let img = document.createElement("img");
img.src = await GM.getResourceUrl("logo");
document.body.appendChild(img);
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "debian/wheezy64"
config.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
end
end
View fw_block.sh
#!/usr/bin/bash
## Run every 24h via cron
## Old entries will time out later automatically
(
cd /var/lib/firewall
wget -qN 'http://www.spamhaus.org/drop/drop.txt'
ipset create -exist spamhaus_drop hash:net counters timeout 90000 comment
View hostname.socket
[Unit]
Description=Hostname Socket
[Socket]
ListenStream=101
Accept=true
[Install]
WantedBy=sockets.target
View hooks.json
[
{
"id": "github",
"execute-command": "/home/toke/webhooks/hooks/github.sh",
"command-working-directory": "/home/toke/go",
"pass-arguments-to-command":
[
{
"source": "payload",
"name": "head_commit.id"
View 85-dock.rules
SUBSYSTEMS=="usb", SYMLINK="delldock", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="2513", ENV{DEVTYPE}=="usb_device", TAG+="systemd", ENV{SYSTEMD_WANTS}="dock.target"