image from https://i.stack.imgur.com/KTSQa.png, author is unknown for me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOG_FILE=pam-environment-01.log.md | |
exec 3>&1 | |
exec 1>> "$LOG_FILE" | |
printf '\n\n\nLOGIN %s\n=====================\n' "$(date +%Y%m%d-%H%M%S)" | |
printf '\n\n%s\n----------------\n' .pam_environment | |
printf '```ini\n' | |
grep -C2 -- AVAR .pam_environment |
systemd journalctl cheatsheet / tldr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DEST_USER=${DEST_USER:-user} | |
DEST_DIR=${DEST_DIR:-/home/$DEST_USER} | |
files="$( | |
sudo --login --non-interactive --user $DEST_USER -- \ | |
bash -c "find -maxdepth 1 -type f \\( | |
-name .profile -o -name .zprofile -o -name .bash\\* -o -name .zsh\\* | |
\\)" |
KEY_ID='[email protected]'
cat <<EOF >"${KEY_ID}...pub+sec.asc" \
➜ ssh-add -l
256 SHA256:DpDdSJhFYZAa1jz4cE9PMAevia1C/yb4Gi5nW7dMqmw [email protected] (ED25519)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
locale1=${1:-uk_UA.UTF-8} | |
locale2=${2:-ru_UA.UTF-8} | |
shopt -s nocasematch | |
if [[ $locale1 != POSIX ]] \ | |
&& [[ ! $locale1 =~ ' '$ ]] \ | |
&& [[ ! $locale1 =~ @.+$ ]] \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Create repository in Github with correct escaping in repo name | |
# Requires {@code GITHUB_TOKEN} env var. | |
# @return ssh url to created repository which can be used in git clone command | |
jq --null-input --compact-output \ | |
--arg repo 'my-awesome-project' \ | |
'{name: $repo}' \ | |
| curl \ |