Skip to content

Instantly share code, notes, and snippets.

View dgersting's full-sized avatar

David Gersting dgersting

  • 01:29 (UTC -04:00)
View GitHub Profile
@dgersting
dgersting / example.php
Created June 8, 2012 17:29 — forked from ah01/example.php
PHP Thread class with exit code support
<?php
require "thread.php";
function doSomething($res, $t) {
usleep($t);
exit($res);
}
$thread1 = new Thread('doSomething');
@dgersting
dgersting / ssl cheatsheet
Last active June 7, 2017 07:23
SSL cheatsheet
OpenSSL modules:
- genrsa
Generate an RSA private key
https://www.openssl.org/docs/apps/genrsa.html
- req
PKCS#10 certificate request and certificate generating utility.
https://www.openssl.org/docs/apps/req.html
- x509
Certificate display and signing utility
https://www.openssl.org/docs/apps/x509.html
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@dgersting
dgersting / nginx_ssl.conf
Last active November 25, 2015 22:52 — forked from konklone/ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@dgersting
dgersting / nginx.conf
Last active November 25, 2015 22:21 — forked from kvandenhaute/nginx.conf
user www-data;
# As a thumb rule: One per CPU. If you are serving a large amount
# of static files, which requires blocking disk reads, you may want
# to increase this from the number of cpu_cores available on your
# system.
#
# The maximum number of connections for Nginx is calculated by:
# max_clients = worker_processes * worker_connections
worker_processes 1;
Including:
* Deleting files and folders (incl criteria based - if older than xx days)
* Open and save file dialogs
* Hard disk usage reports

Usefull BASH Aliases:

  • iptables-list='iptables -L -v --line-numbers'
  • ip6tables-list='ip6tables -L -v --line-numbers'

Modules: (-m <module>) (http://ipset.netfilter.org/iptables-extensions.man.html)

  • ctstate:
    • --state INVALID,NEW,ESTABLISHED,RELATED,UNTRACKED,SNAT,DNAT
  • multiport:
### Keybase proof
I hereby claim:
* I am dgersting on github.
* I am dgersting (https://keybase.io/dgersting) on keybase.
* I have a public key whose fingerprint is C82A 3CAB 0EA0 E1C2 BA44 CB64 7D22 EB03 844D 157A
To claim this, I am signing this object:
# Set SELinux enforcing
sed -i 's/^SELINUX=.*/SELINUX=enforcing/g' /etc/selinux/config