Skip to content

Instantly share code, notes, and snippets.

@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"
@KuJoe
KuJoe / mastodon-sidekiq.service
Last active February 11, 2023 07:48
mastodon-sidekiq.service
[Unit]
Description=mastodon-sidekiq
After=network.target
[Service]
Type=simple
User=mastodon
WorkingDirectory=/home/mastodon/live
Environment="RAILS_ENV=production"
Environment="DB_POOL=50"
@KuJoe
KuJoe / domain.conf
Created January 12, 2023 14:33
nginx reverse proxy config
server {
server_name example.com;
access_log off;
error_log off;
location / {
proxy_pass http://my.synology.ddns
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;