Skip to content

Instantly share code, notes, and snippets.

View Badrmoh's full-sized avatar
🏠
Working from home

Badr Ibrahim Badrmoh

🏠
Working from home
View GitHub Profile
@Badrmoh
Badrmoh / gpg-ssh-setup.md
Created March 27, 2022 18:58 — forked from mcattarinussi/gpg-ssh-setup.md
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.

@Badrmoh
Badrmoh / README.md
Created February 22, 2022 11:38 — forked from koshatul/README.md
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@Badrmoh
Badrmoh / gpg-import-and-export-instructions.md
Created February 22, 2022 11:14 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@Badrmoh
Badrmoh / gist:61edf9627d86b2c11bf7899aed9e08e5
Created May 13, 2021 01:21 — forked from kenngyc/gist:331f49f81a2dcb87f3ad
Kibana Dashboard for Apache Logs with Fluentd + ElasticSearch
{
"title": "Apache logs",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
@Badrmoh
Badrmoh / self-signed-certificate-with-custom-ca.md
Created March 9, 2021 20:22 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

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
@Badrmoh
Badrmoh / nexus-repo-manager-privilege-example.groovy
Created October 15, 2019 20:03 — forked from nblair/nexus-repo-manager-privilege-example.groovy
A groovy script to create Content Selectors, privileges, and roles programmatically via the Nexus Repository Manager 3 Scripting API.
import org.sonatype.nexus.common.entity.*
import org.sonatype.nexus.security.*
import org.sonatype.nexus.security.authz.*
import org.sonatype.nexus.selector.*
import com.google.common.collect.ImmutableMap
// use container.lookup to fetch internal APIs we need to use
def selectorManager = container.lookup(SelectorManager.class.name)
def securitySystem = container.lookup(SecuritySystem.class.name)
@Badrmoh
Badrmoh / git tutorials.md
Created August 27, 2019 06:54 — forked from jaseemabid/git tutorials.md
Awesome git tutorials I am finding here and there
@Badrmoh
Badrmoh / ca.md
Created April 15, 2019 11:17 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.