Skip to content

Instantly share code, notes, and snippets.

View purpleidea's full-sized avatar

James purpleidea

View GitHub Profile
#!/bin/bash
# watch your irssi fnotify file for new messages to notify you of...
# Copyright (C) 2012-2013 James Shubin
# Written by James Shubin <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
FIRST install steam controller driver in retropie setup menu...
IN: /etc/udev/rules.d/99-steam-controller.rules
# This rule is needed for basic functionality of the controller in
# Steam and keyboard/mouse emulation
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
# This rule is necessary for gamepad emulation
KERNEL=="uinput", MODE="0660", GROUP="james", OPTIONS+="static_node=uinput"
#!/bin/bash
# James Shubin, 2018
# run `make` in the first directory (or its parent recursively) that it works in
# https://purpleidea.com/blog/2018/03/10/running-make-from-anywhere/
MF='Makefile' # looks for this file, could look for others, but that's silly
CWD=$(pwd) # starting here
while true; do
if [ -e "$MF" ]; then
@purpleidea
purpleidea / systemd-start-and-wait.go
Created May 4, 2018 13:51 — forked from ghedo/systemd-start-and-wait.go
Start a systemd unit and wait until it stops
package main
import "log"
import "os"
import "github.com/docopt/docopt-go"
import "github.com/godbus/dbus"
const target string = "org.freedesktop.systemd1";
const object string = "/org/freedesktop/systemd1";
@purpleidea
purpleidea / main.go
Created May 7, 2018 15:04 — forked from ast/main.go
Using epoll with go. Packages like fsnotify does not work with sysfs. Then you need epoll, poll or select.
package main
import (
"golang.org/x/sys/unix"
"log"
"os"
)
func main() {
file, err := os.Open("/sys/class/somefile")
@purpleidea
purpleidea / epoll.go
Created May 7, 2018 18:50 — forked from ast/epoll.go
Minimal viable epoll package for go
package epoll
import (
"golang.org/x/sys/unix"
"os"
)
type Op uint32
const (
@purpleidea
purpleidea / terraformer.go
Created May 11, 2018 22:57 — forked from gosuri/terraformer.go
Using terraform with go
package terraformer
import (
"bytes"
"errors"
"path"
"path/filepath"
"...runtime"
"...store"
@purpleidea
purpleidea / SMBDIS.ASM
Created June 30, 2018 02:10 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.