package main | |
import ( | |
"crypto/tls" | |
"fmt" | |
) | |
// go build && strace -o strace-out.txt -f -e trace=file ./simpleget | |
func main() { | |
conn, err := tls.Dial("tcp", "www.google.com:443", nil) |
No guarantees any of this is secure or the right way to do things, I'm using this 90% for
https://linode.com/docs/web-servers/nginx/use-nginx-reverse-proxy/
For certs/https: https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx
// This took me way too long to figure out. | |
// Needs node 8.4.0 or greater to work (I think, based on https://github.com/nodejs/node/issues/7593#issuecomment-322966866) | |
// The magic sauce here is that react-scripts-ts/scripts/test.js creates an inline jest config | |
// that it passes through. This does things like map css files properly, so if you try to use | |
// jest directly then it won't work. | |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ |
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
var createHash = require('crypto').createHash; | |
suite.add('md2', () => { | |
createHash('md2').update('HELLO WORLD').digest('hex'); | |
}) | |
.add('md4', () => { |
You have a large audio file that has been split into multiple mp3s.
You want to merge these and convert to a m4a (optional) so that you can use it with https://github.com/scottopell/audiobook-podcast
# Combine MP3s
ffmpeg -i "concat:$(ls *.mp3 | tr '\n' '|')" -acodec copy out.mp3
DirectTV Now added a FreeVIEW thing where you can watch some tv shows for free, but they don't show you only the shows that are available on "FreeVIEW", because that would be too convenient.
Luckily, they helpfully mark these subscriber only shows with a badge on the /watch/shows
endpoint.
Here's a bookmarklet to hide the subscriber only shows.
javascript:document.querySelectorAll("[data-label='SUBSCRIBE']").forEach( (el) => { el.parentNode.parentNode.parentNode.parentNode.style.display = 'none'; });
Zsh has a feature called zpty which creates a pseudo-terminal in the background.
According to the docs, this can be useful to run a program in the background that expects to be run in a normal terminal environment.
Some zsh themes such as pure use this to run commands asynchronously. Pure uses the zsh plugin zsh-async for this.
I always forget these steps and have to google for them, even though they're super simple
Prereq:
pip install gsutil
gsutil config
, have your project id ready.
tar --create --verbose --xz --file images.tar.xz /directory/containing/images/*
gsutil cp images.tar.xz gs://<bucket name>