Skip to content

Instantly share code, notes, and snippets.

@cbluth
cbluth / Nginx-blackhole
Created May 12, 2017 18:29 — forked from ftischhauser/Nginx-blackhole
Nginx as a blackhole server for PAC based ad blockers
server {
# Listen on port 9123. Change to your liking and remove 'deferred' if unsupported on your OS.
listen [::]:9123 ipv6only=off deferred;
# We don't need to log these proxy requests.
access_log off;
# Let browsers cache our responses.
expires max;
location / {
# Return an empty gif for all requests.
empty_gif;
@cbluth
cbluth / bash_ipfs_memory_logger.sh
Last active September 21, 2017 03:55 — forked from leerspace/bash_ipfs_memory_logger.sh
bash script for logging ipfs daemon memory utilization, repo size, and peer count
#/bin/bash
while sleep 1; do
# get process id for ipfs daemon
output=`ps aux | grep "ipfs daemon" | grep -v grep`
set -- $output
pid=$2
# get timestamp
timestamp=$(date +%s)
# get process memory usage in kilobytes
@cbluth
cbluth / ipfs.yml
Created September 29, 2017 23:14 — forked from kordless/ipfs.yml
Deploy IPFS on Kubernetes
apiVersion: v1
kind: Service
metadata:
name: ipfs
spec:
type: NodePort
ports:
- name: ipfs
port: 8080
targetPort: 8080
@cbluth
cbluth / SMBDIS.ASM
Created October 18, 2017 16:46 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@cbluth
cbluth / stream_to_youtube.sh
Last active November 3, 2017 03:37 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@cbluth
cbluth / arch-linux-install
Last active December 5, 2017 19:14 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@cbluth
cbluth / main.go
Created January 7, 2018 17:48 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@cbluth
cbluth / https.go
Created January 7, 2018 17:58 — forked from kennwhite/https.go
Simple https http/2 static web server with HSTS & CSP (A+ SSLLabs & securityheaders.io rating) in Go using LetsEncrypt acme autocert
package main
import (
"crypto/tls"
"golang.org/x/crypto/acme/autocert"
"log"
"net"
"net/http"
)
@cbluth
cbluth / vineScrape.go
Created March 31, 2018 22:36 — forked from cryptix/vineScrape.go
extract a javascript object value from a html page using goquery and otto
package main
import (
"errors"
"log"
"os"
"github.com/PuerkitoBio/goquery"
"github.com/robertkrimen/otto"
)
@cbluth
cbluth / Loader_1_0_0.idc
Created April 28, 2018 10:12 — forked from SciresM/Loader_1_0_0.idc
IDCs for the Nintendo Switch's "Loader" sysmodule.
This file has been truncated, but you can view the full file.
#define UNLOADED_FILE 1
#include <idc.idc>
static main(void)
{
// set 'loading idc file' mode
set_inf_attr(INF_GENFLAGS, INFFL_LOADIDC|get_inf_attr(INF_GENFLAGS));
GenInfo(); // various settings
Segments(); // segmentation
Enums(); // enumerations