Skip to content

Instantly share code, notes, and snippets.

@lg
lg / adding-tailscale-to-edgerouter.md
Last active April 11, 2024 07:44
Add tailscale to an EdgeRouter and surviving system upgrade

Adding tailscale to an EdgeRouter (and surviving system upgrades)

I suggest you run sudo bash on all of these so you're the root user.

Installing

  1. Download tailscale and put the files in /config/. Find the latest stable or unstable version for your EdgeRouter's processor (ex. ER4 is mips and ERX is mipself)
sudo bash    # if you havent already
@BenWoodford
BenWoodford / LeafAPI.md
Last active November 22, 2023 21:51
New Nissan Connect EV API

Late 2018 Update

I am no longer working on this as the new API is US-only as I'm in the UK, so cannot even use it or the new app. Please don't ask me questions about it as I honestly can't remember anything.

Nissan Connect EV 2018 API

This is a work in progress, just jotting down my findings from the APK decompile so far. As I can only read the decompiled Java and not MITM the app due it not working in the UK, getting the payload info may take a while. There's loads of API calls so this may not be thorough for a while.

Base URL: https://icm.infinitiusa.com/NissanLeafProd/rest

@taylorhughes
taylorhughes / uploader.go
Last active July 26, 2022 14:00
A lightly modified excerpt from Cluster's streaming media upload server, which encodes video on the fly as it is uploaded.
func EncodeStreamingVideo(streamingFile io.Reader, request ShouldCanceler) (*os.File, error) {
outputFilename := generateFilename("mp4")
// Actually start the command.
cmd := exec.Command("ffmpeg",
// Read input from stdin.
"-i", "-",
// ... environment-specific ffmpeg options ...
"-y", outputFilename)
@adharris
adharris / postgres_array.go
Created November 28, 2012 19:52
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@sauloarruda
sauloarruda / receipt
Created April 30, 2012 15:47
Apple iOS in app purchase validate receipt in Ruby
ewoJInNpZ25hdHVyZSIgPSAiQXBNVUJDODZBbHpOaWtWNVl0clpBTWlKUWJLOEVk
ZVhrNjNrV0JBWHpsQzhkWEd1anE0N1puSVlLb0ZFMW9OL0ZTOGNYbEZmcDlZWHQ5
aU1CZEwyNTBsUlJtaU5HYnloaXRyeVlWQVFvcmkzMlc5YVIwVDhML2FZVkJkZlcr
T3kvUXlQWkVtb05LeGhudDJXTlNVRG9VaFo4Wis0cFA3MHBlNWtVUWxiZElWaEFB
QURWekNDQTFNd2dnSTdvQU1DQVFJQ0NHVVVrVTNaV0FTMU1BMEdDU3FHU0liM0RR
RUJCUVVBTUg4eEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUtEQXBCY0hCc1pT
QkpibU11TVNZd0pBWURWUVFMREIxQmNIQnNaU0JEWlhKMGFXWnBZMkYwYVc5dUlF
RjFkR2h2Y21sMGVURXpNREVHQTFVRUF3d3FRWEJ3YkdVZ2FWUjFibVZ6SUZOMGIz
SmxJRU5sY25ScFptbGpZWFJwYjI0Z1FYVjBhRzl5YVhSNU1CNFhEVEE1TURZeE5U
SXlNRFUxTmxvWERURTBNRFl4TkRJeU1EVTFObG93WkRFak1DRUdBMVVFQXd3YVVI
@blister
blister / gist:740829
Created December 14, 2010 18:19
Bash script to add a delay to the localhost interface on Linux machines
#!/bin/bash
# Copyright 2010 Eric Ryan Harrison <me@ericharrison.info>
# Inspired by:
# http://daniel.haxx.se/blog/2010/12/14/add-latency-to-localhost/
if [ -n "$1" ]
then
if [ "$1" = "off" ]
then
tc qdisc del dev lo root