Skip to content

Instantly share code, notes, and snippets.

View codl's full-sized avatar
🎧
Now Playing: They Might Be Giants - Nothing's Gonna Change My Clothes

codl codl

🎧
Now Playing: They Might Be Giants - Nothing's Gonna Change My Clothes
View GitHub Profile
-- media_rot.sql
--
-- Copyright codl <codl@codl.fr>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
--[[
Copyright (c) 2021 codl
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
@codl
codl / brotli.vcl
Last active October 7, 2021 00:55
sub vcl_recv {
if(req.http.Accept-Encoding ~ "br") {
set req.http.X-brotli = "true";
}
}
sub vcl_hash {
if(req.http.X-brotli == "true") {
hash_data("br");
}
@codl
codl / _README.md
Last active December 19, 2018 03:42
a nightmare

ive made a mistake

{
init: function(elevators, floors) {
let i = 0;
for(let elevator of elevators){
elevator.num = i;
i++;
elevator.on('idle', ()=>{
if(elevator.num % 2 == 1){
elevator.goToFloor(0);
} else {
vcl 4.0;
backend b2_f001 {
.host = "127.0.0.1";
.port = "50676";
}
backend s3_eu_west_1 {
.host = "127.0.0.1";
.port = "29738";
import psycopg2
db = psycopg2.connect('postgresql:///mastodon_development')
cur = db.cursor()
for i in range(500):
screenname = "bogus_{}".format(i)
email = "bogus_{}@m.codl.fr".format(i)
acc_to_follow = 1

On 2018-08-11, from 01:36 to 04:13 UTC, chitter.xyz suffered an outage.

Timeline

all times UTC

  • 01:36 - the network goes down for an indeterminate length of time
  • 01:XX - ImageMagick convert processes start hoarding memory
  • 01:XX - system goes under memory pressure
  • 01:51 - mastodon app server serves its last request

this script converts glitchsoc-style profile metadata to mastodon v2.4.0 profile fields

it requires

  • python 3.x
  • psycopg2 (might be in your package manager as python-psycopg2, or python3-psycopg2)
  • a mastodon instance

how to use

# sidekiq.chart.sh by codl <codl@codl.fr>
#
# put this in /usr/libexec/netdata/charts.d
# to let others know that
# you are gay too
sidekiq_update_every=5
sidekiq_priority=9000
sidekiq_check() {