This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copy everything up intil resin-data (mmcblk0p6 usually) | |
# and send it over the ssh connection, compressed | |
DEVICE=/dev/mmcblk0 | |
PARTITION=mmcblk0p5 | |
# Get partition end position in blocks | |
FSSIZE=$(/sbin/fdisk -l -o Device,End ${DEVICE} | grep ${PARTITION} | awk '{ print $2 }') | |
# Copy data, compress, and send over STDOUT | |
/bin/dd if=/dev/mmcblk0 conv=sync,noerror bs=512 status=none count=${FSSIZE} | gzip -c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o pipefail | |
# Help function | |
function update-resin-supervisor-help { | |
cat << EOF | |
Wrapper to run supervisor agent updates on resin distributions. | |
$0 <OPTION> | |
Options: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCa2kIKfTdOWTX99jUNw0gGHEBguyJE5F6NDfLpsjCLvQn0WZ9TEUS+WQy9a348yg3LwAAwtevu6pSTPpiWDUtaA/xjcDD/mxzCVRsqkJoM48RrFW594qI5c8Z/GsQJTXq7NI+ViyjznIETPtVk9bXCMikGyQ1yD/RnbBMBlRlraQFrltu1vzWe7Bm+6VSFBcb82MmuqomppOkZmH9N+7K1FSh+WJz+nB0c0nivTbsCHtIKiRq/ttu06odhr/DY0d6RXxJLP54azKRah9AjqH/6vVFJaRF7Pai4C5+9NtOYhU7/xLhpORUsgqtW1yzbKHCreI5XvzbWlRRJEtmubprb greg@nostromo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Python `hand-over` strategy example | |
""" | |
import os | |
import sys | |
import socket | |
SOCKFILE = "/tmp/handover.sock" | |
# Check for this script already running |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# From http://unix.stackexchange.com/questions/72216/fast-way-to-randomize-hd | |
DISK="/dev/sda" | |
SIZE=`fdisk -l | grep "${DISK}" | awk '{print $5}'` | |
echo "Erasing ${DISK} (size ${SIZE} bytes)" | |
read -p "Are you sure? " -n 1 -r | |
echo # (optional) move to a new line | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AUTOBAHN_DEBUG = true; | |
var https = require('https'); | |
https.globalAgent.options.rejectUnauthorized = false; | |
var autobahn = require('autobahn'); | |
var connection = new autobahn.Connection({ | |
url: 'wss://ingest.epeakgears.com:1337/ws' | |
, realm: 'xyala' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <Adafruit_MAX31855.h> | |
// Example creating a thermocouple instance with hardware SPI (Uno/Mega only) | |
// on a given CS pin. | |
#define CS1 2 | |
#define CS2 3 | |
Adafruit_MAX31855 th1(CS1); | |
Adafruit_MAX31855 th2(CS2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Leasure vs Money | |
Inspiration | |
Tweet by Stanford Econ Policy https://twitter.com/SIEPR/status/702637668883152896 | |
Data sources | |
* GDP per capita PPP: : World Bank http://data.worldbank.org/indicator/NY.GDP.PCAP.PP.CD?display=default | |
* GDP per capita current USD: World Bank http://data.worldbank.org/indicator/NY.GDP.PCAP.CD/countries?display=default | |
* Working hours: OECD.stat https://stats.oecd.org/Index.aspx?DataSetCode=ANHRS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Gergely Imreh <[email protected]> | |
pkgname=pps-tools-git | |
pkgver=r17.0deb9c7 | |
pkgrel=1 | |
pkgdesc="User-space tools for LinuxPPS and kernel header" | |
arch=('armv7h') | |
url="https://github.com/ago/pps-tools" | |
license=('GPL2') | |
groups=() | |
depends=() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var autobahn = require('autobahn'); | |
var connection = new autobahn.Connection({ | |
url: 'ws://octv-versus.ddns.net:8080/ws', | |
realm: 'octv1'} | |
); | |
connection.onopen = function (session) { | |
// SUBSCRIBE to a topic and receive events |