Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Time-stamp: <Tue 2021-08-31 14:26 svarrette>
################################################################################
# Pre-commit hook to avoid accidentally adding unencrypted files with
# [git-crypt](https://www.agwa.name/projects/git-crypt/)
# Fix to [Issue #45](https://github.com/AGWA/git-crypt/issues/45)
#
# Usage:
# $ cd /path/to/repository
# $ git-crypt init
@Frick
Frick / listening.sh
Last active May 29, 2022 14:11
A function I keep in my .bashrc for quickly determining what processes are listening on what ports, protocols and interfaces - sorted by port number.
function listening {
if [ "${1}" = "-h" ]; then
echo "Usage: listening [t|tcp|u|udp] [ps regex]"
return
fi
DISP="both"
NSOPTS="tu"
if [ "${1}" = "t" -o "${1}" = "tcp" ]; then
DISP="tcp"
NSOPTS="t"
@hcartiaux
hcartiaux / lvm_net_backup.sh
Last active July 5, 2018 16:31
lvm_net_backup.sh
#!/bin/bash
################################################################################
# lvm_net_backup.sh - Backup lvm snapshot over SSH to files
#
# Copyright (c) 2012 Hyacinthe Cartiaux <Hyacinthe.Cartiaux@uni.lu>
#
# Description : see the print_usage function or launch 'lvm_net_backup.sh --help'
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by