Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# -- Set up environment variables for unattended installation of packages
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
# -- Update to a newer debian-archive-keyring
aptitude update
aptitude -q -y install debian-archive-keyring
@kujhawk94
kujhawk94 / dcsl
Created June 14, 2023 18:05 — forked from sheershoff/dcsl
Docker-compose logs sorted by time
#!/bin/bash
usage="Input piped docker-compose logs -t, or a file created from this command, to show logs lines sorted by time.\n\n Usage:\n\n $(basename "$0") [-h|--help] - this message\n $(basename "$0") - runs default docker-compose logs -t and sorts'em\n docker-compose logs -t|$(basename "$0") - pipe logs to this command\n $(basename "$0") my-compose.log - or choose file with logs to display\n\n"
[ $# -ge 1 -a -f "$1" ] && input="$1" || input="-"
case "$1" in
-h|--help) printf "$usage"
exit
;;
esac
if [ -t 0 ]; then
docker-compose logs -t|sort -t "|" -k +2d
@kujhawk94
kujhawk94 / script-template.sh
Created January 3, 2024 22:37 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@kujhawk94
kujhawk94 / darken.md
Created April 25, 2024 14:47 — forked from caseywatts/darken.md
Darkening PDFs

short url to these instructions: caseywatts.com/darken

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Using Monochrome (recommended)

  • obtain your ugly, gray pdf
  • brew install imagemagick
  • brew install ghostscript
  • magic command!