Skip to content

Instantly share code, notes, and snippets.

@Ravenstine
Ravenstine / how-to-run-yggdrasil-in-docker.md
Created September 29, 2023 20:48
How To Run Yggdrasil In Docker

How To Run Yggdrasil In Docker

Want to run Yggdrasil in a Docker container? This is how you can do it.

The keys to getting it working are the following:

  • Give the container access to the TUN interface of the host (or the VM guest in the case of Docker Machine or Docker for Mac)
  • Enable IPv6
  • Assign a dedicated MAC address
const { ethers } = require('ethers');
const provider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed.binance.org/');
const BEP20 = {
BUSD: '0xe9e7cea3dedca5984780bafc599bd69add087d56',
DOP: '0x844fa82f1e54824655470970f7004dd90546bb28',
};
const Contract = {
router: new ethers.Contract(
@tonytonyjan
tonytonyjan / multipart.lua
Created August 26, 2020 08:07
wrk file upload example
function read_file(path)
local file, errorMessage = io.open(path, "rb")
if not file then
error("Could not read the file:" .. errorMessage .. "\n")
end
local content = file:read "*all"
file:close()
return content
end
@kapong
kapong / cuda.sh
Last active July 13, 2020 12:25
CUDA Ubuntu Install
#!/bin/bash
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
apt-get update
apt-get -y install cuda
@miticojo
miticojo / k8s-centralized-logging.yaml
Last active October 21, 2019 09:43
K8S - Centralized logging with ELK and Fluentd (kubernetes >= 1.6)
apiVersion: v1
kind: ServiceAccount
metadata:
name: elasticsearch-logging
namespace: kube-system
labels:
k8s-app: elasticsearch-logging
version: v1
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
maxscale]
threads=4
[Galera Monitor]
type=monitor
module=galeramon
servers=svr_10095,svr_10096,svr_10097
user=maxadmin
passwd=jkdskjsdfkjlfdskjdsfkjsdjkf
monitor_interval=10000
@jim3ma
jim3ma / http_proxy.go
Created January 25, 2017 02:11
Register Dialer Type for HTTP&HTTPS Proxy in golang
package main
import (
"bufio"
"fmt"
"net"
"net/http"
"net/url"
"crypto/tls"
@DarrylDias
DarrylDias / pagekit.conf
Last active January 3, 2023 15:49
NGINX config for PageKit. (Tested on Ubuntu) (If for some reason I don't reply to a comment leave a message at https://darryldias.me/contact/)
server {
# Server name
server_name example.com;
# Server Port
listen 80;
# Webroot
root /var/www/;

Generated private key

openssl genrsa -out server.key 2048

To generate a certificate

openssl req -new -x509 -key server.key -out server.pem -days 3650

https

@yeknava
yeknava / getcookie.go
Last active December 27, 2021 00:22
Golang get cookie by name
func getCookieByName(cookie []*http.Cookie, name string) string {
cookieLen := len(cookie)
result := ""
for i := 0; i < cookieLen; i++ {
if cookie[i].Name == name {
result = cookie[i].Value
}
}
return result
}