This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = / { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Ok( | |
JsavFile { | |
version: 115, | |
tokens: [ | |
"uv", | |
"landmark", | |
"state", | |
"globalentity_t", | |
"mapName", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
ROBCO Industries (TM) Password Recovery Tool | |
---- | |
Next-generation hacking assistant for your RobCo Pip-Boy 3000. | |
""" | |
from collections import namedtuple |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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=( "$@" ) |
NewerOlder