Skip to content

Instantly share code, notes, and snippets.

View emjayoh's full-sized avatar

Matt Ogram emjayoh

View GitHub Profile
@emjayoh
emjayoh / datediff
Created October 10, 2021 22:41
datediff
echo $(( ($(date --date="031122" +%s) - $(date --date="021020" +%s) )/(60*60*24) ))
@emjayoh
emjayoh / 95-lolcat
Created August 31, 2021 04:20 — forked from dorentus/95-lolcat
dynamically generated /etc/motd using fortune, cowsay & lolcat,save it as /etc/update-motd.d/95-lolcat.Google `pam_motd` or `update-motd` for more details of dynamically generated message-of-the-day.
#!/bin/bash
# see: http://blog.tomtung.com/2009/11/cowsay-fortune
# http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed
# https://github.com/busyloop/lolcat
# https://github.com/dorentus/mruby-lolcat-bin
#
# requires `fortune`, `cowsay`,
# and ruby gem `lolcat` or its mruby version equivalent
export LANG="en_US.UTF-8"
@emjayoh
emjayoh / .leptonrc
Created April 19, 2021 14:23
[.leptonrc] Lepton configuration #darkmode #lepton #snippets
{
"theme": "dark",
"autoUpdate": false,
"snippet": {
"expanded": true,
"newSnippetPrivate": false,
"sorting": "updated_at",
"sortingReverse": true
},
"editor" : {
@emjayoh
emjayoh / wgetod.sh
Created April 19, 2021 06:53
[Get open directory] reddit.com/r/opendirectories #opendir #bash #wget #files #download
wgetod() {
NSLASH="$(echo "$1" | perl -pe 's|.*://[^/]+(.*?)/?$|\1|' | grep -o / | wc -l)"
NCUT=$((NSLASH > 0 ? NSLASH-1 : 0))
wget -r -nH --user-agent=Mozilla/5.0 --cut-dirs=$NCUT --no-parent --reject="index.html*" "$1"
}
@emjayoh
emjayoh / dynamic-fade.sh
Last active April 19, 2021 09:00
[Audio+VIdeo merge] lossless #ffmpeg #audio #video #cli #bash
ffmpeg -i input.mp4 -i soundtrack.mp3 -filter_complex "[1:a]afade=t=out:st=$(bc <<< "$duration-$fade"):d=$fade[a]" -map 0:v:0 -map "[a]" -c:v copy -c:a aac -shortest with_audio.mp4
@emjayoh
emjayoh / .gitconfig
Created April 13, 2021 10:37
.gitconfig
# core {{{
[core]
editor = /usr/bin/vim
excludesfile = /Users/np/.gitignore_global
pager=less -x4
#}}}
# user {{{
[user]
email = [email protected]
@emjayoh
emjayoh / .gitconfig
Last active April 17, 2021 23:18 — forked from Jiri-Mihal/.gitconfig
[global .gitconfig] Set of handy .gitconfig aliases. https://github.com/durdn/cfg/blob/master/.gitconfig. #.gitconfig
[user]
email = [email protected]
name = Firstname Lastname
[alias]
# basic
st = status -s
cl = clone
ci = commit
co = checkout
@emjayoh
emjayoh / hangouts.py
Created March 19, 2021 05:46 — forked from purneshwar/hangouts.py
Convert/Parse Google Takeout/Export Data Hangouts/Chat into individual conversations
# Run this in the same directory as the Hangouts.json file generated by Google Takeout / Data Export tool.
# python3 hangouts.py
import json
import datetime
import os
import shutil
import re
chat_dir = "hangouts"
@emjayoh
emjayoh / ghunt_search.sh
Created March 1, 2021 10:20
[OSINT Gmail] Ghunt tool #ghunt #gmail #osint #snoop
docker run -v ghunt-resources:/usr/src/app/resources -ti mxrch/ghunt hunt.py <email>
@emjayoh
emjayoh / font_smoothing.sh
Created March 1, 2021 10:19
[macOS config] various config options #config #macos #shell #cli #terminal #devenv
defaults -currentHost write -g AppleFontSmoothing -int [0/1/2/3]
# default is 2, 0 disabled