Skip to content

Instantly share code, notes, and snippets.

View philwo's full-sized avatar
🌻
Available

Philipp Wollermann philwo

🌻
Available
View GitHub Profile
@philwo
philwo / vmstat.py
Created November 12, 2012 09:19
vmstat output pre-processor
#!/usr/bin/env python
'''
tr -s ' ' < tpcc_pg_report.vmstat | sed 's/^ //g' | sed 's/ /,/g' > tpcc_pg_report.vmstat.csv
'''
from __future__ import division
import csv
from itertools import izip_longest
@philwo
philwo / README.md
Created October 5, 2012 02:02
Database benchmark

Recommended settings for RAID

  • RAID 10
  • Stripe size 512K
  • Enable write-back cache
  • Disable read-ahead
  • Disable read cache
  • Disable drive write cache

Recommended settings for filesystems, etc.

@philwo
philwo / manage.py
Created October 1, 2012 02:23
Django manage.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "airforce.settings")
from django.core.management import execute_from_command_line
@philwo
philwo / recursive_imap.diff
Created September 16, 2012 11:45
Patches for isync
diff -ur isync-1.0.5~/src/drv_imap.c isync-1.0.5/src/drv_imap.c
--- isync-1.0.5~/src/drv_imap.c 2012-09-16 20:46:17.000000000 +0900
+++ isync-1.0.5/src/drv_imap.c 2012-09-16 20:48:16.000000000 +0900
@@ -22,6 +22,13 @@
* despite that library's more restrictive license.
*/
+#include <config.h>
+#if HAVE_LIBSSL
+# include <openssl/ssl.h>
@philwo
philwo / attributes-default.rb
Created July 5, 2012 06:04
Chef cookbook for nginx + passenger (compiled from source)
default['nginx']['version'] = "1.2.0"
default['nginx']['passenger']['version'] = "3.0.12"
@philwo
philwo / gist:2396442
Created April 16, 2012 05:16
Chef attributes, roles and environment
### cookbooks/nova/attributes/default.rb:
# you should override controller_ip for a multi-node setup
default['nova']['controller_ip'] = "127.0.0.1"
default['nova']['db_ipaddress'] = node['mysql']['bind_address']
default['nova']['rabbitmq_ipaddress'] = node['nova']['controller_ip']
default['nova_api']['ipaddress'] = node['nova']['controller_ip']
[philwo@philwo ca-openstack]$ knife environment show stackcluster1 -fj
{
class DynamicFormValidation(Validation):
""" Validation class that allows dynamic form classes and initial data.
Initial data is only used to validate the form - it will not modify
the data that the user has posted. So form validation might pass,
but saving the model will fail.
"""
initial = {}
def __init__(self, **kwargs):