Skip to content

Instantly share code, notes, and snippets.

View conoro's full-sized avatar

Conor O'Neill conoro

View GitHub Profile
@conoro
conoro / cmd_output.go
Created March 18, 2016 20:56
How to see actual command errors in Go when shelling out
package main
import (
"bytes"
"fmt"
"os/exec"
)
func main() {
@conoro
conoro / workers.csv
Last active February 4, 2022 13:01
Simple example single column CSV file
Roger Flopple
Demetrius Levenworth
Salamander Hammerhead
Ferrari Montenegro
Paul Corduroy
Hank Fracas
Ludwig Von Instagram
Lisa Toboggan
Heather Kerfuffle
Rebecca Beretta
@conoro
conoro / cross-compile-go-arm64.md
Created April 23, 2016 16:24
Cross-compiling Golang for ARM64 (aarch64) e.g. Pine64 on Fedora AMD64
  • Install Go for Linux the usual way on your main Linux box:
cd
wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz
tar -zxvf go1.6.2.linux-amd64.tar.gz
sudo mv go /usr/local/
export GOROOT=/usr/local/go
mkdir -p ~/gitwork/go/src
mkdir ~/gitwork/go/bin
@conoro
conoro / storm-test.go
Created May 7, 2016 14:41
Storm Test for YTPodders
package main
import (
"fmt"
"os"
"strings"
"time"
"github.com/SlyMarbo/rss"
"github.com/asdine/storm"
@conoro
conoro / package.json
Created June 22, 2016 14:28
Hello Node
{
"name": "hello-node",
"version": "1.0.0",
"description": "Hello Node",
"main": "server.js",
"dependencies": {
"config-multipaas": "^0.2.2",
"express": "*"
},
"scripts": {
@conoro
conoro / slugify-hugo.go
Created July 10, 2016 09:52
Add a slug field to every post in Hugo to avoid periods and caps in urls
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
"strings"
@conoro
conoro / hexo2hugo.sh
Created July 10, 2016 09:55
Hexo to Hugo converter
# code is from http://helw.net/2015/07/19/migrating-to-hugo-from-hexo/
# Ran fine on Windows 10 with MSysGit installed
# cd to directory with all the md files from Hexo
# bash hexo2hugo.sh
---
# ensure dates don't start with single quotes
for file in *; do awk '{
if ($1 == "date:") {
gsub("\047", "", $0); print;
} else {
{
"createdBy": "[email protected]",
"description": "",
"name": "Maggies Auto Accident Claim Form",
"updatedBy": "[email protected]",
"subscribers": [
"[email protected]"
],
"pageRules": [],
"fieldRules": [],
{
"_id": "55789e363bb743bc298ff517",
"createdBy": "[email protected]",
"name": "MaggiesSummit2015Theme",
"updatedBy": "[email protected]",
"structure": {
"logo": {
"staticCSS": [
{
"key": "background-position",
@conoro
conoro / yunmai_protocol.txt
Created March 28, 2017 14:38 — forked from pwnall/yunmai_protocol.txt
Yunmai smart scale (M1301, M1302, M1303) Bluetooth LE protocol notes
Yunmai smart scale (M1301, M1302, M1303) Bluetooth LE protocol notes
Commands are written to GATT attribute 0xffe9 of service 0xffe5. Responses come
as value change notifications for GATT attribute 0xffe4 of service 0xffe0. These
are 16-bit Bluetooth LE UUIDs, so nnnn is 0000nnnn-0000-1000-8000-00805F9B34FB.
-----
Packet Structure