Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Barlow telent

View GitHub Profile
View gist:7c839170a89fe8bee30ee4d992416f32
#include <Adafruit_NeoPixel.h>
#include <math.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "wifi-config.h"
View gist:31b005fcf66606a97ec7f9046d8c229c
#include <Adafruit_NeoPixel.h>
#include <math.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 2
#define STRIP_LENGTH 150
Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, PIN, NEO_GRB + NEO_KHZ800);
View dan.nix
{ pkgs }:
let env = builtins.getEnv "TELENT_NIXPKGS";
telentNixpkgsSrc =
if env != ""
then
(builtins.trace "TELENT_NIXPKGS is set, build is impure" env)
else
fetchTarball { name = "telent-nixpkgs"; url="https://verisons.telent.net/private-git/telent-nixpkgs.git/snapshot/telent-nixpkgs-master.tar.gz"; };
in {
isNormalUser = true;
View cgit.nix
{ config, pkgs, ... }:
let projectroot = "/home/git/"; # where are the repos on the disk?
subdir = "private-git"; # url path prefix
staticFilesPath = "cgit-static"; # url path to cgit's static assets
# /home/git/published-by-cgit contains the list of projects
# that cgit will show
cgitrc = pkgs.writeText "cgitrc"
''
# default paths to static assets
css=/${staticFilesPath}/cgit.css
View configure-firefox.py
#!/usr/bin/env nix-shell
#! nix-shell -i python -p python3
prefs = """
pref("toolkit.policies.perUserDir", true);
pref("ui.key.accelKey", 18);\n', # use Alt instead of Ctrl
"""
policies = {
"policies": {
@telent
telent / iso.nix
Created Nov 29, 2019
nix livecd with "blocks" support for in-place bcache addition
View iso.nix
{config, pkgs, lib, ...}:
let
maintboot = pkgs.python3Packages.buildPythonPackage rec {
pname = "maintboot";
version = "1";
src = pkgs.fetchFromGitHub {
owner = "g2p";
repo = "maintboot";
rev = "1c5ab872bae2b69a06252ca2e7ecdba4d4ad8e57";
sha256 = "0n8sy6ksqb5s1n5qqshb6pz1d86gjshwb30mr1nil0hfln5gi4g2";
@telent
telent / default.nix
Created Nov 28, 2018
arcan build with nixos
View default.nix
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "arcan";
version="1";
src = ./.;
nativeBuildInputs = with pkgs; [
cmake git
] ;
CMAKE_CXX_FLAGS = "-msse4.1";
DRM_INCLUDE_DIR = "${pkgs.libdrm.dev}/include/libdrm";
View ralink-dtb.patch
View ilo.ino
#define RELAY_PIN (8)
void setup() {
// put your setup code here, to run once:
SERIAL_PORT_USBVIRTUAL.begin(115200); // open serial connection via USB-Serial
pinMode(RELAY_PIN, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
@telent
telent / abstract.md
Last active Jun 14, 2018
Nixcon2018 talk proposal
View abstract.md

Title

NixWRT: purely functional firmware images for IoT devices

Abstract

Reflashing your broadband router with Linux (DD-WRT or OpenWRT or Tomato or variants) gives you unparalleled flexibility to do things that the manufacturer probably hadn't thought of. Remembering what you did, six months later, is often trickier.

You can’t perform that action at this time.