Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / __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 / 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 / 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 / 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 / gcd.c
Last active August 29, 2015 14:07
A C program to calculate the greatest common divisor of two numbers using the Euclidean algorithm.
#include <stdio.h>
#include <inttypes.h>
int gcd(int a, int b) {
return b == 0 ? a : gcd(b, a - (((int) (a / b)) * b));
}
int main(int argc, char const *argv[]) {
if (argc >= 3) {
const unsigned short pairs = (argc - 1) / 2;
@mundry
mundry / screenshot.png
Last active August 29, 2015 14:04
Success Message
screenshot.png
@mundry
mundry / grid-generator.py
Created July 2, 2014 15:04
Script to generate CSS rules for columns of a grid system.
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Number of digits after the dot to be output in the CSS rule.
PRECISION = 8
def generate_grid(columns, className, collapseThreshold=1):
"""
Generates CSS code for a grid system.
columns - The number of columns the grid consists of.
@mundry
mundry / index.html
Created June 27, 2014 13:48
Moment.js setup
<script src="moment.js"></script>
<script src="de.js"></script>
<script>
(function(){
var timestamp = document.querySelector("[data-timestamp]");
timestamp.innerHTML = moment.unix(timestamp.getAttribute("data-timestamp")).format("dddd, Do MMMM YYYY, H:mm:ss");
}())
</script>