Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# https://bugs.launchpad.net/oem-priority/+bug/1939565
cd /var/lib/shim-signed/mok/
openssl genrsa -out MOK.priv 2048
openssl req -new -x509 -sha256 -subj '/CN=Example-key' -key MOK.priv -out MOK.pem -days 1231111
openssl x509 -in MOK.pem -inform PEM -out MOK.der -outform DER -days 1231111
mokutil --import MOK.der
cd -
@d1b
d1b / gist:0eef43e172670ae503fed33a76849f10
Last active May 20, 2018 12:54
skymesh ppp openwrt / lede configuration
config interface 'wan'
option ifname 'eth1'
option proto 'pppoe'
option ipv6 '1'
option peerdns '0'
option dns '8.8.8.8'
option dns '8.8.4.4'
option username 'username@ppp.skymesh.com.au'
option password 'password'
@d1b
d1b / firewall
Last active March 15, 2017 14:10
iinet 6rd openwrt 15.05. config.
...
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'wan wan6'
@d1b
d1b / openvpn_client.conf
Created April 15, 2015 13:58
openvpn upstart
description "openvpn client service instance"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
expect fork
function FindProxyForURL(url, host)
{
return "SOCKS5 localhost:8080; SOCKS5 localhost:8081; SOCKS5 localhost:8082";
}
#!/usr/bin/python
__version__="0.0.1"
__author__="david"
__email__="db@d1b.org"
import argparse
import csv
import json
from multiprocessing import Process
import netaddr
@d1b
d1b / gist:1905564
Created February 25, 2012 03:00
newer user flow -> for nested sep. user
your user | other user
|
su otheruser | xauth -f ~/.Xauthority add :1 . `mcookie`
| export DISPLAY="1:0"
#get a copy of the cookie file |
#run up xephyr |
Xephyr :1 -auth OTHER_USERS_XAUTH -screen 1280x1024 |
| dbus-launch
| gnome-session
@d1b
d1b / shorewall-log-kmsg-parser.py
Created September 10, 2011 07:57
shorewall-log-kmsg-parser
import sys
import socket
def return_red(string):
return "\033[1;31m" + string + "\033[m"
console = open("/dev/console", "w")
while True:
f = open("/proc/kmsg", 'r')
@d1b
d1b / usb_device_monitor.py
Created August 9, 2011 16:49
python_gnome_unlock_on_usb_device
import time
import subprocess
def is_screen_locked():
output = subprocess.Popen(["gnome-screensaver-command", "--query"], stdout=subprocess.PIPE).communicate()[0]
if "screensaver is inactive" in output:
return False
return True
def monitor_and_unlock(usb_id):
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#define DRIVER_AUTHOR "Dave B. <db@d1b.org>"
#define DRIVER_DESC "Rickroll ;)"
#define DEVICE_NAME "chardev"
MODULE_LICENSE("GPL");