Skip to content

Instantly share code, notes, and snippets.

View otterDeveloper's full-sized avatar

otterDeveloper

View GitHub Profile
@rajkosto
rajkosto / nokia-router-cfg-tool.py
Last active April 16, 2024 00:44 — forked from thedroidgeek/nokia-router-cfg-tool.py
Nokia/Alcatel-Lucent router backup configuration tool
#!/usr/bin/env python3
#
# Nokia/Alcatel-Lucent router backup configuration tool
# G2425 support added by rajkosto on 20/11/2022
# XS-2426G-B support added by rajkosto on 28/02/2023
#
# Features:
# - Unpack/repack .cfg files generated from the backup and restore functionnality
@Kranzes
Kranzes / guide.md
Last active April 15, 2024 22:33
SSH Resident Key Guide

Initial checks

Start by checking that there aren't any previous ssh keys inside the FIDO2 authenticator of your YubiKey. You can check if they exist by running the command below:

nix shell nixpkgs#yubikey-manager -c ykman fido credentials list

If the command above outputs a string mentioning "ssh" or "openssh", then you have already got a key generated and store on your YubiKey.

Evaluating additional authentication factors

Before generating a new ssh key to store on your YubiKey you must consider which additional required authentication factors you want to use. Below you can see a table with the available factors and their corresponding command:

@jdoss
jdoss / LUKS_and_TPM2_with_Fedora.md
Last active March 2, 2024 10:31
Decrypt LUKS volumes with a TPM on Fedora 35+

Decrypt LUKS volumes with a TPM on Fedora 35+

This guide allows you to use the TPM on your computer to decrypt your LUKS encrypted volumes. If you are worried about a cold boot attack on your hardware please DO NOT use this guide with your root volume!

Preflight Checks

Verify that you have a TPM in your computer:

# systemd-cryptenroll --tpm2-device=list
PATH DEVICE DRIVER
@jappievw
jappievw / boto3_session_management_and_assume_role.py
Last active July 22, 2023 18:43
Boto3 Management Session with Refreshable Assume Role
from os import getenv
from boto3 import Session
from util import make_refreshable_assume_role_session
def example():
management_session = Session(aws_access_key_id=getenv('AWS_ACCESS_KEY_ID'),
aws_secret_access_key=getenv('AWS_SECRET_ACCESS_KEY'))
assume_role_params = dict(
@v0lkan
v0lkan / docker-i-t-trivia.md
Last active July 25, 2023 04:35
docker run -i -t
docker run -i -t --name nodejs ubuntu:latest /bin/bash

So here, -i stands for interactive mode and -t will allocate a pseudo terminal for us.

Some more trivia about these flags.

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE