Skip to content

Instantly share code, notes, and snippets.

Avatar

Casey Ransom cransom

View GitHub Profile
@cransom
cransom / typecover.patch
Created Jul 19, 2015
bad hack just to get a newer version of typer cover working.
View typecover.patch
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index b04b082..9d89c56 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -663,7 +663,7 @@
#define USB_DEVICE_ID_MS_SURFACE_PRO_2 0x0799
#define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7
#define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9
-#define USB_DEVICE_ID_MS_TYPE_COVER_3 0x07dc
+#define USB_DEVICE_ID_MS_TYPE_COVER_3 0x07e2
View gist:e3dffea5ab33c6f06db1
nixpkgs.config.packageOverrides = pkgs: {
linux_4_1 = pkgs.linux_4_1.override {
kernelPatches = [
{ patch = /etc/nixos/mt-41.patch; name = "mt-41"; extraConfig = "I2C_DESIGNWARE_PLATFORM m"; }
{ patch = /etc/nixos/buttons-41.patch; name = "buttons-41"; }
{ patch = /etc/nixos/Add-Microsoft-Surface-Pro-3-camera-support.patch; name = "surfcam-41"; }
];
};
};
View keybase.md

Keybase proof

I hereby claim:

  • I am cransom on github.
  • I am cransom (https://keybase.io/cransom) on keybase.
  • I have a public key ASA3C1YF14LYSGeeA_IKuzvgXm4VSJRx34toKeHHkN5nKQo

To claim this, I am signing this object:

@cransom
cransom / default.nix
Last active Apr 5, 2016
bundling bcc in nixos
View default.nix
{ pkgs
, linux
, clang
, cmake
, llvm
, bison
, flex
, iperf
, python
, llvmPackages
View configuration.nix
boot.kernelPackages = pkgs.linuxPackages_4_6;
nixpkgs.config.packageOverrides = pkgs: {
linux_4_6 = pkgs.linux_4_6.override {
kernelPatches = [
{ patch = ./linux-surfacepro3/wifi.patch; name = "wifi"; }
{ patch = ./linux-surfacepro3/change-default-console-loglevel.patch; name = "loglevel"; }
{ patch = ./linux-surfacepro3/multitouch.patch; name = "multitouch"; }
{ patch = ./linux-surfacepro3/touchscreen_multitouch_fixes1.patch; name = "touchscreen1"; }
{ patch = ./linux-surfacepro3/touchscreen_multitouch_fixes2.patch; name = "touchscreen2"; }
];
View systemctl.txt
[root@router-ogre-cransom-834032d-dev-0:/etc/systemd/system/systemd-timesyncd.service.d]# status systemd-timedated
● systemd-timedated.service - Time & Date Service
Loaded: loaded (/nix/store/vhmfyv475ixsgpnar0a9qi6i3xik7rmg-systemd-229/example/systemd/system/systemd-timedated.service; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2016-06-27 18:03:18 UTC; 34min ago
Docs: man:systemd-timedated.service(8)
man:localtime(5)
http://www.freedesktop.org/wiki/Software/systemd/timedated
Process: 3146 ExecStart=/nix/store/vhmfyv475ixsgpnar0a9qi6i3xik7rmg-systemd-229/lib/systemd/systemd-timedated (code=exited, status=1/FAILURE)
Main PID: 3146 (code=exited, status=1/FAILURE)
View default.nix
let
# Imports
nixpkgs = import <nixpkgs> {};
inherit (nixpkgs) lib;
inherit (lib) mapAttrs fix extends;
# Helpers
makeExtendable = base:
fix base // {
extend = f: makeExtendable (extends f base);
View hostalive.sh
#!/usr/bin/env nix-shell
#!nix-shell -p fping -i bash
while true; do
arp -an | grep -v incomplete | cut -f2 -d" "| egrep -o '[0-9]+.[0-9]+.[0-9]+.[0-9]+' | sudo fping -C 30 -D -n -r 0 | tr -d '[]()' | awk '{ print $1, $2, $7 }' |
while read -e line; do
ts=$(echo $line | awk '{ print $1 }' | tr -d '.')000
host=$(echo $line | awk '{ print $2 }' | tr . _ )
ms=$(echo $line | awk '{ print $3 }' )
View fuckyouvagrant.nix
# This allows a user to run nix-shell in the tech repo and then all
# of their system dependencies will be handled. More info on NixOS:
# https://nixos.org/
# http://nixos.org/nix/manual/#sec-nix-shell
{ pkgs ? import <nixpkgs> {}
}:
(pkgs.buildFHSUserEnv {
name = "ihatevagrant";
You can’t perform that action at this time.