Skip to content

Instantly share code, notes, and snippets.

View mildred's full-sized avatar

Mildred Ki'Lya mildred

View GitHub Profile
@mildred
mildred / download.sh
Created October 20, 2014 10:03
Download from archive.org Wayback Machine
#!/bin/bash
url=http://redefininggod.com
webarchive=https://web.archive.org
wget="wget -e robots=off -nv"
tab="$(printf '\t')"
additional_url=url.list
# Construct listing.txt from url.list
# The list of archived pages, including some wildcard url
@mildred
mildred / howto_nat_traversal.md
Last active December 9, 2023 06:59
How To TCP NAT Traversal using Node.js and a STUN Server

How To TCP NAT Traversal using Node.js and a STUN Server

With the scarecity of IPv4 addresses, and IPv6 still not available at large, NAT traversal is becoming a necessity. Especially with the generalisation of Carrier-grade NATs that you can find on mobile connections. Even with IPv6 you may suffer NAT66. Imagine your mobile device that gets only a single Ipv6 address, and you want to share it on your computer.

The solution might be in a decentralized protocol for address attribution such

@mildred
mildred / server.py
Created October 9, 2014 10:20
Python 3 http.server with PUT support
#!/usr/bin/env python
import argparse
import http.server
import os
class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_PUT(self):
path = self.translate_path(self.path)
if path.endswith('/'):
@mildred
mildred / README.md
Last active March 15, 2023 08:57
SwayWM synchronize workspaces on outputs

This will monitor workspace changes and update the current workspace on other monitors. The idea is that workspace number 1 is paired with workspace 11 on second monitor, workspace 21 on 3rd monitor...

Usage:

run it in background along your sway session

Problem: Sway does not allow switching workspaces without focusing it, and focusing a workspaces moves the mouse cursor. So it's impossible to change the current workspace on the secondary output without disrupting the user.

As a consequence, the implementation - for now - will only update the workspace when the moves moves to the output, but this is far from ideal.

@mildred
mildred / Dockerfile
Last active November 21, 2022 12:31
Dockerfile for filestash
#
# Stage 1: Define base image
#
FROM debian:unstable-slim AS base
#
# Stage 2: Build base image
#
@mildred
mildred / README.md
Last active June 20, 2022 13:17
Build a fedora kernel rpm using docker and git checkouted sources instead of a src.rpm

Build a fedora kernel rpm

Rationale:

  • I need a custom kernel (because sound won't work with vanilla)
  • I want to use Fedora Atomic Host
  • The only way to override the kernel with Fedora Atomic Host is to install a kernel package using ostree-rpm
  • I have a metered network connection and want to avoid downloading the kernel sources too many times
  • The powerful machine that can build the kernel is nor running Fedora or Red-hat based system with rpmbuild available
@mildred
mildred / README.md
Last active February 10, 2022 14:48
multifirefox

multifirefox: have multiple firefox profiles

Equivalent of firefox -P PROFILE_NAME -no-remote but with the remote enabled.

Multifirefox is a way to have multiple firefox profiles and open links in them. There are multiple ways of invocation:

multifirefox PROFILE_NAME ...

Start Firefox with the profile PROFILE_NAME (or open a new window in the existing firefox instance).

@mildred
mildred / README.md
Created January 29, 2016 20:24
openwrt and raspberry config

OpenWRT Configuration

This configuration makes a WAN interface from a gretun tunnel. The WAN IP is configured in DHCP.

In this configuration, the WAN is the private network of a 4G LTE modem/router that is plugged into a raspberry pi on the house wall. The raspberry py provides the modem/router network on a gretun tunnel.

  • uptun0: gretap tunnel to raspberry py, attaches to upbridge0
  • upbridge0: dhcp client to uplink (the gretap tunnel
@mildred
mildred / README.md
Created April 11, 2016 07:59
tuleap import script

Run import.sh to import project into tuleap running in docker. For it to work, you must:

cd path/to/tuleap/source/repository/
mkdir -p test_import
vim test_import/import.sh

Usage:

import.sh optvar=value

@mildred
mildred / keybase.md
Created March 2, 2019 22:20
keybase.md

Keybase proof

I hereby claim:

  • I am mildred on github.
  • I am mildred (https://keybase.io/mildred) on keybase.
  • I have a public key ASDQFes07Yd_g56-PPV853GxC2dKwU5YV7NzWmXJ8ddP_Qo

To claim this, I am signing this object: