Skip to content

Instantly share code, notes, and snippets.

View cypnk's full-sized avatar
🤠
Out on a farm

Rustic Cyberpunk cypnk

🤠
Out on a farm
View GitHub Profile
@cypnk
cypnk / genkeys.sh
Created October 16, 2017 22:30
Bash script to generate a private key and public key pair
#!/bin/bash
# Generate a private key and public key pair
# Pair name (default "blank")
NAME=${1:-blank}
# Key size (default 4096)
SIZE=${2:-4096}
# Key pair destination. Change this to your own home directory
@cypnk
cypnk / random.sh
Last active October 18, 2017 23:38
Bash script to generate a random string E.G. For a password
#!/bin/bash
# Generate a random string with optional special characters
# Sometimes there may not be a special character in the random string
# because it's random
# Default string size
SIZE=${1:-20}
# Alphanumeric pool
APOOL='a-zA-Z0-9'
@cypnk
cypnk / sign.sh
Created October 16, 2017 23:38
Sign a file with a given private key
#!/bin/bash
# Sign a file using the specified private key
# Source file to sign
SRCF=$1
# Private key location
PRIK=$2
# Signature algorithm (defaults to SHA-512)
@cypnk
cypnk / verify.sh
Created October 16, 2017 23:44
Verify a file with a given public key (best for files signed with "sign.sh")
#!/bin/bash
# Verify a signed file with the specified public key
# Signature file
SRCF=$1
# Public key location
PUBK=$2
# Signature algorithm (defaults to SHA-512)
@cypnk
cypnk / encrypt.sh
Created October 16, 2017 23:55
Encrypt a file with a given pubic key (to send to someone else)
#!/bin/bash
# Encrypt a file using the specified public key
# Source file
SRCF=$1
# Public key
PUBK=$2
# Encrypted file (defaults to the encrypted file name + ".encrypted")
@cypnk
cypnk / decrypt.sh
Last active October 17, 2017 00:02
Decrypt a file with a given private key (best for files encrypted with "encrypt.sh")
#!/bin/bash
# Decrypt a file using the specified private key
# Encrypted file
ENCF=$1
# Private key
PRVK=$2
# Decrypted file (defaults to the decrypted file name + ".decrypted")
@cypnk
cypnk / conkyrc
Created December 14, 2017 04:10
My Conky setup
# For commands above TEXT check:
# http://conky.sourceforge.net/config_settings.html
#
# For commands available below TEXT check:
# http://conky.sourceforge.net/variables.html
# Bunsen Labs Conky help threads
# http://crunchbang.org/forums/viewtopic.php?pid=371424#p371424
# beta tested by: smacz
@cypnk
cypnk / tint2
Created December 14, 2017 04:11
My Tint2 setup
#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------
# For more information about tint2, see:
# http://code.google.com/p/tint2/wiki/Welcome
#
# For more config file examples, see:
# http://bunsenlabs.org/topic/3232/my-tint2-config/
# Background definitions
@cypnk
cypnk / checkboxconf.html
Created January 6, 2018 16:59
Pure CSS checkbox confirmation (for deletions etc...)
<!DOCTYPE html>
<html>
<head>
<title>Delete confirmation</title>
<style>
body { font: 400 1em sans-serif; background: #f9f9ff; color: #444; }
label {
cursor: pointer;
}
@cypnk
cypnk / spamhaus.sh
Last active February 1, 2018 23:04
Grab Spamhaus DROP list and create a pf compatible blocklist
#!/bin/sh
# This is an OpenBSD compatible shell script using the ftp utility
# to download the latest Spamhaus DROP list IP ranges and create a
# pf compatible IP list
# Files (make sure the PFDROP file actually exists)
PFDROP=/etc/blocklists/spamhaus
# Lists