Skip to content

Instantly share code, notes, and snippets.

@jonath92
jonath92 / install-update-yt-dlp.sh
Last active December 3, 2023 20:28
install-update-yt-dlp
# This is a simple script to install yt-dlp and create a cron job to automatically update yt-dlp on a daily basis.
# can be executed with:
# sudo su -c "bash <(wget -qO- https://gist.githubusercontent.com/jonath92/039e998b3d3f6ba4afd5d5c671eaedf1/raw/23542a3aadadf5ba181fb8aff723c27610551abd/install-update-yt-dlp.sh)" root
# install yt-dlp (see https://github.com/yt-dlp/yt-dlp#installation)
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
# ytdlp requires ffmpeg
sudo apt install ffmpeg -y
@jonath92
jonath92 / getStations.js
Last active September 3, 2023 00:46
Create Radio Station list
// Usage: 1. Download as Zip 2. Run `npm i` 3. run `node getStations.js`
// Note that the process might take 1-2 minutes
import fetch from 'node-fetch';
import fs from 'fs';
import lodash from 'lodash';
const { uniqWith, uniqBy, isEqual, sortBy } = lodash;
async function main() {
@jonath92
jonath92 / install-Update-Youtube-dl.sh
Last active March 1, 2024 11:50
Install-Update-Youtube-dl Linux Mint
# This is a simple script for install youtube-dl and creating a script in /etc/cron.daily
# to automatically update youtube-dl on a daily basis.
# can be executed with:
# sudo su -c "bash <(wget -qO- https://gist.githubusercontent.com/jonath92/0f6bf4606bc8a34be1bb0826c99b73d1/raw/914aabe6c4b15dc614f18c8816f5ad2828755c22/install-Update-Youtube-dl.sh)" root
# Remove apt version to prevent conflicts
apt purge -y youtube-dl
# Fix python not found error https://askubuntu.com/a/1149489/1013434
ln -s /usr/bin/python3 /usr/local/bin/python
@jonath92
jonath92 / generateThumb.js
Last active March 13, 2021 13:38
Generate Thumbnail of Image and save it to file
/**
* simple function for generating an Image Thumbnail and save it to a file
* Usage:
* 1. copy script and original image in a folder
* 2. run 'npm init --y && npm i image-thumbnail fs'
* 3. execute script with node
*/
const imageThumbnail = require('image-thumbnail');
const { promises: fs } = require("fs");