Skip to content

Instantly share code, notes, and snippets.

View Aetherinox's full-sized avatar

Aetherinox Aetherinox

View GitHub Profile
@madd0
madd0 / md5.cs
Created November 15, 2011 09:06
Create an MD5 hash digest in C#
public static string MD5Hash(string toHash)
{
string hashed;
using (MD5 md5 = MD5.Create())
{
hashed = string.Join(string.Empty, md5.ComputeHash(Encoding.UTF8.GetBytes(toHash)).Select(b => b.ToString("x2")));
}
return hashed;
@zachbonham
zachbonham / crypto.cs
Created September 10, 2012 17:57
RSA public key encryption in C#
using System;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Text;
namespace Crtypto
{
class Program
{
static void Main(string[] args)
@dylancwood
dylancwood / tree.css
Last active February 5, 2026 06:06
CSS to create a simple tree structure with connecting lines. No images or JS required.
ul.tree, ul.tree ul {
list-style: none;
margin: 0;
padding: 0;
}
ul.tree ul {
margin-left: 10px;
}
ul.tree li {
margin: 0;
@baywet
baywet / pfxtosnk.cs
Created October 4, 2014 00:39
sample on how to convert a pfx to snk visual studio assembly signing certificate
X509Certificate2 cert = new X509Certificate2(@"KEY.pfx", "pfxPassword", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
RSACryptoServiceProvider provider = (RSACryptoServiceProvider) cert.PrivateKey;
byte[] array = provider.ExportCspBlob(!provider.PublicOnly);
using (FileStream fs = new FileStream("FileName.snk", FileMode.Create, FileAccess.Write))
{
fs.Write(array, 0, array.Length);
}
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active February 21, 2026 19:42
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Last update: Nov 2025.

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 ecparam -genkey -name secp384r1 | openssl ec -aes256 -out rootCA.key
@cskeeters
cskeeters / broadcast_calc.sh
Created December 8, 2016 19:17
Bash script for calculating network and broadcast addresses from ip and netmask or CIDR Notation
#!/bin/bash
# Calculates network and broadcast based on supplied ip address and netmask
# Usage: broadcast_calc.sh 192.168.0.1 255.255.255.0
# Usage: broadcast_calc.sh 192.168.0.1/24
tonum() {
if [[ $1 =~ ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+) ]]; then
@briansmith
briansmith / how-to-generate-and-use-private-keys-with-openssl-tool.md
Last active October 6, 2025 11:37
How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 8, 2026 20:04
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@styblope
styblope / docker-api-port.md
Last active March 2, 2026 17:18
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@Te-k
Te-k / internet-census.csv
Created December 20, 2017 14:19
List of IPs scanning IPv4 addresses with zmap and belonging to an unknown internet census project
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
198.143.133.154;AS32475;SingleHop;Linux 3.11+;server1.phx.internet-census.org
107.6.171.130;AS32475;SingleHop;Linux 3.11+;server2.ams.internet-census.org
45.33.66.232;AS63949;Linode;Linux 3.11+;li-new-us-gp1-wk101.internet-census.org
69.175.97.170;AS32475;SingleHop;Linux 3.11+;server1.chi3.internet-census.org
173.255.213.43;AS63949;Linode;Linux 3.11+;li-cal-us-gp1-wk102.internet-census.org
198.20.103.242;AS32475;SingleHop;Linux 3.11+;server1.ams.internet-census.org
45.33.2.193;AS63949;Linode;Linux 3.11+;li-dal-us-gp2-wk101.internet-census.org
107.6.169.250;AS32475;SingleHop;Linux 3.11+;server3.ams.internet-census.org
184.154.189.90;AS32475;SingleHop;Linux 3.11+;server4.chi3.internet-census.org
184.154.47.2;AS32475;SingleHop;Linux 3.11+;server2.chi3.internet-census.org