Skip to content

Instantly share code, notes, and snippets.

@davatron5000
davatron5000 / gist:2254924
Created March 30, 2012 20:57
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@rgo
rgo / gist:2025990
Created March 13, 2012 01:16
Gnome-shell dual monitor separate workspaces
# By default the behavior is:
# Primary monitor work as always and second monitor only have one and fixed workspace
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor remain as is.
# The desired behaviour is:
# Primary monitor and secondary monitor are linked workspace.
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor too.
$ gconf-editor
# Look for /desktop/gnome/shell/windows/workspaces_only_on_primary and set to false
@weisi
weisi / update-resolv-conf
Created January 25, 2012 08:55
update-resolv-conf for openSUSE, using SUSE's netconfig with dirty tricks. No need for resolvconf.
#!/bin/bash
#
# Parses DHCP options from openvpn to update resolv.conf
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf
#
# Used snippets of resolvconf script by Thomas Hood <jdthood@yahoo.co.uk>
# and Chris Hanson
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
@taylor
taylor / README.md
Created November 17, 2011 11:09
wrapper to support SSH SRV records

Introduction

ssh-srv-wrapper is bash shell script which tries to find a SSH SRV record for the first host and uses what is found rather than what was passed (if a valid record is found).

Install

Run the script directly or feel free to rename or symlink to the name ssh. It will look for another ssh in your path to execute.

@creotiv
creotiv / gist:1217855
Created September 14, 2011 21:34
Multicore gevent wsgi server
import sys
from gevent import server
from gevent.baseserver import _tcp_listener
from gevent import pywsgi
from gevent.monkey import patch_all; patch_all()
from multiprocessing import Process, current_process, cpu_count
def hello_world(env, start_response):
if env['PATH_INFO'] == '/':
start_response('200 OK', [('Content-Type', 'text/html')])
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@creaktive
creaktive / cpuusage.pl
Created January 15, 2011 20:58
Calculating CPU Usage from /proc/stat in Perl
#!/usr/bin/perl
# Ref: Calculating CPU Usage from /proc/stat
# (http://colby.id.au/node/39)
use strict;
use warnings 'all';
use utf8;
use List::Util qw(sum);