Skip to content

Instantly share code, notes, and snippets.

@AnatomicJC
AnatomicJC / gitlab-pipeline-pull-n-push-example.sh
Created Feb 4, 2022
go-passbolt-cli gitlab pipeline example
View gitlab-pipeline-pull-n-push-example.sh
# Set the configuration file containing the private OpenPGP key and passphrase
cat ${PASSBOLT_CLI_CONFIG} | base64 -d > /root/.config/go-passbolt-cli/go-passbolt-cli.toml
# Login to gitlab CI registry
# CI_REGISTRY_* variables are dynamically set by gitlab
docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
###
# login to Docker HUB registry / fetch password from passbolt
###
View go-passbolt-cli-create-resource.sh
passbolt create resource \
 - name "docker.com token for gitlab" \
 - username "username@domain.tld" \
 - password "Ch4ng3-m3-pl35E" \
 - uri "https://docker.io"
@AnatomicJC
AnatomicJC / passbolt-user-creation-automation-example.bash
Created Feb 4, 2022
passbolt user creation automation example
View passbolt-user-creation-automation-example.bash
#!/usr/bin/env bash
set -euo pipefail
TMPGNUPGHOME=$(mktemp -d)
EMAIL="email@domain.tld"
PASSPHRASE="strong-passphrase"
FIRSTNAME="John"
LASTNAME="Doe"
KEYSIZE=2048
@AnatomicJC
AnatomicJC / .vimrc
Last active Aug 18, 2021
vimrc file
View .vimrc
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
runtime! debian.vim
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
View xfs-write-cache.md

/etc/systemd/system/xfs-write-cache.service

[Unit]
Description=Set XFS Write cache to write through

[Service]
Type=oneshot
User=root
Group=root
ExecStart=/usr/lib/systemd/system-sleep/xfs-write-cache
View self-signed-certificate-with-custom-ca.md

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
View postgresql-read-only-user.md
CREATE ROLE "ro-user" WITH PASSWORD 'secret';
ALTER ROLE "ro-user" WITH LOGIN;
GRANT USAGE ON SCHEMA public TO "ro-user";
GRANT SELECT ON ALL TABLES IN SCHEMA public TO "ro-user";
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO "ro-user";
@AnatomicJC
AnatomicJC / xfs-dedup.md
Last active Nov 24, 2022
XFS reflinks deduplication with duperemove and fdupes
View xfs-dedup.md
@AnatomicJC
AnatomicJC / tmux-notes.md
Last active Sep 24, 2020
tmux powerline / mouse / cheat sheet
View tmux-notes.md

Powerline

# apt install powerline
$ cat ~/.tmux.conf 
source "/usr/share/powerline/bindings/tmux/powerline.conf"
set -g default-terminal "screen-256color"