Skip to content

Instantly share code, notes, and snippets.

View drio's full-sized avatar
🐢
I don't know

David Rio drio

🐢
I don't know
View GitHub Profile
@drio
drio / txt
Created April 10, 2025 14:16
The most fascinating thing...
The most fascinating thing I've learned recently is how userspace networking
works, particularly in mesh networks like Tailscale.
When you want to encrypt network traffic, you typically use a TUN/TAP device
provided by the operating system. At a high level, here's how (I think) it works:
When applications send data over the network via sockets, the data follows
the OS networking stack, which adds the necessary headers. If the destination
IP address matches your TUN device, the kernel redirects that packet to the
userland application controlling the TUN device (e.g., tailscaled).
@drio
drio / cpop.go
Last active April 9, 2025 14:56
R center appl.
package main
import (
"fmt"
"os"
)
func cracklePop(n int) string {
if n%3 == 0 && n%5 == 0 {
return "CracklePop"
Building ID,Name,Alternate Name,Use,Address,Campus,LDAP ID,Name,Alternate Name,Address,Type,Latitude,Longitude,,Location
M125,10 Winthrop Street,,Dormitory,10 Winthrop Street,MEDFORD,10 Winthrop Street,10 Winthrop Street,,10 Winthrop Street,Residence Hall,42.409643,-71.123074,,10 Wintrhop
M122,101 Talbot Avenue,,Dormitory,101 Talbot Avenue,MEDFORD,101 Talbot Avenue,101 Talbot Avenue,,101 Talbot Avenue,,42.405991,-71.121775,,101 Talbot
M144,108 Bromfield Road,,Administration,108 Bromfield Road,MEDFORD,108 Bromfield Road,108 Bromfield,,108 Bromfield Road,,42.404755,-71.116747,,108 Bromfield
M074,108 Packard Avenue,,Administration,108 Packard Avenue,MEDFORD,108 Packard Avenue,108 Packard,,108 Packard Avenue,,42.405718,-71.122643,,108 Packard
M088,11 Curtis Avenue,,Administration,11 Curtis Avenue,MEDFORD,11 Curtis Avenue,11 Curtis Street,,11 Curtis Avenue,,42.407758,-71.124894,,11 Curtis
M118,11 Talbot Avenue,,Academic,11 Talbot Avenue,MEDFORD,Dept of Art & Art History,Dept of Art & Art History,,11 Talbot Avenue
1,B005 - Arnold Bldg Research,B005-800c-ap0,3484
2,B001 - Dental Bldg Academic,B001-1500h2a-ap1,907
3,B008 - Jaharis Academic,B008-701h0-1-ap,6770
4,B011 - Sackler Academic,B011-604a-ap1,12227
5,B011 - Sackler Academic,B011-867-ap1,9967
6,G001 - Jean Mayer Administration,G001-217K-ap0,2826
7,R041 - 230 Fenway Academic,R041-a208-ap0,5068
8,B006 - South Cove Research,B006-400s2-ap1,1275
9,B011 - Sackler Academic,B011-502-ap1,9639
10,B001 - Dental Bldg Academic,B001-1415d-ap1,4083
@drio
drio / aoc-2023-day1.js
Last active December 6, 2023 15:49
Advent of code - day 1 2023
import { pretty, linesFromStdin } from '../common.js';
const listNums = "zero, one, two, three, four, five, six, seven, eight, nine".split(",").map(e => e.trim())
function findMatches(line, str) {
const re = new RegExp(str, "g");
const matches = [...line.matchAll(re)]
return matches.map(({ index }) => ({ s: index }))
}
{
"fields": {
"aaa_override_passphrase": "false",
"ap_name": "M131-stairb-4w-ap0",
"co_state": "client-status-run",
"guest_lan_client_info/idle_time_seconds": 0,
"guest_lan_client_info/phy_ifid": 0,
"guest_lan_client_info/wired_vlan": 0,
"idle_timeout": 0,
"idle_timestamp": 0,
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response
xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="https://aportal.drtufts.net/saml/acs" ID="_8e1833f5b65e46fd106f71c07611ae21" InResponseTo="id-870aba870f8c1097a5d42321e84297166b13f7c5" IssueInstant="2023-02-28T17:53:42.887Z" Version="2.0">
<saml2:Issuer
xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">https://shib-idp.tufts.edu/idp/shibboleth
</saml2:Issuer>
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
@drio
drio / README.md
Last active January 20, 2023 17:28
fly-test

Gist away!

package main
import (
"embed"
"html/template"
"io/ioutil"
"log"
"net/http"
"os"
)
@drio
drio / README.md
Created November 21, 2022 14:53
nomad-bins

Gist away!