Skip to content

Instantly share code, notes, and snippets.

@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active April 3, 2025 18:32
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@csamsel
csamsel / h240.txt
Last active September 23, 2024 08:54
Switch HPE HBA H240 from raid mode to hba mode.
# So you want switch your HPE H240 controller to HBA mode for use with ESXi or UnRaid?
# online you'll find the follow command for HP controllers, like the P420i.
ssacli controller slot=0 modify hbamode=on
# For me, it was:
ssacli controller slot=255 modify raidmode=off
# while you are at it, you can also switch the power mode:
ssacli controller slot=255 modify powermode=minpower
@csamsel
csamsel / sas.sh
Created December 9, 2019 21:29
activate power management on sas drives
# disable background scan (might prevent standby)
sdparm --quiet --clear=EN_BMS --save /dev/disk/by-id/scsi-?????????????????
# enable standby (powers down drive motor)
sdparm --flexible --quiet --save -p po --set=STANDBY=1 /dev/disk/by-id/scsi-?????????????????
# set standby to 30min
sdparm --flexible --quiet --save -p po --set=SCT=18000 /dev/disk/by-id/scsi-?????????????????
# enable idle (drives spins but servos are off)
sdparm --flexible --quiet --save -p po --set=IDLE_B=1 /dev/disk/by-id/scsi-?????????????????
# set idle to 5min
sdparm --flexible --quiet --save -p po --set=ICT=3000 /dev/disk/by-id/scsi-?????????????????
@kborovik
kborovik / How to use a GPG key for SSH authentication
Created October 8, 2020 12:28
How to use a GPG key for SSH authentication
# How to use a GPG key for SSH authentication
# Tested on Ubuntu 20.04 LTS
# Enable SSH support in gpg-agent:
echo enable-ssh-support > ~/.gnupg/gpg-agent.conf
# Cache GPG & SSH passwords for 24 hours (the reboot will clear the password cache)
echo max-cache-ttl 86440 >> ~/.gnupg/gpg-agent.conf
echo max-cache-ttl-ssh 86440 86440 >> ~/.gnupg/gpg-agent.conf
echo default-cache-ttl 86440 >> ~/.gnupg/gpg-agent.conf