Skip to content

Instantly share code, notes, and snippets.

View Jonny007-MKD's full-sized avatar
😊
I'm fine

Jonny007-MKD

😊
I'm fine
View GitHub Profile
@Jonny007-MKD
Jonny007-MKD / .bash_logout
Created April 10, 2020 12:09
Check if /etc is clean before logout
# Check /etc git is clean (from etckeeper)
if sudo -n true 2> /dev/null; then # if we can run sudo without prompting
cd /etc/
if [[ `sudo git status --porcelain` ]]; then # if git is not clean
echo -e "\033[0;31mPlease commit changes in /etc first\033[0m"
exec sudo bash -l # start a new bash (i.e. abort logout) as root in /etc
# the login bash is now running as root
fi
fi
@Jonny007-MKD
Jonny007-MKD / eyed3.sh
Last active April 7, 2020 19:06 — forked from iansym/eyed3.sh
Using eyeD3 to add cover art
for f in *mp3; do eyeD3 --encoding=utf8 --to-v2.4 --add-image cover.jpg:FRONT_COVER "$f"; done
@echo off
if [%1] == [] goto usage
if [%2] == [] goto usage
if [%3] == [] (
set /a offset=0
) else (
set /a offset=%3
)
@Jonny007-MKD
Jonny007-MKD / adblockupdater.sh
Last active November 6, 2015 09:49 — forked from Holzhaus/adblockupdater.sh
Adblock script for OpenWRT
# Adblock script for OpenWRT
# (c) 2014 by Jan Holthuis
#
# This is an adblocker script for OpenWRT. Simply run this script as a
# daily cronjob on your OpenWRT-router. This works since OpenWRT
# revision 39312 [1] and does not manipulate any files in /etc/.
# Instead, this adds the adblock serverlist as a separate file
# to /tmp/dnsmasq.d/. It also checks the file with grep to make sure
# that it doesn't contain malicious commands.
#