Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@AnatomicJC
AnatomicJC / passbolt-user-creation-automation-example.bash
Created February 4, 2022 13:05
passbolt user creation automation example
#!/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 August 18, 2021 20:38
vimrc file
" 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.
@AnatomicJC
AnatomicJC / xfs-write-cache.md
Last active August 5, 2021 20:45
XFS write-cache

/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
@AnatomicJC
AnatomicJC / tmux-notes.md
Last active September 24, 2020 09:55
tmux powerline / mouse / cheat sheet

Powerline

# apt install powerline
$ cat ~/.tmux.conf 
source "/usr/share/powerline/bindings/tmux/powerline.conf"
set -g default-terminal "screen-256color"
@AnatomicJC
AnatomicJC / postgresql-read-only-user.md
Created March 3, 2020 14:02
PostgreSQL read-only user
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 / nfs-automount-with-systemd.md
Created October 30, 2019 09:55
NFS automount with systemd
@AnatomicJC
AnatomicJC / debian_ksm.md
Created September 23, 2019 08:39 — forked from mapuo/debian_ksm.md
Enable KSM (Kernel Same-Page Merging) on boot in Debian

Enable KSM (Kernel Same-Page Merging) on boot in Debian

I have installed and running Netdata on my Debian based home server and I wanted to enable KSM after Netdata installer suggested it cloud save some RAM.

To enable the KSM on boot in Debian you I executed these steps:

  1. Install ksmtuned without all the QEMU dependencies:
@AnatomicJC
AnatomicJC / debug-gluster.md
Created September 20, 2019 14:28
debug gluster
gluster volume set nextcloud-data performance.cache-size 1GB
gluster volume set nextcloud-data performance.client-io-threads on
gluster volume set nextcloud-data performance.io-cache on
gluster volume set nextcloud-data performance.io-thread-count 16
gluster volume set nextcloud-data performance.readdir-ahead enable
gluster volume set nextcloud-data performance.read-ahead disable
gluster volume set nextcloud-data features.cache-invalidation on
gluster volume set nextcloud-data features.cache-invalidation-timeout 600
gluster volume set nextcloud-data performance.stat-prefetch on
@AnatomicJC
AnatomicJC / zfs-arc-memory.md
Created September 15, 2019 16:26
ZFS ARC Memory
$ cat /proc/spl/kstat/zfs/arcstats |grep c_
c_min                           4    536870912
c_max                           4    2147483648
cat /etc/modprobe.d/zfs.conf
# https://www.google.com/search?q=bit+calculator Bit > GigaBit
# Min 512MB / Max 2048 MB Limit
@AnatomicJC
AnatomicJC / get-ssl-certificates-details.md
Created September 13, 2019 08:34
Get SSL certificate details with curl
echo | openssl s_client -showcerts -servername doamin.ltd -connect domain.ltd:443 2>/dev/null | openssl x509 -inform pem -noout -text