Skip to content

Instantly share code, notes, and snippets.

View F1LT3R's full-sized avatar
🌱
Growing Things

Alistair MacDonald F1LT3R

🌱
Growing Things
View GitHub Profile
@F1LT3R
F1LT3R / meditations.md
Last active May 25, 2024 13:21
Meditations

Meditations

Creation

Genesis 1

²⁶ Then God said, “Let us make man in our image, after our likeness. And let them have dominion over the fish of the sea and over the birds of the heavens and over the livestock and over all the earth and over every creeping thing that creeps on the earth.”

²⁷ So God created man in his own image, in the image of God he created him;

@F1LT3R
F1LT3R / extract-web-bible-for-cli-search.sh
Last active July 9, 2023 01:17
Extract text of the Web Bible to chapter directories for easy CLI search w/ ripgrep, ack, etc.
# Download bible as text files from:
# https://ebible.org/Scriptures/eng-web_readaloud.zip
# File output is: Book-Number/Book-Abreviation/Chapter
# Eg: 01/GEN/01
mkdir web-bible
unzip eng-web_readaloud.zip -d web-bible
cd web-bible
rm *.asc *.htm *_000*
@F1LT3R
F1LT3R / batch-rename.bash
Last active July 8, 2023 15:12
Batch rename files in Linux with "for" and "sed"
# For a list of files like this...
# eng-web_002_GEN_01_read.txt
# eng-web_096_REV_22_read.txt
# Batch rename removing "eng-web_" and "_read"...
for i in *; do mv ${i} $(echo ${i} | sed 's/eng-web_//;s/_read//'); done
# Result is file list like this...
# 002_GEN_01.txt
# 096_REV_22.txt
@F1LT3R
F1LT3R / ffprobe-bitrate.shell
Created June 30, 2023 04:24
Get the bitrate of an mp4 using ffprobe
ffprobe -v quiet -select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 input.mp4
@F1LT3R
F1LT3R / find-file-by-name-linux-cli.bash
Created June 29, 2023 03:26
How to recursively find a file by name in Linux
find . -name "foo*"
@F1LT3R
F1LT3R / batch-mp4-to-mp3.bash
Created June 29, 2023 03:05
Batch extract MP3 audio from a directory of MP4 videos in a single terminal command with ffmpeg.
for i in *.mp4; do ffmpeg -i "$i" "${i%.*}.mp3"; done
@F1LT3R
F1LT3R / tradingview-buy-sell-helper.js
Last active November 3, 2024 19:48
TradingView Buy/Sell Helper
async function postData(url = '', data = {}) {
const response = await fetch(url, {
method: 'POST', // *GET, POST, PUT, DELETE, etc.
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'include', // include, *same-origin, omit
redirect: 'follow', // manual, *follow, error
referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
body: JSON.stringify(data) // body data type must match "Content-Type" header
});
return response.json(); // parses JSON response into native JavaScript objects
@F1LT3R
F1LT3R / clone
Created October 13, 2020 04:57
silent.os
#!/bin/bash
echo "hi"
@F1LT3R
F1LT3R / ytm3.sh
Last active September 11, 2020 19:48
Split long YouTube Videos into 5min MP3 Segments
#!/bin/bash
# USAGE: ytm3 https://www.youtube.com/watch\?v\=rQLBitV69Cc
# DESCRIPION: Download Audio from YouTube videos, Convert to split MP3s (5 Min)
# PURPOSE: Studying w/ iPod shuffle
# PRE-REQS: Node.js, YTDL, FFMPEG
# Author: F1LT3R.io
for URL in $@
do
@F1LT3R
F1LT3R / test.js
Last active August 11, 2020 13:39
Hash Map Perf.
const hash = {
a: 1,
b: 1,
c: 1,
d: 1,
e: 1,
g: 1,
h: 1,
j: 1,
k: 1,