Skip to content

Instantly share code, notes, and snippets.

View dynnamitt's full-sized avatar
:atom:
yolo

Kjetil Midtlie dynnamitt

:atom:
yolo
  • Norway
View GitHub Profile
# bonus: sexy logfile ;)
sudo su
printf "#\!/usr/bin/env sh\n(date;docker rmi \$(docker images -q);echo +++++;) \
>> /var/log/docker_rmi_cron.log 2>&1\n" > /etc/cron.weekly/docker-rmi
chmod +x /etc/cron.weekly/docker-rmi
@dynnamitt
dynnamitt / squash.sh
Last active October 8, 2015 08:15
Git Pull PREPARE
# Switch to the master(or dev) branch and make sure you are up to date.
# Taken from http://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit
# ===================================================================================================
# ------ basically ggpull 1st;
git checkout dev
git fetch upstream # eller `git fetch origin` HVIS gatekeeper
git merge upstream/dev # eller `git pull` HVIS gatekeeper
# start here ;
@dynnamitt
dynnamitt / inotify_delay_cmd
Last active August 29, 2015 14:11
Run CMD in an inotify loop, restarting inotifywait each time to ensure new dirs get hooked in. Runs on $PWD
#!/bin/sh
#function for yo .bashrc/.zshrc
inotify_delay_cmd() {
while true; do
inotifywait -r -e create -e delete -e modify --exclude '^\./\..+' .
"$@"
done
}
@dynnamitt
dynnamitt / steal_site alias
Last active August 29, 2015 14:11
rip a site via http
alias steal_site='wget --mirror --convert-links --adjust-extension --page-requisites --no-parent'
@dynnamitt
dynnamitt / JustWorks{4Me}Linux
Last active December 31, 2015 02:59
JustWorks{4Me}Linux
#!/bin/bash
# JustWorks{4Me}Linux --- version 0.0.1a
# each section is prepped for copy and paste
# mount /arch (freshly formatted)
# set some ENVs
# find you mirror here: https://www.archlinux.org/mirrorlist/
@dynnamitt
dynnamitt / nice-git-log
Created October 30, 2012 09:02
nice git log
git log -25 --no-merges --pretty=format:"%h - %an, %ar : %s"
@dynnamitt
dynnamitt / home-status
Created October 23, 2012 17:58
Home folder overview
cd; du -hd1 | sort -h
@dynnamitt
dynnamitt / gui-mergetool
Created October 23, 2012 08:37
GUI mergetool setup
sudo aptitude install meld; git config --global merge.tool meld