Skip to content

Instantly share code, notes, and snippets.

View DustinD2's full-sized avatar

Dustin Dalen DustinD2

  • Amazon
  • Portland
View GitHub Profile
@DustinD2
DustinD2 / gist:5288937
Created April 2, 2013 00:21
Just some code to connect to a network via commandline on ubuntu
#!/bin/bash
# Outputs our list of networks
sudo iwlist wlan0 scan
#configure before joining
sudo iwconfig wlan0 ap 00:18:E7:D1:C2:32 #mac of router to join
sudo iwconfig wlan0 essid dlink #name of network
sudo iwconfig wlan0 freq 2.437
@DustinD2
DustinD2 / Create CA and chained certificate
Created December 8, 2012 01:19
This script creates a CA using openssl on a mac. Creates a client certificate and signs it with the CA. Then creates the server certificate for the client.
#!/bin/bash
#This script creates a ca and signs a client key and configures
# the database.
#Configure the Root CA
mkdir ca
cd ca
mkdir certs crl newcerts private
echo "01" > serial
@DustinD2
DustinD2 / OpenSSL Verify Signature in Bash
Created December 5, 2012 23:27
This is a sample openssl bash script to create a matching RSA key pair and create a signed sha1 digest of the script itself using the private key. The digest is then verified against the public key.
#!/bin/bash
#create our key pairs
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -pubout -out public.pem
#sign and verify
openssl dgst -sha1 -sign private.pem -out "$0".sha1 $0
openssl dgst -sha1 -verify public.pem -signature "$0".sha1 $0