Skip to content

Instantly share code, notes, and snippets.

View riccardopedrielli's full-sized avatar

Riccardo Pedrielli riccardopedrielli

View GitHub Profile
@riccardopedrielli
riccardopedrielli / set-env-vars-from-file.sh
Created October 22, 2021 16:34
Set environment variables from file in bash
if [ -r "${ENV_FILE}" ]; then
set -o allexport
source "${ENV_FILE}"
set +o allexport
fi
@riccardopedrielli
riccardopedrielli / generate-ssh-key.sh
Last active January 9, 2022 12:30
Generate SSH key
ssh-keygen -t ed25519 -a 128 -C ${USER} -f ${USER} -N ''
@riccardopedrielli
riccardopedrielli / generate-ssl-certificate.sh
Created October 22, 2021 16:25
Generate SSL certificate
openssl req -newkey rsa:4096 -x509 -sha256 -nodes -days 3650 -out localhost.crt -keyout localhost.key -subj "/CN=localhost"

Terminal colors

Color RGB
Default Text f0f0f0
Default Background 151b1f
Bold Text f5f5f5
Links 3e9cff
Cursor Text ffe5fd
Cursor Background fb00e8
@riccardopedrielli
riccardopedrielli / ubuntu-workstation-setup.sh
Last active February 7, 2023 12:33
Ubuntu workstation setup
#!/usr/bin/env bash
set -Eeu
trap 'STATUS=${?}; echo "${0}: Error on line ${LINENO}: ${BASH_COMMAND}"; exit ${STATUS}' ERR
trap 'rm -rf ${tempDir}' EXIT
readonly supportedUbuntuVersion="22.04"
readonly tempDir="/tmp/setup"
readonly devDir="${HOME}/dev"
readonly scriptsDir="${devDir}/scripts"