Skip to content

Instantly share code, notes, and snippets.

View gist:1a474213c9f9039377e919776cd1e97e
diff --git a/configure b/configure
index f137cf1..13b04f0 100755
--- a/configure
+++ b/configure
@@ -6275,9 +6275,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <stdlib.h>
#include <sys/types.h>
View gist:d0fa8f06bc30eedf671c49fe6d7a1eac
diff --git a/configure b/configure
index f137cf1..13b04f0 100755
--- a/configure
+++ b/configure
@@ -6275,9 +6275,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <stdlib.h>
#include <sys/types.h>
View keymap.cson
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
View project1-table-template.txt
timer ticks | R(A) | R(B) | R(C) | P(A) | P(B) | P(C) | thread to run
------------|------|------|------|------|------|------|--------------
0 | | | | | | |
4 | | | | | | |
8 | | | | | | |
12 | | | | | | |
16 | | | | | | |
20 | | | | | | |
24 | | | | | | |
28 | | | | | | |
@rogerhub
rogerhub / gist:7855c727d5ce284eedf2
Created Jan 17, 2016
Duplicity 0.7.06 segmentation fault with librsync 2.0.0 on OS X
View gist:7855c727d5ce284eedf2

(January 16, 2016) I encounted a segmentation fault in the function rs_search_for_block of librsync while running the Duplicity backup tool. This crash appears to be related to this bug.

In the meantime, I used the following commands to switch back to old versions of librsync and duplicity:

brew switch librsync 0.9.7
brew switch duplicity 0.6.26_1
@rogerhub
rogerhub / smc.c
Created Dec 27, 2015
OS X script for getting fan speed and temperature, based off of Chris911/iStats
View smc.c
// clang -o smc smc.c -framework IOKit -framework CoreFoundation
/*
* Apple System Management Control (SMC) Tool
* Copyright (C) 2006 devnull
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
@rogerhub
rogerhub / sgdf-graph.py
Created Dec 8, 2015
Running time graph for SGDF.
View sgdf-graph.py
from sgdf.fusion.alternatives.reference import *
from sgdf.fusion.alternatives.quickdescent import *
from sgdf.benchmarking.headless import *
import time
def b(algorithm, n):
mask = np.zeros((n, n), dtype=np.bool)
mask[n/4:3*n/4, n/4:3*n/4] = True
source = np.random.random((n, n, 3)).astype(np.float32)
@rogerhub
rogerhub / Outage.md
Last active Mar 4, 2016
RogerHub Monday 12/7/2015 Outage
View Outage.md

RogerHub Monday 12/7/2015 Outage

The Final Grade Calculator was broken from approximately 2:21AM PST to 11:22AM PST (9 hours 1 minute) on December 7th 2015.

Root cause

The JavaScript for the Final Grade Calculator was out of date.

@rogerhub
rogerhub / fuse-zip-homebrew.md
Created Oct 8, 2015
fuse-zip fails to install via homebrew on OS X 10.11 with boxen (or non-standard homebrew path)
View fuse-zip-homebrew.md

The gist of the problem is that brew install fuse-zip shows me something like this on OS X 10.11:

ar -cr libfusezip.a bigBuffer.o extraField.o fileNode.o fuse-zip.o fuseZipData.o
clang++ main.o -Xlinker -L/usr/local/libinstall -Llib -lfusezip -L/usr/local/lib -losxfuse -pthread -liconv  -L/opt/boxen/homebrew/Cellar/libzip/1.0.1/lib -lzip -lz  \
	    -v -o fuse-zip
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -w -o fuse-zip -Llib -L/opt/boxen/homebrew/Cellar/libzip/1.0.1/lib -L/opt/boxen/homebrew/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries main.o -L/usr/local
@rogerhub
rogerhub / sman
Last active Oct 29, 2015
A simple sync manager (depends on rsync, fswatch, python)
View sman
#!/usr/bin/env python2.7
import json
import logging
import multiprocessing
import os
import signal
import socket
import struct
import subprocess