Skip to content

Instantly share code, notes, and snippets.

@mundry
mundry / script.py
Created November 14, 2014 13:48
Boiler plate code to combine elements from different pages on a single page.
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from io import StringIO
from lxml.html import builder as E, HTMLParser, parse, tostring
from urllib2 import urlopen
parser = HTMLParser()
@mundry
mundry / output.txt
Last active August 29, 2015 14:13
mpich-3.1-4.fc22.x86_64.rpm's mpichversion output
MPICH Version: 3.1
MPICH Release date: Thu Feb 20 11:41:13 CST 2014
MPICH Device: ch3:nemesis
MPICH configure: --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-sharedlibs=gcc --enable-shared --enable-lib-depend --disable-rpath --enable-fc --with-device=ch3:nemesis --with-pm=hydra:gforker --includedir=/usr/include/mpich-x86_64 --bindir=/usr/lib64/mpich/bin --libdir=/usr/lib64/mpich/lib --datadir=/usr/share/mpich --mandir=/usr/share/man/mpich --docdir=/usr/share/mpich/doc --htmldir=/usr/share/mpich/doc --with-hwloc-prefix=system FC=gfortran F77=gfortran CFLAGS=-m64 -O2 -fPIC CXXFLAGS=-m64 -O2 -fPIC FCFLAGS=-m64 -O2 -fPIC FFLAGS=-m64 -O2 -fPIC LDFLAGS=-Wl,-z,
@mundry
mundry / output.txt
Created February 4, 2015 20:33
Output of `yum groupinfo @development` on CentOS 7.
Group: Development Tools
Group-Id: development
Description: A basic development environment.
Mandatory Packages:
+autoconf
+automake
binutils
+bison
+flex
+gcc
@mundry
mundry / __init__.py
Created February 18, 2015 09:06
Class to store the longest version of a path in Python.
We couldn’t find that file to show.
@mundry
mundry / h2o.sh
Last active February 26, 2024 05:43
Fully manual installation of the H2O web server.
#!/usr/bin/env bash
INSTALL_BASEPATH=$HOME/.local/h2o
SOURCE_BASEPATH=$HOME/.local/src
# Set to build the shared library on top of the standalone server.
H2O_SHARED=${H2O_SHARED}
OPENSSL_VERSION=1.1.0h
OPENSSL_INSTALL_PATH=$INSTALL_BASEPATH/openssl-${OPENSSL_VERSION//./}
@mundry
mundry / instructions.md
Last active April 8, 2018 17:23
Temporary installation of cgit with lighttpd for testing.

Install lighttpd in a temporary location.

curl -o {/tmp,http://download.lighttpd.net/lighttpd/releases-1.4.x}/lighttpd-1.4.45.tar.xz
tar xf /tmp/lighttpd-1.4.45.tar.xz -C /tmp
cd /tmp/lighttpd-1.4.45
./configure --prefix=/tmp/lighttpd
make -j8
make install
@mundry
mundry / README.markdown
Last active December 2, 2015 20:31
Web server maintenance configuration for Apache and Nginx.

Web Server Maintenance Configuration

Serves a file maintenance.html for every request while it is present. No need to restart the web server or alter its configuration to switch the site into maintenance mode.

Apache

@mundry
mundry / README.markdown
Last active December 31, 2015 19:27
Self-signed SSL Certificate one-liner

Self-signed SSL Certificate one-liner

$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout domain.key -out domain.crt
  • openssl req - generate a certificate
  • -x509 - use x509 specification
  • -nodes - no DES, don't encrypt the private key
  • -days 365 - valid for 1 year
@mundry
mundry / libfiles.py
Last active October 11, 2016 17:30
Utility script to help find missing or obsolete source files listed in libbrotli's Makefile.am.
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Utility script to help find missing or obsolete source files listed in
# libbrotli's Makefile.am.
#
# Usage:
# $ cd libbrotli
# $ ./libfiles.py
@mundry
mundry / expose_hphp.patch
Last active February 29, 2016 18:17
Patch to make HHVM's expose_hphp config setting more granular.
diff --git a/hphp/runtime/base/runtime-option.cpp b/hphp/runtime/base/runtime-option.cpp
index 3a3d25a..9903996 100644
--- a/hphp/runtime/base/runtime-option.cpp
+++ b/hphp/runtime/base/runtime-option.cpp
@@ -179,7 +179,7 @@ std::string RuntimeOption::ForceCompressionURL;
std::string RuntimeOption::ForceCompressionCookie;
std::string RuntimeOption::ForceCompressionParam;
bool RuntimeOption::EnableKeepAlive = true;
-bool RuntimeOption::ExposeHPHP = true;
+std::string RuntimeOption::ExposeHPHP = "full";