Skip to content

Instantly share code, notes, and snippets.

@rain-1
rain-1 / IRC.md
Created September 11, 2021 18:14
why we use IRC nodes

Why is IRC distributed across multiple servers?

I have been wondering for a long time why IRC networks have multiple servers. Wouldn't it be simpler just to use a single server?

One of the problems of having multiple servers is that netsplits can occur. Anybody who has been on IRC for a while will have witnessed one. Hundreds of people suddenly ripped out of the chat. This can also screw up channel and user modes, and 'some people' have been known to wait for netsplits in order to takeover channels or enter password protected channels.

So lets compare situation (A) a single IRC server everyone connects to with the current setup people use (B) multiple servers. Let's say you run an IRC network with u = 40,000 users and n = 20 server nodes that people connect to via round robin DNS (meaning that when people resolve the DNS it gives them a random server from the set of 20 to connect to). These are vaguely realistic numbers modelled after libera.chat.

So in (B) you have roughly u/n = 2000 clients connected

@NFarrington
NFarrington / Migrating Terraform Cloud State.md
Last active September 16, 2021 13:08
Migrating Terraform State

Migrating Terraform Cloud State (the Super Janky Method™️)

The following is a semi-automated (or semi-manual, if you're a glass-half-empty person) way of generating terraform state mv commands to move existing resources to new paths.

It does not use a Terraform plan file, as this is often not conveniently available (e.g. when using Terraform Cloud).

Tested with Terraform 0.12, 0.13 and 0.14 output.

Note: if you're not using Terraform Cloud, you might want to try some of the proper tooling other people have built, such as https://github.com/mbode/terraform-state-mover.

@philandstuff
philandstuff / devopsdays.org
Last active October 12, 2017 21:05
Devopsdays london 2017

Devopsdays London 2017

initial session, bob walker (@rjw1)

  • welcome everyone!
  • we have a code of conduct
  • thanks to organisers, sponsors, etc

Humane Teams at home and around the world

@robyoung
robyoung / gist:e62905574366f9cad535b230f3fb2ae7
Created March 24, 2017 21:47
Scale Summit 2017 - Session 1 - Renew - Onboarding / Maintaining Engineers
Adding people on day one, then ongoing maintenance of them when people move
around teams.
What do people do?
Can people deploy on day one?
Some people do deploy on day one others do not
One person, working on a very small team. We just need your github account
to deploy to live. We invested a lot in the initial setup of the dev environment.
- Very small team
// Largely copied (with some modernisation applied) from:
// https://github.com/reem/rust-lazy/blob/master/src/single.rs
use std::cell::UnsafeCell;
use std::ptr;
use std::ops::{Deref, DerefMut};
use self::Inner::{Evaluated, EvaluationInProgress, Unevaluated};
pub trait Invoke<A = (), R = ()> {
I have run an nginx container...
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6d67de07731d nginx "nginx -g 'daemon ..." 40 minutes ago Up 40 minutes 80/tcp, 443/tcp epic_goldberg
I want to use Debian for debug:
docker run -it --pid=container:6d67de07731d --net=container:6d67de07731d --cap-add sys_admin debian
I can see the nginx process:

Software I use

Enforced keyboard breaks

First things first — I've had RSI and incessant pain before, and I don't want it again. There are many instances of keyboard break software, but the one I use is AntiRSI. It's available from the Mac App Store for a fiver, and its worth every penny to me. If you prefer free, an older version is still available. I enforce it always being running (but with the ability to turn it off when playing games) with a script I run from cron.

Controlling my computer

I use LaunchBar for more things than I can count. A Mac just doesn't seem to work right until I've got LaunchBar working.

@psd
psd / all.txt
Last active April 6, 2016 11:23
Find words containing all of the vowels, in order
$ egrep 'a.*e.*i.*o.*u' /usr/share/dict/words
abietineous
abstemious
abstemiously
abstemiousness
abstentious
acetabuliferous
acetarious
acheilous
acheirous

Client SSL Authentication

The use case I had when I implemented client SSL authentication was to secure a web interface for a centralised log service that I was running. I wanted it to have it available, securely, on the public internet. I implemented it using nginx's ssl module.

I only had this available for 4-5 developers. I think I'd only attempt to use this for anyone who is comfortable with SSH keys or if it was an API client. I think the technical bar is a little too high for anything else.

I wrote some scripts, which I've pushed to a public GitHub repository: olly/heracles. The README is a mix of actual commands that work, and thoughts for how things could be configured. The idea was for it to generate CAs, server certificates and client certificates, and store them in a git repository for easy backup. There in a fairly rough state, but what's there works and I had tested on a real setup.

Authorizatio