Skip to content

Instantly share code, notes, and snippets.

alice 0xa

Block or report user

Report or block 0xa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
0xa /
Created Oct 28, 2019
get an usable python3 user environment for poetry on debian buster
# as root
apt install python3 python3-distutils python3-pkg-resources python3-venv
# rest as your project user
su - projectuser
# Create python shims (poetry needs "python" and "pip")
mkdir ~/.local/bin/ -p
ln -s /usr/bin/python3 $HOME/.local/bin/python
ln -s /usr/bin/pip $HOME/.local/bin/pip
echo 'export PATH="$HOME/.local/bin:$PATH"' > ~/.profile && source ~/.profile
0xa /
Created Feb 4, 2019
remove errors from nginx cache
#!/usr/bin/env python3
# apt install python3-tqdm
import os
import sys
from glob import iglob
from tqdm import tqdm
root = '/var/cache/nginx/octodon'
#!/bin/env python3
# uvccapture -d/dev/video0 -x2560 -y720 -osnap.jpg
# ./ snap.jpg
# -> output.jpg
from PIL import Image, ImageFilter
import numpy as np
import sys
0xa / progressbar.rb
Last active Oct 4, 2018
mastodon tootctl media remove progressbar
View progressbar.rb
# in lib/mastodon/media_cli.rb:43
# also gem install ruby-progressbar
# probably awful i dislike ruby lol
count = MediaAttachment.where.not(remote_url: '').where.not(file_file_name: nil).where('created_at < ?', time_ago).count
say("removing #{count} files...")
bar = ProgressBar.create(:total => count, :length => 80, :format => "%a [%c/%C] |%B| %j%% %f")
MediaAttachment.where.not(remote_url: '').where.not(file_file_name: nil).where('created_at < ?', time_ago).reorder(nil).find_in_batches do |media_attachments|
media_attachments.each do |m|
0xa / example.conf
Created Oct 3, 2018 — forked from Gargron/example.conf
Using an nginx proxy with cache in front of Wasabi to minimize egress costs
View example.conf
proxy_cache_path /tmp/cache levels=1:2 keys_zone=s3_cache:10m max_size=15g inactive=24h use_temp_path=off;
server {
listen 443 ssl;
keepalive_timeout 30;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
location = / {
if [ -z "$total" ]; then
echo "usage:"
echo " $0 <total>"
echo "total:"
echo " echo 'select count(*) from statuses;' | su - postgres -c 'psql DBNAME'"
exit 1
JsavFile {
version: 115,
tokens: [
View trixels.html
<!DOCTYPE html>
<!-- saved from url=(0017) -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
* { margin: 0; padding: 0; }
body { background: #000; text-align: center; }
p.noscript { color: white; font-size: 2em; }
0xa /
Last active Sep 9, 2018
Mastodon followings management
#!/usr/bin/env python3
A script that go through your followings and unfollows dead accounts.
It notices empty accounts, accounts that were deleted locally and remotely,
and also cleans up dead instances if allowed to.
It has a cache so you can run it once without --unfollow to preview its
actions, and a second time that will skip all verified active profiles.
With colors and a nice progress bar with item count, %, and ETA.
#!/usr/bin/env python3
ROBCO Industries (TM) Password Recovery Tool
Next-generation hacking assistant for your RobCo Pip-Boy 3000.
from collections import namedtuple
You can’t perform that action at this time.