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
0xa / clean_cache.py
Created Feb 4, 2019
remove errors from nginx cache
View clean_cache.py
#!/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'
View rift_sensor_convert.py
#!/bin/env python3
# uvccapture -d/dev/video0 -x2560 -y720 -osnap.jpg
# ./this.py snap.jpg
# -> output.jpg
from PIL import Image, ImageFilter
import numpy as np
import sys
@0xa
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
say("counting...")
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
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;
server_name files.example.com;
keepalive_timeout 30;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
location = / {
View mastodon-elasticsearch-stats.sh
#!/bin/sh
total=$1
if [ -z "$total" ]; then
echo "usage:"
echo " $0 <total>"
echo "total:"
echo " echo 'select count(*) from statuses;' | su - postgres -c 'psql DBNAME'"
exit 1
fi
View hl2sav.rs
/*
Ok(
JsavFile {
version: 115,
tokens: [
"uv",
"landmark",
"state",
"globalentity_t",
"mapName",
View trixels.html
<!DOCTYPE html>
<!-- saved from url=(0017)https://xomg.net/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>xomg</title>
<style type="text/css">
* { margin: 0; padding: 0; }
body { background: #000; text-align: center; }
p.noscript { color: white; font-size: 2em; }
</style>
@0xa
0xa / followings.py
Last active Sep 9, 2018
Mastodon followings management
View followings.py
#!/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.
View f4hack.py
#!/usr/bin/env python3
"""
ROBCO Industries (TM) Password Recovery Tool
----
Next-generation hacking assistant for your RobCo Pip-Boy 3000.
"""
from collections import namedtuple
View xfpm-power-backlight-helper
#!/bin/sh
# changes the range of display brightness until it's merged into xfpm
# ---
# 1. save as /usr/bin/xfpm-power-backlight-helper
# 2. rename original to /usr/bin/xfpm-power-backlight-helper.orig
# 3. enjoy a hopefully more useful brightness setting
div=2
args=( "$@" )
You can’t perform that action at this time.