Skip to content

Instantly share code, notes, and snippets.

View kenjij's full-sized avatar
👨‍💻
Hacking away...

Ken J. kenjij

👨‍💻
Hacking away...
View GitHub Profile
@kenjij
kenjij / gist:4e6e3eaa602c47722ce7
Last active August 29, 2015 14:05
Self signing an SSL Certificate
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
@kenjij
kenjij / openssl.sh
Last active April 29, 2022 20:42
OpenSSL SSL certificate generation process
# Generate private key with passphrase
openssl genrsa -des3 -out server.key 2048
# Private key without passpharase; UNDERSTAND THE RISK!
openssl rsa -in server.key -out server.key-nopass
# Generate CSR to submit to CA
openssl req -new -sha256 -key server.key -out server.csr
# Check/view CSR
@kenjij
kenjij / hosts-ubuntu
Last active August 29, 2015 14:05
Hosts file on Ubuntu
127.0.0.1 localhost
127.0.1.1 myhostname
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
@kenjij
kenjij / gist:9016204
Last active December 6, 2022 23:00
Create GeoIP database for iptables in Ubuntu
# Install necessary packages
sudo apt-get unzip
sudo apt-get install libtext-csv-xs-perl
# Create database location
sudo mkdir /usr/share/xt_geoip
# Download the database file and convert
/usr/lib/xtables-addons/xt_geoip_dl
sudo /usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip *.csv
@kenjij
kenjij / gist:9015956
Created February 15, 2014 08:05
Configure time zone in Ubuntu (non-interactive)
sudo sh -c 'echo "America/Los_Angeles" > /etc/timezone'
sudo dpkg-reconfigure --frontend noninteractive tzdata
@kenjij
kenjij / gist:9015841
Created February 15, 2014 07:48
Configure time zone in Ubuntu (interactive)
sudo dpkg-reconfigure tzdata