- c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
- Ubuntu 18.04
- Go 1.12
- Python 2.7
- Vips 8.7.4
This file contains 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 http = require('http'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var AUDIOFILE = "./audio.ogg"; | |
function serveWithRanges(request, response, content) { | |
var range = request.headers.range; | |
var total = content.length; | |
var parts = range.replace(/bytes=/, "").split("-"); |
This file contains 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
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}" | |
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH014OJ1", SYMLINK+="arduino/trduino_nano" | |
SUBSYSTEMS=="usb", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0042", SYMLINK+="sensors/cdc_%s{serial}" | |
SUBSYSTEMS=="usb", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0042", ATTRS{serial}=="741333534373512190A1", SYMLINK+="arduino/arduino_mega2560" |
This file contains 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 | |
import sys | |
import os | |
import json | |
import argparse | |
import collections | |
__description__ = """Ansible Dynamic Inventory for Terraform.""" | |
__epilog__ = """ |
This file contains 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
import sh | |
import re | |
evtest = sh.evtest("/dev/input/event9", _bg=True) | |
cur_slot = 0 | |
slots = [0] * 10 | |
tools = set() | |
slots.append(tools) |
This file contains 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
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="AB Shutter3 ", TAG+="systemd", PROGRAM="/bin/systemd-escape -p --template=lifx-remote@.service $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c" |
This file contains 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
import { Injectable } from '@angular/core'; | |
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; | |
import { Observable, timer, throwError, of } from 'rxjs'; | |
import { retryWhen, tap, mergeMap } from 'rxjs/operators'; | |
@Injectable() | |
export class HttpRequestInterceptor implements HttpInterceptor { | |
retryDelay = 2000; | |
retryMaxAttempts = 2; |
This gist will show how to setup a generic SBC Debian / Ubuntu install as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.
This is forked from another gist specific to the Raspberry Pi on Stretch. A required package isn't in Ubuntu's repos, so in this gist we build it from scratch.
Tested to be working on Armbian/Ubuntu/Debian images of the Orange Pi Zero, ODROID XU4, ODROID N2, and Atomic Pi.
This file contains 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
# Please follow https://gist.github.com/MakiseKurisu/3a44918bccf3383c0b5ccf362f429c8b first to set up rootfs | |
# Assuming rootfs on /dev/sdb2, and adding /dev/sda to the RAID-1 configuration | |
# Remove existing Proxmox installation and LVM Thin storage | |
pvesm remove local-lvm | |
vgremove pve -y | |
# Set up partition table | |
(echo g; echo n; echo ''; echo ''; echo '+512M'; echo t; echo 1; echo n; echo ''; echo ''; echo ''; echo w) | fdisk /dev/sda |