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 / progress-bar.sh
Created January 22, 2016 14:20
Bash Progress Bar
#!/bin/bash
# Bash Progress Bar: https://gist.github.com/F1LT3R/fa7f102b08a514f2c535
progressBarWidth=20
# Function to draw progress bar
progressBar () {
# Calculate number of fill/empty slots in the bar
@F1LT3R
F1LT3R / Default (OSX)sublime-keymap.json
Last active October 23, 2023 20:04
word wrap with ctrl + shift + w in sublime-text
[
{ "keys": ["ctrl+shift+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}
]
// Thanks to "facelessuser"
// https://www.sublimetext.com/forum/viewtopic.php?f=3&t=6663
@F1LT3R
F1LT3R / meditations.md
Last active October 11, 2023 14:48
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 / self-hosted-email-server.md
Last active June 20, 2023 03:27
Self-Hosted Email Server

#Self-Hosted Email Server

This guide shows you how to set up a self-hosted email server.

##The Stack

Stack Diagram

###At The Core

@F1LT3R
F1LT3R / sha1-hash-node.js
Created August 1, 2017 04:09
sha1 hash node.js
const crypto = require('crypto')
const sha1 = path => new Promise((resolve, reject) => {
const hash = crypto.createHash('sha1')
const rs = fs.createReadStream(path)
rs.on('error', reject)
rs.on('data', chunk => hash.update(chunk))
rs.on('end', () => resolve(hash.digest('hex')))
})