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
import pickle
from mastodon import Mastodon
INSTANCE = 'http://localhost:3000'
with open('app_credentials.pickle', 'ab+') as f:
try:
f.seek(0)
(client_id, client_secret) = pickle.load(f)
except Exception:
@codl
codl / 2017.md
Created December 31, 2017 19:22

codl's 2017 in review

In 2017 I

  • turned 23
  • took up photography
  • got commissioned a few times, for art and for code
  • crashed my car zero times, compared to twice in 2016
  • got a bike
  • got my bike stolen

Drawpile: GAMPS IS BACK edition

It is time to draw rubbish.

Please join us and draw rubbish with us.

Getting on there

funny not 256 colour css filter

this does not use the traditional "RRRGGGBB" 256 colour palette for no authenticity

how to

  1. put filter.svg at the root of the web site

  2. paste the contents of style.css into your css

/*
born to queue
sidekiq is a fuck
retry all 1989
i am task man
*/
@-moz-document regexp(".*/sidekiq(?:$|/.*)") {
a[href$="/morgue"] span.desc::after {
content: " cops";
# 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() {

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

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
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
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";