Skip to content

Instantly share code, notes, and snippets.

@mhoran
mhoran / mailcomplete.vim
Last active December 1, 2022 01:10
goobook omnicomplete with awk ported to vimscript!
" http://recursivedream.com/blog/2012/auto-completing-google-contacts-in-vim/
" Escape query and handle goobook errors
function! mailcomplete#Complete(findstart, base)
if a:findstart == 1
let line = getline('.')
let idx = col('.')
while idx > 0
let idx -= 1
let c = line[idx]
" break on header and previous email
// ==UserScript==
// @name noVNC Paste
// @include https://portal.arpnetworks.com/noVNC/console?*
// @version 1.0
// ==/UserScript==
function sendString () {
var str = prompt("Please enter a string to paste");
if (!str)
return;
@mhoran
mhoran / tarsnap.sh
Created September 23, 2011 02:06
tarsnap script
#!/bin/sh
PATH=/usr/local/bin:$PATH
PREFIX=`hostname -s`
format=%Y%m%d
DATE=`date +$format`
echo "Creating ${PREFIX}_$DATE"
tarsnap -cf ${PREFIX}_$DATE --quiet -X `dirname $0`/tarsnap-exclude /
#!/usr/bin/python3
try:
from configparser import RawConfigParser as ConfigParser
except ImportError:
from ConfigParser import ConfigParser
class T(ConfigParser):
def __init__(self, conf_dir=None):
ConfigParser.__init__(self, {"a": "False"})
#!/bin/sh -e
# Email used for registration and recovery contact.
EMAIL=""
BASEDIR="%%ETCDIR%%"
SSLDIR="%%PREFIX%%/etc/ssl/lego"
DOMAINSFILE="${BASEDIR}/domains.txt"
if [ -z "${EMAIL}" ]; then
@mhoran
mhoran / periodic.conf
Last active April 16, 2019 14:35
Configuration for lego peroidic script
# generate two certificates
weekly_lego_certificates="one two"
# account for the certificates
weekly_lego_account="matt@matthoran.com"
# default flags if not overridden per certificate
weekly_lego_global_flags="--path /usr/local/etc/ssl/lego --email ${weekly_lego_account} --http --http.webroot /usr/local/www/acme"
weekly_lego_renew_flags="--days 30"
@mhoran
mhoran / tarsnap.user.js
Last active April 14, 2019 01:21
Tarsnap Account Activity
// ==UserScript==
// @name Tarsnap Account Activity
// @namespace https://gist.github.com/mhoran/
// @include https://www.tarsnap.com/manage.cgi?address=*
// @version 1.0
// ==/UserScript==
by_machine_view = document.body.innerHTML.indexOf('usage by machine') > -1;
verbose_view = document.body.innerHTML.indexOf('account activity (verbose)') > -1;
package main
import (
"fmt"
"net/http"
"os"
"time"
)
func main() {
index d8e31a8..a0cfd53 100644
--- a/CircuitBreaker/src/AspDotNet4/FortuneTeller/Fortune-Teller-UI4/appsettings.json
+++ b/CircuitBreaker/src/AspDotNet4/FortuneTeller/Fortune-Teller-UI4/appsettings.json
@@ -12,6 +12,9 @@
}
},
"hystrix": {
+ "stream": {
+ "validate_certificates": false
+ },
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<!--
For more information about unattended.xml please refer too
http://technet.microsoft.com/en-us/library/cc722132(v=ws.10).aspx
-->
<settings pass="generalize">
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>