Skip to content

Instantly share code, notes, and snippets.

View cransom's full-sized avatar

Casey Ransom cransom

View GitHub Profile
#include <ESP8266WiFi.h>
#include <ESP8266httpUpdate.h>
#include <PubSubClient.h>
// OTA Firmware Version
const char* VERSION = "Remote_Control_Switch_Module_MQTT.bin_v0.000";
// gpio info
Building native extensions with: '--with-xml2-config=/nix/store/7900k6sfgwrpqmhgj27c1234l57kqj7z-libxml2-2.9.4-bin/bin/xml2-config --with-xslt-config=/nix/store/r09ik1avdwifxnrrghyc483j04aafzk6-libxslt-1.1.29-bin/bin/xslt-config'
import <nixpkgs/nixos/tests/make-test.nix> {
nodes = {
testvm =
{ config, lib, pkgs, ... }:
let
CacheMemcachedlibmemcached = buildPerlPackage rec {
name = "Cache-Memcached-libmemcached-0.04001";
src = fetchurl {
#overlay for gitless.
self: super:
let
inherit (super) fetchFromGitHub pythonPackages stdenv;
in
{
#{ fetchFromGitHub, pythonPackages, stdenv }:
gitless = super.pythonPackages.buildPythonApplication rec {
{ repoPrs, writeText }:
let
inherit (builtins) fromJSON toJSON readFile attrNames map;
prs = fromJSON (readFile repoPrs);
nixpkgs = (import ../etc/lib/version.nix);
prIds = attrNames prs;
genJobSet = id:
let
info = prs."${id}";
#!/usr/bin/env bash
awk 'function wl() {
rate=64000;
return (rate/160)*(0.87055^(int(rand()*10)))};
BEGIN {
srand();
wla=wl();
while(1) {
wlb=wla;
wla=wl();
@cransom
cransom / log.txt
Last active March 11, 2018 04:34
pipe speeds
143yoga:~% timeout 1 cat /dev/zero | mbuffer -q -l cat.txt -o /dev/null
zsh: exit 124 timeout 1 cat /dev/zero |
zsh: mbuffer -q -l cat.txt -o /dev/null
143yoga:~% timeout 1 mbuffer -q -l native.txt -i /dev/zero -o /dev/null
124yoga:~% tail -n 1 cat.txt native.txt
==> cat.txt <==
mbuffer: in @ 1140 MiB/s, out @ 1140 MiB/s, 799 MiB total, buffer 0% full
==> native.txt <==
mbuffer: in @ 1995 MiB/s, out @ 1995 MiB/s, 1398 MiB total, buffer 0% full
#!/usr/bin/env bash
if type nix-shell >/dev/null && [ -z "${IN_NIX_SHELL}" ]; then
exec nix-shell -p hello --run "${0} $@"
fi
hello
services.openvpn.servers.example = {
config = someconfighere;
autoStart = true;
up = ''
echo nameserver $nameserver | ${pkgs.openresolv}/bin/resolvconf -a $dev
'';
down = ''
echo nameserver $nameserver | ${pkgs.openresolv}/bin/resolvconf -d $dev
'';
};
#!/usr/bin/env nix-shell
#!nix-shell -p python27Packages.pygobject3 python27Packages.pygtk -i python
URL="http://git.alsa-project.org/?p=alsa.git;a=blob_plain;f=hda-analyzer/"
FILES=["hda_analyzer.py", "hda_guilib.py", "hda_codec.py", "hda_proc.py",
"hda_graph.py", "hda_mixer.py"]
try:
import gobject
import gtk