This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is meant to be run in a fresh Ubuntu VM. It demonstrates how to | |
# assign Mycelium addresses to Docker containers, from a single Mycelium | |
# instance running on the host. When the script completes, there will be a | |
# container running with a Mycelium address assigned to it. | |
# Install prerequisites | |
apt update && apt install -y wget iproute2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tag=$1 | |
docker_user=$(docker system info | grep 'Username' | cut -d ' ' -f 3) | |
full_tag=${docker_user}/${tag} | |
if [ -f ~/.config/tfhub ]; then | |
tfhub_token=$(cat ~/.config/tfhub) | |
else | |
read -p "Please enter your tfhub token: " tfhub_token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Watch the whole document. | |
const targetNode = document.documentElement; | |
// Not really sure if we're looking for childList or subtree | |
const config = { attributes: true, childList: true, subtree: true }; | |
// It's brute force, but it works. After we do this, all the links actually work | |
// like links, instead of just causing mutations | |
const kill_anchors = () => { | |
var anchors = document.querySelectorAll("a") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
readonly latest_version="v0.16.8" | |
# Ask a yes/no question and return an appropriate exit status | |
yes_no () { | |
read -p "$* (y/n): " answer | |
if [[ $answer == [yY] || $answer == [yY][eE][sS] ]]; then | |
return 0 | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It's a script that prints some stats about the Yggdrasil peers that your local machine is connected to, based partiall on the crawler script from https://github.com/Arceliar/yggdrasil-map. Tells how many peers each of your peers is connected to, how many unique peers there are total, and how many interconnections there are between the peers you've queried. | |
import json, socket, sys, time | |
socktype = socket.AF_UNIX | |
sockaddr = "/var/run/yggdrasil.sock" | |
def getNodeInfoRequest(key): | |
return '{{"keepalive":true, "request":"getNodeInfo", "arguments": {{"key":"{}"}}}}'.format(key) |