Skip to content

Instantly share code, notes, and snippets.

View johmue's full-sized avatar

Johannes Müller johmue

View GitHub Profile
@FiloSottile
FiloSottile / dump-imap.py
Created March 12, 2012 13:52
Simple script to dump an IMAP folder into eml files
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import imaplib
import getpass
import argparse
argparser = argparse.ArgumentParser(description="Dump a IMAP folder into .eml files")
argparser.add_argument('-s', dest='host', help="IMAP host, like imap.gmail.com", required=True)
argparser.add_argument('-u', dest='username', help="IMAP username", required=True)
@stopyoukid
stopyoukid / diff2html.sh
Last active July 16, 2024 03:29
Script that takes a git diff and outputs an html file in GitHub style
#!/bin/bash
#
# Convert diff output to colorized HTML.
# (C) Mitch Frazier, 2008-08-27
# http://www.linuxjournal.com/content/convert-diff-output-colorized-html
# Modified by stopyoukid
#
html="<html><head><meta charset=\"utf-8\"><title>Pretty Diff</title><style>body {text-align: center;}#wrapper {display: inline-block;margin-top: 1em;min-width: 800px;text-align: left;}h2 {background: #fafafa;background: -moz-linear-gradient(#fafafa, #eaeaea);background: -webkit-linear-gradient(#fafafa, #eaeaea);-ms-filter: \"progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')\";border: 1px solid #d8d8d8;border-bottom: 0;color: #555;font: 14px sans-serif;overflow: hidden;padding: 10px 6px;text-shadow: 0 1px 0 white;margin: 0;}.file-diff {border: 1px solid #d8d8d8;margin-bottom: 1em;overflow: auto;padding: 0.5em 0;}.file-diff > div {width: 100%:}pre {margin: 0;font-family: \"Bitstream Vera Sans Mono\", Courier, monospace;font-size: 12px;line-height: 1.4em;text-indent: 0.5em;}.file {color:
@JalfResi
JalfResi / revprox.go
Last active July 26, 2024 15:18
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@davisford
davisford / Vagrantfile
Last active April 16, 2022 00:53
Vagrantfile with postgres
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
echo "-------------------- updating package lists"
apt-get update
@jrdmb
jrdmb / vba-sha-512.md
Last active June 5, 2020 05:24
VBA Code for SHA-512 hash using mscorlib.dll

Other links to creating SHA-512 hashes in various Windows apps:

The code below is adapted from: http://stackoverflow.com/questions/11394811/compute-sha512-on-vba-excel-2003

64-bit MS Access VBA code to calculate an SHA-512 or SHA-256 hash in VBA.  This requires a VBA reference to the .Net Framework 4.0 mscorlib.dll.  The hashed strings are calculated using calls to encryption methods built into mscorlib.dll.  The calculated hash strings are the same values as those calculated with jsSHA, a Javascript SHA implementation (see htt
@iamralch
iamralch / ssh_client.go
Last active April 16, 2023 03:09
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@belgattitude
belgattitude / install_phpexcel_php7.sh
Last active February 17, 2019 17:24
Install libxl, php_excel extension on PHP7.1 (ondrej/ppa)
#!/bin/bash
#
# ilia/php_excel extension example install script for PHP7+
#
# usage:
# > sudo ./install_phpexcel_php7.sh
# > (optionally) sudo service php7.1-fpm restart)
#
# requirements:
# - Ubuntu 64bits (trusty/xenial)
@popovserhii
popovserhii / install_phpexcel_php7.sh
Last active June 8, 2018 06:23 — forked from belgattitude/install_phpexcel_php7.sh
Install libxl, php_excel extension on PHP7 (main interpretator) on CentOS7 (ondrej/ppa)
#!/bin/bash
#
# ilia/php_excel extension example install script for PHP7+ on CentOS 7+ as base interpreatator
#
# usage:
# > ./install_phpexcel_php7.sh
# > (optionally) sudo service php7.0-fpm restart)
#
# requirements:
# - Ubuntu 64bits (trusty/xenial)
@aslakhellesoy
aslakhellesoy / bumbailiff
Last active February 19, 2021 10:03
You can have a little tech debt for a short time. After that the bumbailiff will be up your bum.
#!/usr/bin/env bash
#
# The bumbailiff allows the team to take up a small amount of technical debt
# (TODOs in the code) for a limited period. After that period the script fails.
#
# Originally written by Aslak Hellesoy
#
set -ef -o pipefail
IFS=$'\n' # make newlines the only separator
@marians
marians / main.go
Created January 27, 2017 10:25
OAuth 2.0 authentication in a Golang CLI
package main
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"net/url"
"time"