Skip to content

Instantly share code, notes, and snippets.

import os
from shutil import copyfile
import pathlib
from multiprocessing import Pool, Value
SRC = "/mnt/merger/audio/music"
DST = "/mnt/merger/audio/music_opus"
to_convert = []
counter = Value("d")

Keybase proof

I hereby claim:

  • I am simon987 on github.
  • I am hexcube (https://keybase.io/hexcube) on keybase.
  • I have a public key ASBloK2fwDF-q7M8vxzcH98-tBgEifB0HrMpn9ZrHHTpYwo

To claim this, I am signing this object:

@simon987
simon987 / libgen_mirror.conf
Last active February 22, 2020 03:56
libgen_mirror
proxy_cache_path /files/.cache/
levels=1:2
keys_zone=lg_cache:1m
max_size=90g inactive=168h use_temp_path=off;
server {
listen 80;
# Workaround for symlinks
@simon987
simon987 / flac2mp3_V0.py
Created October 28, 2018 17:30
Multi-threaded python script to convert all flac files to mp3 V0 while keeping the directory structure
import os
from shutil import copyfile
import pathlib
from multiprocessing import Pool, Value
SRC = "/mnt/Data1/Music"
DST = "/mnt/Data1/Music [V0]"
to_convert = []
counter = Value("d")
@simon987
simon987 / del_temp_files.bat
Created October 28, 2018 17:28
Delete temporary files (Windows)
@echo off
cls
del /F /S /Q "%systemroot%\temp\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\History\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Temporary Internet Files\Content.IE5\*.*"
del /F /S /Q "C:\AppData\Local\Microsoft\Windows\Temporary Internet Files\Temporary Internet Files\Low\Content.IE5\*.*"

Easiest way to get rid of empty sub-directories on windows.

ROBOCOPY Parent-Directory-You-Want-To-Purge Parent-Directory-You-Want-To-Purge /S /MOVE

In other words, if I have a bunch of empty season and episode folders in my TV dir, i'd run: ROBOCOPY Television Television /S /MOVE

@simon987
simon987 / floatplane_ripper.py
Created October 16, 2018 00:18
Script to rip all videos from https://floatplane.rip/
#!/usr/bin/env python3
# Rip floatplane.rip
# by terorie :P
import sys
import requests
import lxml.html
from clint.textui import progress
@simon987
simon987 / youtube-dl_soundcloud.md
Created October 16, 2018 00:10
snippet for using youtube-dl to download soundcloud playlists

Heres a snippet for using youtube-dl to download soundcloud playlists:

youtube-dl -w -o "Playlist/%(playlist_title)s (%(playlist_uploader)s) - %(playlist_id)s/%(title)s.%(ext)s" -f bestaudio --embed-thumbnail --add-metadata https://soundcloud.com/tommisch/sets
@simon987
simon987 / rclone_dirsize.md
Last active February 10, 2023 23:03
Get size of http directory listing
RCLONE_CONFIG_ZZ_TYPE=http RCLONE_CONFIG_ZZ_URL=http://link.to.open.directory/here/ 
rclone size zz:

Replace http://link.to.open.directory/here/ and rclone will attempt to get the entire size of the directory.