Skip to content

Instantly share code, notes, and snippets.

View grahamc's full-sized avatar
❄️

Graham Christensen grahamc

❄️
View GitHub Profile
@grahamc
grahamc / shell.nix
Last active January 4, 2019 19:52 — forked from kalbasit/shell.nix
# This allows overriding nixpkgs by passing `--arg pkgs ...`
{ pkgs ? import ./devtools/lib/nix/nixpkgs.nix {}
, lib ? pkgs.lib
}:
with pkgs;
with lib;
let
@grahamc
grahamc / some.nix
Last active October 15, 2017 23:39 — forked from dustinlacewell-wk/some.nix
emacs = {
buildOrg = {emacs ? emacs25-nox, init ? ./init.org}:
runCommand "init.el"
{ buildInputs = [ emacs ]; }
''
mkdir -p $out;
ln -s "${init}" ./init.org;
emacs -Q --script "${./assets/org-build.el}" -f make-init-el;
cp init.el $out;
'';
@grahamc
grahamc / 0_reuse_code.js
Created June 14, 2017 21:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@grahamc
grahamc / default.nix
Last active March 25, 2017 01:10 — forked from Taeradan/default.nix
trying conditional imports
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
cfg = config.r6d.config-generator;
computers = config.r6d.computers;
profiles = config.r6d.profiles;
in
{
@grahamc
grahamc / command_run_failed_log.log
Last active January 29, 2017 14:43 — forked from hyphon81/command_run_failed_log.log
I would like to use "sudo" in the systemd service. However I couldn't.
2017-01-29 22:46:29.208 1863 DEBUG oslo_concurrency.processutils [-] Running cmd (subprocess): sudo nova-rootwrap /etc/nova/rootwrap.conf iptables-save -c execute /nix/store/gqs7kinmfnx5pznj20swm1l3g0gbxysv-python2.7-oslo.concurrency-3.14.0/lib/python2.7/site-packages/oslo_concurrency/processutils.py:344
2017-01-29 22:46:29.214 1863 DEBUG oslo_concurrency.processutils [-] u'sudo nova-rootwrap /etc/nova/rootwrap.conf iptables-save -c' failed. Retrying. execute /nix/store/gqs7kinmfnx5pznj20swm1l3g0gbxysv-python2.7-oslo.concurrency-3.14.0/lib/python2.7/site-packages/oslo_concurrency/processutils.py:426
----
2017-01-29 22:46:30.713 1863 DEBUG oslo_concurrency.processutils [-] Running cmd (subprocess): sudo nova-rootwrap /etc/nova/rootwrap.conf iptables-save -c execute /nix/store/gqs7kinmfnx5pznj20swm1l3g0gbxysv-python2.7-oslo.concurrency-3.14.0/lib/python2.7/site-packages/oslo_concurrency/processutils.py:344
2017-01-29 22:46:30.718 1863 DEBUG oslo_concurrency.processutils [-] u'sudo nova-rootwrap /etc/nova/root
@grahamc
grahamc / server.sh
Created February 12, 2014 15:56 — forked from warmwaffles/server.sh
#!/bin/bash
${1:=8000}
python -m SimpleHTTPServer "$@"
@grahamc
grahamc / tmp.sh
Created January 1, 2013 02:53 — forked from anonymous/tmp.sh
#!/bin/bash
bottle=12.5
empty=0.95
s=6.95
i=1
tabspace=" "
defmax=5
if [ -z $1 ]; then
max=$defmax
@grahamc
grahamc / etcfocus_blacklist.py
Created May 16, 2012 13:40 — forked from anonymous/etcfocus_blacklist.py.txt
/etc/focus_blacklist.py
# vim:ts=4
import re
def domain_liveleak_com(dt):
if dt.hour < 8 or dt.hour > 18:
return True
if dt.weekday > 4:
return True
@grahamc
grahamc / markdown.md
Created October 31, 2011 21:10 — forked from tchrist/gist:1328966
LL - iterator
<?php
/**
* In reality we should be creating our getters, setters, etc, but for the
* truely lazy among us...
*
* @param string $method
* @param array $arguments
* @return void
* @author Travis Black
*/