Skip to content

Instantly share code, notes, and snippets.

View telent's full-sized avatar

Daniel Barlow telent

View GitHub Profile
@telent
telent / git diff
Created April 10, 2017 20:03
mastdon with https in docker
diff --git a/docker-compose.yml b/docker-compose.yml
index d6ba66d..11a3f73 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,6 +3,8 @@ services:
db:
restart: always
image: postgres:alpine
+ volumes:
+ - ./data/pgdata:/var/lib/postgresql/data
;; this is src/myproject/boot_build.clj
(ns myproject.boot-build
(:require [boot.core :as core]
[cemerick.pomegranate.aether :as aether]
[boot.util :as util]
[boot.pod :as pod]
[clojure.java.io :as io]
[clojure.string :as str]
[cheshire.core :as json]
# something along these lines. we add preConfigure so that python
# doesn't choke with some error about "not a valid wheel file name"
# and we override postInstall not to create the docbook manual
# because it failed and it was easier to do that than fix it
nixopsMaster = lib.overrideDerivation pkgs.nixops (a: rec {
version = "1.6pre1_1675d7a";
name = "nixops-${version}";
# as of this date, no released version of nixops supports
# writing /etc/hosts with the libvirtd backend
class Landmine
def initialize(replaces)
@replaces = replaces
end
def method_missing(n, *args)
raise "#{@replaces} landmine triggered by method #{n}: #{args.join ','}"
end
end
@telent
telent / mipskernel.nix
Created November 22, 2017 00:26
(this doesn't work)
with import <nixpkgs> {
crossSystem = {
system = "mipsel-linux-gnu";
withTLS = true;
platform = {
uboot = null;
name = "malta";
kernelArch = "mips";
kernelBaseConfig = "malta_defconfig";
kernelHeadersBaseConfig = "malta_defconfig";
#include <Adafruit_NeoPixel.h>
#define CW_PIN 5
#define CCW_PIN 6
#define FUNCTION_PIN 9
#define HUE (A1)
#define BRIGHTNESS_POT (A2)
#define STRIP_PIN 2
with import <nixpkgs> {};
let
platform = {
uboot = null;
endian = "big";
name = "yun";
kernelArch = "mips";
gcc = { abi = "32"; } ;
bfdEmulation = "elf32btsmip";
kernelHeadersBaseConfig = "ath79_defconfig";
@telent
telent / push_github_release.rb
Created May 8, 2018 08:29
push github release
#!/usr/bin/env ruby
require 'uri'
require 'net/http'
require 'json'
require 'pathname'
@api_root = URI("https://api.github.com")
remote = `git config --local remote.origin.url`.chomp
@telent
telent / boot.log
Last active June 13, 2018 07:15
Trendnet TEW712BR boot log
reboot: Reÿÿ
U-Boot 1.1.4 (Mar 2 2012 - 15:15:23)
AP121-2MB (ar9330) U-boot
DRAM: 32 MB
Top of RAM usable for U-Boot at: 82000000
Reserving 161k for U-Boot at: 81fd4000
Reserving 192k for malloc() at: 81fa4000
@telent
telent / abstract.md
Last active June 14, 2018 15:38
Nixcon2018 talk proposal

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.