Skip to content

Instantly share code, notes, and snippets.

@thfrei
thfrei / youtubemusicdownloader.py
Created October 19, 2023 11:29 — forked from un1tz3r0/youtubemusicdownloader.py
This script uses ytmusicapi and pytube together to download your playlists, history or 'liked' songs as high-quality audio-only streams from Youtube Music.
''' This script uses ytmusicapi and pytube together to download your playlists, history or 'liked' songs as
high-quality audio-only streams from Youtube Music, which are protected by a "signatureCipher" obfuscation scheme.
To use it, first install [ytmusicapi] and [pytube] using pip, then follow the instructions for creating the auth
file from the response in an authenticated session to a watch-page request as found in your browser's dev-tools.
The downloaded files are placed in ~/Music, named with the artist and track metadata, and will be skipped instead
of downloaded again next time it is run, based on the videoIds of the downloaded songs.
Merry Xmas - V.
@thfrei
thfrei / noexport-subtrees.lua
Created October 4, 2021 09:55 — forked from tarleb/noexport-subtrees.lua
Emulating org-mode's :noexport: behavior for Markdown.
-- [[
Remove all subtrees whose headlines contain class `noexport`.
License: MIT
Copyright: © Albert Krewinkel
]]
-- pandoc.utils.make_sections exists since pandoc 2.8
PANDOC_VERSION:must_be_at_least {2,8}
@thfrei
thfrei / npm-scripts-for-docker.md
Created October 28, 2020 10:57 — forked from duluca/npm-scripts-for-docker.md
npm scripts for Docker

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

How to Use

npm i -g mrm-task-npm-docker
npx mrm npm-docker

Contribute

Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker

@thfrei
thfrei / suby.subx.domain.tld
Created September 8, 2020 14:55
NGINX /etc/nginx/sites-available
# reverse proxy basic config
# Note 1: after creating this file in /etc/nginx/sites-available link it into sites-enabled:
# `sudo ln -s /etc/nginx/sites-available/suby.subx.dmain.tld /etc/nginx/sites-enabled/suby.subx.dmain.tld
# Note 2: after changing nginx, make sure to reload nginx config via: `sudo nginx -s reload`
# Note 3: add the new site to certbot via:
# `sudo certbot --nginx -d apps.fr31.net -d NEWAPP.server.apps.f
r31.net --register-unsafely-without-email`
upstream NEWAPP { # <----- change this line
server 127.0.0.1:33XYZ; # <----- change this line
@thfrei
thfrei / launch.json
Last active August 10, 2020 21:07
trilium vscode node chrome debug launch.json for vscode
{
"version": "0.2.0",
"configurations": [
{
"name": "trilium dev",
"program": "${workspaceFolder}/src/www",
"request": "launch",
"runtimeArgs": ["--inspect","--inspect-port=9229"],
"env": {
"TRILIUM_ENV": "dev",
@thfrei
thfrei / prom-client_pm2_cluster.js
Created February 14, 2020 16:35 — forked from yekver/prom-client_pm2_cluster.js
Instead of `cluster` module there is no direct access to the master process in `pm2`. To return metrics for the whole cluster you can do IPC calls from the active instance to the rest of them and wait while all their locally collected metrics will be sent. Finally you have to aggregate all received metrics.
const prom = require('prom-client');
const pm2 = require('pm2');
let pm2Bus;
const REQ_TOPIC = 'get_prom_register';
function pm2exec(cmd, ...args) {
return new Promise((resolve, reject) => {
pm2[cmd](...args, (err, resp) => (err ? reject(err) : resolve(resp)));
@thfrei
thfrei / userChrome.css
Last active January 14, 2024 18:55
userChrome.css Firefox FF57 - tree-style-tab, tridactyl, remove tabs in top bar title
/*
* Settings for Firefox using Treestyle-Tabs and Tridactyl
*
* 1) find userChrome.css in:
* Windows: %AppData%\Roaming\Mozilla\Firefox\Profiles\xyz.default-release\chrome\userChrome.css
* Linux: ~/snap/firefox/common/.mozilla/firefox/xyz.default/chrome
* Or go to: about:support => Profile Directory
* => If folder chrome does not exist, create!
* 2) Enable usage of userChrome.css in about:config
* Set toolkit.legacyUserProfileCustomizations.stylesheets to true
@thfrei
thfrei / vimium-ff-extension-mapping
Created October 11, 2017 09:01
vimium-ff extension mappings, so that it feels more like vimperator
# Insert your preferred key mappings here.
map ge previousTab
map gr nextTab
map d removeTab
unmap yy
map y copyCurrentUrl