Skip to content

Instantly share code, notes, and snippets.

View suhlig's full-sized avatar
😻
Happy

Steffen Uhlig suhlig

😻
Happy
View GitHub Profile
@maruel
maruel / Instructions
Created January 2, 2017 03:38
systemd files to enable SPI on startup on a C.H.I.P.
- Create the two files enable_spi.service and enable_spi.timer in /etc/systemd/system/
- Run the following:
sudo systemctl daemon-reload
sudo systemctl enable enable_spi.timer
sudo systemctl start enable_spi
/dev/spidev32766.0 should now be visible.
@foxel
foxel / !haproxy+docker-gen.md
Last active January 23, 2019 11:50
Haproxy + docker-gen hostname routing

What is this?

This gist includes config for haproxy + docker-gen system with routing http requests to different containers based on hostname label.

pre requirements

@colthreepv
colthreepv / Dockerfile
Last active February 6, 2020 06:55
Concourse CI inside Docker compose v2
FROM alpine:latest
RUN apk update && apk upgrade && \
apk add --no-cache \
openssh
RUN mkdir -p /keys/web /keys/worker
CMD ssh-keygen -t rsa -f /keys/web/tsa_host_key -N '' && \
ssh-keygen -t rsa -f /keys/web/session_signing_key -N '' && \
@havenwood
havenwood / brew-ruby-chruby.sh
Last active December 8, 2021 02:47
Install the latest Homebrew precompiled Ruby with the chruby Ruby version switcher.
# Install Homebrew if you haven't already:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install the latest stable Ruby and chruby:
brew install ruby chruby
# Symlink brew Ruby to ~/.rubies where chruby will autodetect it:
mkdir -p "$HOME/.rubies"
ln -s "$(brew --prefix ruby)" "$HOME/.rubies/ruby-$(brew ls --versions ruby | cut -d" " -f2)"
@gurjeet
gurjeet / _my_golang_script.go
Last active March 14, 2022 01:28
GoLang Scripting
//usr/bin/env true; go run `dirname $0`/*.go "$@"; exit $?
package main
import (
"errors"
"os"
)
// TODO: catch Panics and emit a clear message
func main() { os.Exit(mainWithExitCode()) }
@igrr
igrr / ESP8266httpsUpdate.ino
Last active October 30, 2022 14:18
ESP8266 ota over HTTPS
/*
OTA update over HTTPS
As an example, we download and install ESP8266Basic firmware from github.
Requires latest git version of the core (November 17, 2015)
Created by Ivan Grokhotkov, 2015.
This example is in public domain.
*/
require 'apple_id'
# NOTE: in debugging mode, you can see all HTTPS request & response in the log.
# AppleID.debug!
pem = <<-PEM
-----BEGIN PRIVATE KEY-----
:
:
-----END PRIVATE KEY-----
@schmohlio
schmohlio / sse.go
Last active February 13, 2023 08:38 — forked from ismasan/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@Gestas
Gestas / youtube-archive-channels.sh
Created January 6, 2023 22:26
Youtube channel archiver -
#!/bin/sh
#
# Based on the TheFrenchGhosty's Ultimate YouTube-DL Scripts Collection: The ultimate collection of scripts for YouTube-DL
# https://github.com/TheFrenchGhosty/TheFrenchGhostys-Ultimate-YouTube-DL-Scripts-Collection
# Version: 3.2.2
#
STORAGE_PATH="~/youtube/"
SUBSCRIPTIONS_FILE="youtube-subscriptions.lst"
DOWNLOAD_ARCHIVE="downloaded-videos.lst"
LOG_FILE="yt-dlp.log"
# you must also upload the public key as signing key to https://github.com/settings/keys
git config --global user.signingkey '~/.ssh/id_rsa'
git config --global commit.gpgsign true
git config --global gpg.format ssh
# (optional) this file enables `git log --show-signature` and contains email addresses associated with public keys
git config --global gpg.ssh.allowedsignersfile '~/.ssh/git-signers'