Skip to content

Instantly share code, notes, and snippets.

View ginjo's full-sized avatar

William Richardson ginjo

View GitHub Profile
@ginjo
ginjo / convert_rpp_to_yaml.sh
Last active August 17, 2022 11:23
Convert Reaper file (.rpp) to YAML
### Converts Reaper data file (.rpp) to YAML, using Awk.
### All scalar values will be enclosed in single quotes.
###
### Usage: (with standard input) cat <reaper-data-file.rpp> | <this-script-file>
### (with filename as first arg) <this-script-file> <reaper-data-file.rpp>
###
### Returns: formatted YAML document
###
### Example usage with yq (shell-based yaml parser):
###
@arkadiyt
arkadiyt / token.rb
Last active January 12, 2023 20:01
Generate signed tokens in ruby
require 'base64'
require 'json'
require 'openssl'
require 'time'
def secure_compare(a, b)
return false unless a.bytesize == b.bytesize
l = a.unpack "C#{a.bytesize}"
@tylerchr
tylerchr / Dockerfile
Created July 21, 2018 01:37
Compiling V8 for alpine (link against musl)
#
# Building V8 for alpine is a real pain. We have to compile from source, because it has to be
# linked against musl, and we also have to recompile some of the build tools as the official
# build workflow tends to assume glibc by including vendored tools that link against it.
#
# The general strategy is this:
#
# 1. Build GN for alpine (this is a build dependency)
# 2. Use depot_tools to fetch the V8 source and dependencies (needs glibc)
# 3. Build V8 for alpine
@heri16
heri16 / user-data.txt
Created April 5, 2017 04:04
Docker-CE Cloud-init for Ubuntu 16.04 (LTS)
#cloud-config
# Upgrade the instance on first boot
# (ie run apt-get upgrade)
#
# Default: false
# Aliases: apt_upgrade
package_upgrade: true
# Install additional packages on first boot
@elcritch
elcritch / gist:95e1a62e7b6974768823ce4128584ea6
Created April 19, 2016 01:42
Upload to Box via WebDav using cURL
curl -u me@email.com:mypassword -T local_file_path https://dav.box.com/dav/remote_file_name
curl -u me@email.com:mypassword https://dav.box.com/dav/remote_file_name --output download_file_path
require 'dry-types'
class Carrier
attr_reader :name
def initialize(attributes)
@name = attributes.fetch(:name)
end
end
@shmup
shmup / torrents.md
Last active May 15, 2024 09:31
transmission blocklist guide

Transmission Blocklist

The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.

It's as simple as downloading and installing the latest client:

@thecodingmonkey-zz
thecodingmonkey-zz / docker-size.sh
Created December 11, 2015 11:52
List all docker containers + volume sizes
#!/bin/sh
for d in `docker ps -a | awk '{print $1}' | tail -n +2`; do
d_name=`docker inspect -f {{.Name}} $d`
echo "========================================================="
echo "$d_name ($d) container size:"
sudo du -d 2 -h /var/lib/docker/aufs | grep `docker inspect -f "{{.Id}}" $d`
echo "$d_name ($d) volumes:"
@CMCDragonkai
CMCDragonkai / socat_server.sh
Last active August 6, 2021 22:03
Socat Simple HTTP Server #cli #network
socat \
-v -d -d \
TCP-LISTEN:1234,crlf,reuseaddr,fork \
SYSTEM:"
echo HTTP/1.1 200 OK;
echo Content-Type\: text/plain;
echo;
echo \"Server: \$SOCAT_SOCKADDR:\$SOCAT_SOCKPORT\";
echo \"Client: \$SOCAT_PEERADDR:\$SOCAT_PEERPORT\";
"
@ramn
ramn / socat_http_echo_server.sh
Last active September 26, 2023 12:22
Socat HTTP echo server
#!/bin/bash
socat -v -T0.05 tcp-l:8081,reuseaddr,fork system:"echo 'HTTP/1.1 200 OK'; echo 'Connection: close'; echo; cat"