Skip to content

Instantly share code, notes, and snippets.

@KuJoe
KuJoe / gist:9a3d49e55dad3101bc032edeb80c6f83
Last active May 31, 2025 05:46
ffmpeg compile on Ubuntu with NVENC support.
apt install libx264-dev libx265-dev libgnutls28-dev libvpx-dev libaom-dev libass-dev libfdk-aac-dev libfreetype-dev libmp3lame-dev libopus-dev libvorbis-dev -y
cd ~/nvidia/ffmpeg/
./configure --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-gpl --enable-gnutls --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
@KuJoe
KuJoe / cleanup.sh
Created May 16, 2025 01:14
Simple Mastodon clean-up script
#!/bin/bash
# Remove media older than 30 days
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days 14;
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days 14 --prune-profiles;
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove --days 14 --remove-headers;
# Remove files not linked to any post
RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove-orphans;
@KuJoe
KuJoe / updateLT.sh
Created March 8, 2024 19:01
Libretranslate update script
#!/bin/bash
/opt/libretranslate/.local/bin/argospm update
/opt/libretranslate/.local/bin/argospm list > list.txt
/opt/libretranslate/.local/bin/argospm search >> list.txt
character=":"
sed -i "s/${character}.*//" list.txt
sort list.txt | uniq -u > update_list.txt
for line in $(cat update_list.txt); do
/opt/libretranslate/.local/bin/argospm install "$line"
@KuJoe
KuJoe / getUpdate.sh
Created February 22, 2024 08:12
Automatic update script for Libretranslate
#!/bin/bash
/opt/libretranslate/.local/bin/argospm update
/opt/libretranslate/.local/bin/argospm list > list.txt
/opt/libretranslate/.local/bin/argospm search >> list.txt
character=":"
sed -i "s/${character}.*//" list.txt
sort list.txt | uniq -u > update_list.txt
for line in $(cat update_list.txt); do
/opt/libretranslate/.local/bin/argospm install "$line"
@KuJoe
KuJoe / prunner.service
Created February 1, 2024 16:51
PeerTube Remote Runner systemd service file
[Unit]
Description=PeerTube runner daemon
After=network.target
[Service]
Type=simple
Environment=NODE_ENV=production
User=prunner
Group=prunner
ExecStart=peertube-runner server
@KuJoe
KuJoe / production.yaml
Created January 23, 2024 02:34
Example production.yaml
listen:
hostname: '127.0.0.1'
port: 9000
# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL)
webserver:
https: true
hostname: 'example.com'
port: 443
@KuJoe
KuJoe / sidekiq.php
Last active January 13, 2024 17:10
Get the number of enqueued Sidekiq jobs from the pull queue using PHP and Redis
<?php
$redis = new Redis();
$redis->connect('<redis_server_hostname>', <port>);
$queue_name = 'queue:pull';
$queue_length = $redis->llen($queue_name);
echo "Number of enqueued jobs in '$queue_name': $queue_length";
{
"id": "apex-legends",
"title": "Apex Legends",
"exe": "r5apex.exe",
"triggers": [
{
"id": "apex-kill",
"title": "Elimination",
"enabled": true,
"debug": false,
@KuJoe
KuJoe / mastodon-sidekiq-push.service
Last active February 11, 2023 07:48
mastodon-sidekiq-push.service
[Unit]
Description=mastodon-sidekiq-push
After=network.target
[Service]
Type=simple
User=mastodon
WorkingDirectory=/home/mastodon/live
Environment="RAILS_ENV=production"
Environment="DB_POOL=25"
@KuJoe
KuJoe / mastodon-sidekiq-default.service
Last active February 11, 2023 07:48
mastodon-sidekiq-default.service
[Unit]
Description=mastodon-sidekiq-default
After=network.target
[Service]
Type=simple
User=mastodon
WorkingDirectory=/home/mastodon/live
Environment="RAILS_ENV=production"
Environment="DB_POOL=25"