Skip to content

Instantly share code, notes, and snippets.

View spacexnasa's full-sized avatar
🎯
Focusing

space spacexnasa

🎯
Focusing
View GitHub Profile
@spacexnasa
spacexnasa / ca.md
Created December 31, 2022 11:48 — 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.

@spacexnasa
spacexnasa / postfix_mail_macosx.md
Created September 27, 2022 02:21 — forked from haccks/postfix_mail_macosx.md
Send mail from local host using postfix on MacOS High Sierra.

Setting up postfix on MacOS High Sierra

MacOS Sierra High comes with preinstalled postfix. Follow these steps to configure it on a local system:

1. Create a sasl_passwd file

sudo nano /etc/postfix/sasl_passwd
  • Add this to the file
@spacexnasa
spacexnasa / bash-invocation.md
Created July 31, 2022 06:01 — forked from yegle/bash-invocation.md
Bash Shell启动方式与RC脚本

Bash Shell启动方式与rc脚本

Shell的不同分类

根据启动Bash Shell的方式不同,对Shell有两种分类方式

登录Shell与非登录Shell

根据Shell的启动方式不同,可以将Shell分为

@spacexnasa
spacexnasa / bogonsblocks.sh
Created May 25, 2022 13:08 — forked from vagnernogueira/bogonsblocks.sh
Firewall-D and IPSETs
#!/bin/bash
# geoip on firewall in centos 7
# this file: /etc/cron.weekly/bogonsblocks.sh
# sudo chmod +x /etc/cron.weekly/bogonsblocks.sh
## create tmp dir
# sudo mkdir /var/tmp/ipbogons
## create list on ipset
# sudo ipset create bogonslist hash:net maxelem 1000000
## create rule on firewall-cmd
@spacexnasa
spacexnasa / Firewalld GeoIP firewall script
Created May 19, 2022 08:57 — forked from Pandry/Firewalld GeoIP firewall script
Block countries IPs via Firewalld
#!/bin/bash
##
# Name: GeoIP Firewall script
# Author: Pandry
# Version: 0.1.1
# Description: This is a simple script that will set up a GeoIP firewall blocking all the zones excecpt the specified ones
# it is possible to add the whitelisted zones @ line 47
# Additional notes: Usage of [iprange](https://github.com/firehol/iprange) is suggested
# for best performances
@spacexnasa
spacexnasa / remove-gpg-user.sh
Created April 24, 2022 06:43 — forked from glogiotatidis/remove-gpg-user.sh
Git-crypt remove user.
#!/bin/bash
#
# Script to remove GPG key from git-crypt
#
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
#
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
@spacexnasa
spacexnasa / mutt-with-gmail-gpg-macosx.md
Created April 24, 2022 06:34 — forked from syncom/mutt-with-gmail-gpg-macosx.md
Configure Mutt to work with Gmail + GPG on Mac OS X

Mutt (or NeoMutt) with Gmail and GPG on Mac OS X

This note describes how to set up the Mutt or NeoMutt email client on Mac OS X to work for Gmail and GnuPG.

Software versions

The software versions used in this note are:

  • macOS Catalina (version 10.15.4)
@spacexnasa
spacexnasa / 01nginx-tls-sni.md
Created April 22, 2022 13:20 — forked from kekru/01nginx-tls-sni.md
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
{
"stats": {},
"api": {
"services": [
"StatsService"
],
"tag": "api"
},
"policy": {
"levels": {
@spacexnasa
spacexnasa / logon-py3.py
Created April 13, 2022 07:00 — forked from hex-ci/logon-py3.py
SecureCRT logon script for google authenticator.
# $language = "python"
# $interface = "1.0"
import base64
import hmac
import struct
import sys
import time
TOTP_KEY = 'YOUR_GOOGLE_AUTH_KEY'