This file contains 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 bash | |
set -o errexit | |
set -euo pipefail | |
[[ "${DEBUG:-}" == 'true' ]] && set -o xtrace | |
IFS=$'\n\t' | |
token=$(gh auth token) | |
# TODO: Check X-OAuth-Scopes repo |
This file contains 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
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
# move_to_folder.py is a short script that detects if a torrent entry is a single file | |
# and moves it to a directory generated from the torrent name. | |
# This is primarily for applications that don't deal well with files not being in their own folder | |
# e.g. Plex audiobook collections. | |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
import os | |
import re | |
from pathlib import Path |
This file contains 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
docker run --rm -v "$PWD":/data linuxserver/unrar /usr/bin/unrar-alpine e -r /data/$(ls *.rar) /data/ |
This file contains 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
package main | |
import ( | |
"context" | |
"testing" | |
goredis "github.com/redis/go-redis/v9" | |
"github.com/testcontainers/testcontainers-go/modules/redis" |
This file contains 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
// continually scroll to the bottom to load all comments | |
let comments = document.querySelectorAll("div.contents.c_activity li"); | |
[...comments].map((el) => { | |
let link = el.querySelectorAll(":scope a")[0].href | |
let text = el.querySelectorAll(":scope a")[0].innerText.trim(); | |
let date = el.querySelectorAll(":scope span.date")[0].innerText.trim(); | |
let detail = el.querySelectorAll(":scope div.detail")[0].innerText.trim(); |
This file contains 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/bash | |
export PATH=/usr/local/bin/:$PATH | |
for f in "$@" | |
do | |
hexcode=$(convert "$f" -format %c -depth 8 histogram:info:- | sort -n | tail -1 | awk '{ print $3 }') | |
convert "$f" -resize 1600x900 -background "$hexcode" -gravity center -extent 1600x900 "$f".twitter.png | |
done |
This file contains 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/bash | |
#A simple script to extract a rar file inside a directory downloaded by Transmission. | |
#It uses environment variables passed by the transmission client to find and extract any rar files from a downloaded torrent into the folder they were found in. | |
find /"$TR_TORRENT_DIR"/"$TR_TORRENT_NAME" -name "*.rar" -execdir docker run --rm -v "$PWD":/files maxcnunes/unrar:latest unrar e -o- -r "{}" \; |
This file contains 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
{ | |
"key": "cmd+0", | |
"command": "workbench.action.openLastEditorInGroup" | |
}, | |
{ | |
"key": "cmd+1", | |
"command": "workbench.action.openEditorAtIndex1" | |
}, | |
{ | |
"key": "cmd+2", |
This file contains 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
> echo.py | |
print("Hello World") | |
> echo.php | |
<?php | |
$command = escapeshellcmd('python echo.py'); | |
$output = shell_exec($command); | |
echo $output; |
This file contains 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
$ docker run --name my-redis -d redis | |
$ docker run -it --pid=container:my-redis \ | |
--net=container:my-redis \ | |
--cap-add sys_admin \ | |
alpine sh |
NewerOlder