THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
function Tmpwatch(path, days) | |
let l:path = expand(a:path) | |
if isdirectory(l:path) | |
for file in split(globpath(l:path, "*"), "\n") | |
if localtime() > getftime(file) + 86400 * a:days && delete(file) != 0 | |
echo "Tmpwatch(): Error deleting '" . file . "'" | |
endif | |
endfor | |
else | |
echo "Tmpwatch(): Directory '" . l:path . "' not found" |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
In order to minimize slip-ups, we have a different inventory file for | |
each instance-environment pair, and each inventory uses a different | |
group name as well. Then there are group-vars files for each | |
instance-environment pair that set a variable so the proper playbooks | |
get run. | |
For example, here is how we have the project laid out: | |
site.yml | |
inventory/ | |
main-prod |
This is a continuation of my buffer pre-write hook series. Check out the previous gist to follow the progression.
Have you ever tried running a file only to be stopped by "<<<<<<<"?
Wouldn't it be nice to be able to automatically run your code through pyflakes before actually saving it? Maybe even raise an error for showstopping bugs in your code?
docker run \ | |
--name {{printf "%q" .Name}} \ | |
{{- with .HostConfig}} | |
{{- if .Privileged}} | |
--privileged \ | |
{{- end}} | |
{{- if .AutoRemove}} | |
--rm \ | |
{{- end}} | |
{{- if .Runtime}} |
Das Programm »Restic« ist ein modernes Backup-Programm, welches als Speicherort sowohl lokale Verzeichnisse als auch per Netzwerk erreichbare Speicher (Online-Speicher) nutzen kann. Der Autor von »Restic« zeigt in anschaulicher Weise in zwei Videos viele Details zur Arbeitsweise seines Programms: »FOSDEM 2015« (2015-01-28) und »CCCCologne« (2016-01-29).
Im Folgenden soll gezeigt werden, wie man unter Linux automatische Backups mit »Restic« einrichten kann. Als Speicherort wird per WebDAV-Protokoll erreichbarer Online-Speicher genutzt. Sinngemäß können die Hinweise aber auch auf andere Netzwerkprotokolle übertragen werden. Getestet wurde unter »openSUSE« und »Linux Mint« (»Ubuntu«), wobei aber auch alle anderen systemd-basierten Linux-Distributionen in derselben Art oder mit geringfügigen Änderungen geeignet sind.
#!/bin/bash | |
# This is my production backup script. | |
# https://sqlgossip.com | |
set -e | |
set -u | |
usage() { | |
echo "usage: $(basename $0) [option]" | |
echo "option=full: Perform Full Backup" |
A modified version of Romain's gist.
See prior revisions for functionality closer to the original. This is now a simplification that aims only to provide prompts that would typically follow basic commands.
function! ExpandCommand(pattern) abort
let aliases =
\ { 'cn' : 'cnext'