Skip to content

Instantly share code, notes, and snippets.

View dgersting's full-sized avatar

David Gersting dgersting

  • 03:18 (UTC -04:00)
View GitHub Profile
Including:
* Deleting files and folders (incl criteria based - if older than xx days)
* Open and save file dialogs
* Hard disk usage reports
@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;
@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 {
# 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 / 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');