Skip to content

Instantly share code, notes, and snippets.

Daniel Barlow telent

Block or report user

Report or block telent

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@telent
telent / gist:9742059
Last active Aug 3, 2019
12 factor app configuration vs leaking environment variables
View gist:9742059
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
@telent
telent / polar.rb
Created Apr 26, 2012
Interface with a polar bluetooth hrm from ruby (linux)
View polar.rb
require 'pp'
require 'socket'
module BluetoothPolarHrm
AF_BLUETOOTH=31 # these are correct for the Linux Bluez stack
BTPROTO_RFCOMM=3
class << self
def connect_bt address_str,channel=1
bytes=address_str.split(/:/).map {|x| x.to_i(16) }
s=Socket.new(AF_BLUETOOTH, :STREAM, BTPROTO_RFCOMM)
View boot_build.clj
;; 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]
@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";
@telent
telent / sagepay-admin.rb
Created Nov 4, 2010
Talking to Sagepay Reporting & Admin API from Ruby
View sagepay-admin.rb
require 'patron'
require 'time'
require 'active_support/core_ext/hash.rb'
require 'digest/md5'
require 'nokogiri'
module SagePay;end
class SagePay::Admin
def initialize(args)
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.

@telent
telent / boot.log
Last active Jun 13, 2018
Trendnet TEW712BR boot log
View 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
View push_github_release.rb
#!/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
You can’t perform that action at this time.