Text of gist.github.com › milesrichardson as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

milesrichardson’s gists · GitHub

Skip to content Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Instantly share code, notes, and snippets. 👁️ Miles Richardson Miles Richardson milesrichardson 👁️ Miles Richardson founder at @splitgraph , acquired by @EnterpriseDB where I am now Senior Director, Product Management (but I still code sometimes!) 136 followers · 89 following @splitgraph https://www.splitgraph.com View GitHub Profile Recently created Least recently created Recently updated Least recently updated 1 file 3 forks 6 comments 47 stars milesrichardson / open-vlc-m3u8-url-with-http.md Created July 10, 2024 21:50 How to use VLC to watch m3u8 playlist at URL with custom HTTP referrer and user agent Imagine this: it's Sunday afternoon at 1pm, and you want to watch some live content.

But you don't have a TV subscription. So you do a little Googling, and eventually you find yourself on a sketchy website where you can watch the content you're looking for. But while the website has a video player, it's surrounded by advertisements, and probably a cryptominer too. You don't want this website eating your CPU for 2 hours while you're watching your favorite Sunday afternoon content. Wouldn't it be nice if you could watch that video in VLC instead?

Then you can close the sketchy website and still watch your content. It's like having your cake and taking a bite of it too! Here's how you do it: Capture the m3u8 request in dev tools. Open the site (or just the iframe, if possible) in DevTools and click "play." Search the network tab for m3u8 and grab the first request. Run VLC with command line flags to set the User Agent and Referrer. From the request body, you need to copy the requested URL, 2 files 0 forks 0 comments 4 stars milesrichardson / result.md Created November 16, 2023 12:51 OpenAI generated this code from a UX mockup at https://makereal.tldraw.com/ We couldn’t find that file to show.

1 file 4 forks 2 comments 26 stars milesrichardson / inherit_environment_variables_from_pid_1.md Created January 21, 2023 07:35 inherit environment variables from PID 1 You can inherit the environment variables from PID 1 by iterating over the list of null-terminated strings in /proc/1/environ , parsing the first characters up to the first = as the variable name, setting the remaining value as that variable, and exporting it.

The Code Snippet This works with multiline environment variables, and environment variables with arbitrary values, like strings, including = or JSON blobs. Paste this in your current terminal session to inherit the environment variables from PID 1: 1 file 1 fork 1 comment 5 stars milesrichardson / wireshark-remote-capture-ssh-docker.md Last active October 15, 2025 16:28 bash command to open wireshark and capture packets in a remote docker container on a remote machine over SSH capture those packets run this command on local machine where wireshark is installed (e.g.

MacOS) export raw_pcap= " $( mktemp -t pcap-raw ) " ; \ echo " Raw pcap: $raw_pcap " ; \ wireshark -k -i <( ssh ubuntu@my-cool-server.example.com ' \ docker run --rm \ --net container:$(docker ps -qf name=haproxy) \ 1 file 0 forks 0 comments 0 stars milesrichardson / generate-wireguard-peer.py Created August 2, 2022 21:37 Python script to create random wireguard peer by calling`wg genkey`, `wg pubkey` and `wg genpsk` with `subprocess` module # Hopefully it saves you a few minutes looking at the subprocess docs import os import subprocess env = os . environ . copy () private_key = ( subprocess . run ( [ "wg" , "genkey" ], 1 file 0 forks 0 comments 0 stars milesrichardson / restart_spotify.sh Created May 17, 2020 01:00 "Spotify cannot play the current song" - So restart it! (restart spotify from mac command line) #! /usr/bin/env bash # I got sick of constantly getting the error from spotify that it cannot play # the current song.

It was really annoying to have to quit, open spotlight, # Type "spot" and accidentally open spotlight system preferences, wait for spotify # to open, etc... # This script, on a mac, uses osascript to quit and relaunch spotify and press play osascript -e ' tell application "Spotify" to quit ' 1 file 0 forks 0 comments 0 stars milesrichardson / FixTmuxWeirdCharacters.md Last active November 5, 2019 17:03 How to stop weird characters being inserted on paste in tmux ChrisJohnsen/tmux-MacOSX-pasteboard#31 (comment) What happens if you paste (in a pane where you see the problem) while running cat -v?

Do you see something like ^[[200~hello world^[[201~? If so, what you are seeing is bracketed paste mode. You should be able to turn the mode off by running printf '\e[?2004l' 1 file 0 forks 1 comment 1 star milesrichardson / HowToKeepGitHubForkUpToDateWithGitLabMirroring.md Created October 23, 2019 18:46 How to keep GitHub forks up to date by leveraging GitLab repository mirroring to and from GitHub What you want A public fork of a public GitHub repository, say facebook/react A private fork of the same public GitHub repository Keep both forks always up to date with all branches of the upstream facebook/react repository Selectively publish branches from the private fork to the public fork in order to submit pull requests to facebook/react What you need A GitHub account 1 file 0 forks 0 comments 1 star milesrichardson / find_symbol.sh Created October 22, 2019 16:45 Function for finding where missing symbol is defined # Usage: find_symbol _ZN6icu_608ByteSinkD2Ev # Output list of files on system where given symbol exists # Symbol should be formatted as given by output of ldd -r find_symbol() { local symbol="$1" shift while read -r filename ; do readelf -Ws "$filename" 2>/dev/null | grep "$symbol" && echo "$filename" ; done < <(find / -type f -name '*.so' -o -name '*.bc' -o -name '*.a') 1 file 0 forks 0 comments 0 stars milesrichardson / docker_host_vm_shell.sh Created October 16, 2019 02:17 Get shell in docker host VM on mac docker run -it --rm --privileged --pid=host justincormack/nsenter1 Newer Older You can’t perform that action at this time.