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
# 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 |
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
// 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() { |
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
# 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 |
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
/** | |
* 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"); |