Skip to content

Instantly share code, notes, and snippets.

@jfjensen
jfjensen / main.go
Created March 19, 2022 12:56
This is the golang code for rendering a markdown file to HTML/Bulma CSS
package main
import (
"bytes"
"github.com/gomarkdown/markdown"
"github.com/gomarkdown/markdown/ast"
"github.com/gomarkdown/markdown/html"
"io"
"io/ioutil"
"strconv"
@protosam
protosam / basic-sshd.go
Last active February 14, 2024 07:10
Simple ssh server example in go.
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:

Moved to repo: /quenhus/uBlock-Origin-dev-filter

In order to keep filters up to date, please use this repo.

IRC friends, enemies and others,

Control of freenode has recently been seized by the proprietors of Freenode Limited, a holding company established by a previous head of freenode and a third party as part of a deal with a corporate sponsor. The terms of that deal were not disclosed, and remain unknown to me.

At the time, we, freenode's volunteer staff, were given informal guarantees that staff retained operational control of the network. The same guarantees were repeated after leadership was passed on to a new head of staff. I don't

@shawwn
shawwn / since2010.md
Created May 11, 2021 09:46
"What happened after 2010?"

This was a response to a Hacker News comment asking me what I've been up to since 2010. I'm posting it here since HN rejects it with "that comment is too long." I suppose that's fair, since this ended up being something of an autobiography.

--

What happened after 2010?

package main
import (
"bufio"
"io"
"os"
"os/exec"
"time"
"fyne.io/fyne/v2"
@insdavm
insdavm / wireguard-over-tcp.md
Last active April 29, 2024 20:09
WireGuard over TCP with udptunnel

WireGuard over TCP with udptunnel

udptunnel is a small program which can tunnel UDP packets bi-directionally over a TCP connection. Its primary purpose (and original motivation) is to allow multi-media conferences to traverse a firewall which allows only outgoing TCP connections.

Server

# udptunnel -s 443 127.0.0.1/51820

Client

@cbluth
cbluth / sortByteSlice.go
Created March 9, 2020 10:49 — forked from schmohlio/sortByteSlice.go
sort byte slices in Golang without needing to fmt as string. useful for Set hashes
package main
import (
"bytes"
"log"
"sort"
)
// implement `Interface` in sort package.
type sortByteArrays [][]byte

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'