Skip to content

Instantly share code, notes, and snippets.

View andrewhowdencom's full-sized avatar
💭
Delivering Giblets

Andrew Howden andrewhowdencom

💭
Delivering Giblets
View GitHub Profile
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
interval := 0
obj-m += memory.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
install:
sudo insmod memory.ko
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFyjIfEBEADryFqbJGSjmPGLa6NRtcmLIYVdeFk9U2tJOV0Wq+cMLa7By64F
BFP0eEumynY7kdOc8gk/8osbC+owpz83hoyZI1zpUrjLQ8MzMoWJdL8lGVR+FyyV
iR4oY+HCES/VqjbGgZe2uHr1suysn2+IQjb20x3ukVQxmJtVtrmWy4fAxQ9EKDgI
mTRvfhvPKkH2jt3iudm8YMEk9foPsL53/H811mZccpd1/48gGX+DY7D+ePXJqmAB
mCVGhRqGKrOoSaTLHd9sAWYvI1QMs2Emt5BkUwgrfWS1np+xlmmrVYf476QF21rL
ypcynYNY0vKDDPFyp4XdOcmCDyPqlNCPUMAC/jr9bcZaqx8OmFHDfBFugj3CGUEq
IN9E6JofZbOc2tKdFh4j6laoA09f/4elDOyHHOoDhtxraxfqKOu8ZTfk6Yl8oZ/+
nweLJCJI0zSXUXA9218cq/MgVePrE0Z2lu4PUXagu6zfX6jQAcTALtD8/k0I8Eu6
@andrewhowdencom
andrewhowdencom / route.py
Created June 17, 2018 11:10
A tool to add routes for domains as the work VPN is slow and crap. Also, me learning python.
#!/usr/bin/env python3
import argparse
import dns.resolver
import netifaces
from subprocess import call
def get_interface_by_ip(ip):
"""Given an IP will return the interface associated. Doesn't support the same IP bound to multiple interfaces.
from kubernetes import client, config
import sched
import time
import logging
import threading
# Debugging
from pprint import pprint
@andrewhowdencom
andrewhowdencom / strace-many.sh
Last active March 6, 2017 10:35
strace-many.sh
#!/bin/bash
SCRIPT_PATH="$0"
SCRIPT_NAME="$(basename $0)"
function __get_list() {
SEARCH_TERM="$1"
LIST=$(ps -ef | grep "${SEARCH_TERM}" | awk '{print $2}')
{
"id": 1,
"title": "Alerts",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"sharedCrosshair": false,
"hideControls": false,
"time": {
apiVersion: v1
data:
all-nodes-dashboard.json: |-
{
"dashboard": {
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "prometheus",
"description": "",
@andrewhowdencom
andrewhowdencom / safety.yaml
Created October 20, 2016 22:24
Today I did something stupid and rm -rf'd root. Never again.
---
- name: "Install tools to prevent the developer hurting themselves"
package:
name: "{{ item }}"
state: "latest"
with_items:
- "safe-rm"
- name: "Replace the normal rm command with safe-rm"
alternatives:
@andrewhowdencom
andrewhowdencom / template-string.js
Last active August 24, 2016 06:07
Playing with template strings
var template = `This is a lovely notion, but I\'m not sure if ${whoever} will go for it`;
var whoever = 'you';
console.log(template);