Skip to content

Instantly share code, notes, and snippets.

View frozencemetery's full-sized avatar
🌲
I'll be at a place until a time.

Robbie Harwood frozencemetery

🌲
I'll be at a place until a time.
View GitHub Profile
@frozencemetery
frozencemetery / asm-mode.el
Created April 21, 2014 02:00
Update asm-mode.el to respect tab-width
;;; asm-mode.el --- mode for editing assembler code
;; Copyright (C) 1991, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
;; Free Software Foundation, Inc.
;; All other changes in the public domain.
;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
;; Author: Robbie Harwood (frozencemetery) <rharwood@club.cc.cmu.edu>
;; Maintainer: FSF
@frozencemetery
frozencemetery / random.c
Created July 26, 2014 21:58
Demonstration program that reads bytes from /dev/urandom
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
int main(int argc, char *argv[]) {
if (argc < 2) {
@frozencemetery
frozencemetery / fml
Created August 13, 2014 03:17
FML/NJ, the FML of New Jersey, is a wrapper script for SML designed to be used in REPLs such as that of emacs.
#!/bin/sh
sml -Cprint.depth=10000 -Cprint.length=10000 -Cprint.string-depth=10000 $@
@frozencemetery
frozencemetery / rfcview.el
Created September 11, 2014 00:18
RFC viewing mode updated to obey fill-column
;;; rfcview.el -- view IETF RFCs with readability-improved formatting
;; Copyright (C) 2001-2002 Neil W. Van Dyke
;; Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
;; (mods by Dave Love <fx@gnu.org>)
;; Author: Neil W. Van Dyke <neil@neilvandyke.org>
;; Author: Dave Love <fx@gnu.org>
;; Version: 0.13
;; X-URL: http://www.loveshack.ukfsn.org/emacs/rfcview.el
@frozencemetery
frozencemetery / bright.sh
Last active August 29, 2015 14:10
Brightness control script for Intel and/or NVidia cards
#!/bin/sh
BASE=/sys/class/backlight/
FILE=/brightness
INTEL="${BASE}intel_backlight${FILE}"
NVIDIA="${BASE}nv_backlight${FILE}"
if [ -f "$INTEL" ]; then
echo $((4437 * $1 / 100)) > "$INTEL"
elif [ -f "$NVIDIA" ]; then
echo $1 > "$NVIDIA"
A: Trim the message, leaving appropriate context, then reply below.
Q: How should I reply to email then?
A: No.
Q: Should I include quotations after my reply?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in email?
@frozencemetery
frozencemetery / Nodoka-Dusk
Last active October 12, 2015 04:08
gtkrc (gtk2) for dark square theme on Nodoka engine
# Fedora Nodoka gtkrc, based on Aqualooks
#
# Authors:
# Daniel Geiger <dgeiger_343@yahoo.com>
# Martin Sourada <martin.sourada@seznam.cz>
#
# Uses the Nodoka theme engine, forked from Murrine theme engine
gtk_color_scheme = "fg_color:#D4D4D4\nbg_color:#333333\nbase_color:#474747\ntext_color:#D4D4D4\nselected_bg_color:#ff7228\nselected_fg_color:#ffffff\ntooltip_bg_color:#ff7228\ntooltip_fg_color:#000"
@frozencemetery
frozencemetery / launch.py
Created October 13, 2015 18:11
Postgres server launcher so that I can pretend the server stays in the foreground
#!/usr/bin/env python3
import subprocess
import sys
def main(argv):
print(subprocess.getoutput("pg_ctl -D /var/lib/pgsql/data -l logfile start"))
try:
tail = subprocess.Popen(["tail", "-F", "logfile"], stdout=sys.stdout)
@frozencemetery
frozencemetery / gdb trace
Created November 13, 2015 17:35
fedora - rr with gssproxy
rharwood@fedproxy:~/gssproxy/proxy$ gdb /usr/local/bin/rr
GNU gdb (GDB) Fedora 7.9.1-20.fc22
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
@frozencemetery
frozencemetery / fix-topline.py
Last active December 15, 2015 15:39
Remove blank initial lines of files.
#!/usr/bin/python
import sys
files = sys.argv[1:]
for f in files:
h = open(f, "rU")
lines = h.read().split('\n')
h.close()