Useful Scripts

2 readers
0 users here now

Any kind of scripts that are useful… nothing malicious please.

Please prefix your post with the script language or some kind of indication of the platform it’s for.

founded 2 years ago
MODERATORS
1
2
 
 
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config 
systemctl restart ssh
3
 
 

I use this on my seedbox for anything sonarr grabs and sends to my blackhole that is a .magnet file rather than .torrent.

#!/bin/bash
File="$(find /PATH/TO/MAGNET/FILES -name '*.magnet' -print -quit)"
set -- $File
Filecontents="$(cat "$File")"
set -- $Filecontents
cd /PATH/TO/MAGNET/FILES
[[ "$Filecontents" =~ xt=urn:btih:([^&/]+) ]] || exit;
echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent"
rm "$File"