Skip to content

Instantly share code, notes, and snippets.

Torkild U. Resheim turesheim

Block or report user

Report or block turesheim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@turesheim
turesheim / envoy.yaml
Created Oct 31, 2019
Envoy configuration for handling gRPC and HTTP requests to the same port
View envoy.yaml
# =============================================================================
# This Envoy configuration allows gRPC and HTTP/2 connections to be sent to the
# same port. The URL to the gRPC service must be prefixed with "/grpc", for
# instance "http://192.168.1.10/grpc" and will be directed to port 8082. The
# normal HTTP/2 calls will be directed to port 8084.
# =============================================================================
admin:
access_log_path: /tmp/admin_access.log
address:
@turesheim
turesheim / java.zsh
Last active Mar 21, 2018
maxOS Zsh script to easily switch between Java versions
View java.zsh
#!/usr/local/bin/zsh
# Add aliases for changing java runtime
alias j6='ju 1.6'
alias j7='ju 1.7'
alias j8='ju 1.8'
alias j9='ju 9'
# Prints the path to JAVA_HOME
alias jh=/usr/libexec/java_home
@turesheim
turesheim / style.css
Last active Aug 6, 2017
GitHub style for Eclipse WikiText
View style.css
body {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
text-size-adjust: 100%;
color: #333;
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
font-size: 0.8em;
line-height: 1.6;
word-wrap: break-word;
}
@turesheim
turesheim / keybase.md
Last active Apr 7, 2016
Keybase proof
View keybase.md

Keybase proof

I hereby claim:

  • I am turesheim on github.
  • I am tur (https://keybase.io/tur) on keybase.
  • I have a public key whose fingerprint is F8D8 A122 8186 3176 DCAA C1DA F243 E32D AAB6 F214

To claim this, I am signing this object:

View install-bamboo.sh
#!/bin/bash
# This Bash script will set up an Ubuntu installation so that it will be able
# to build SIMA.
t=$(tempfile) || exit
trap "rm -f -- '$t'" EXIT
# We need this for dialogs
#command -v dialog >/dev/null 2>&1 || { sudo apt-get install dialog }
@turesheim
turesheim / pixma2pdf.sh
Last active Dec 27, 2015
Bash script to scan documents to PDF.
View pixma2pdf.sh
#!/bin/bash
#-----------------------------------------------------------------------------
# pixma2pdf.sh version 3.0
#
# Copyright (c) 2009, 2013 Torkild U. Resheim - torkildr@gmail.com
# Released under the Eclipse Public License version 1.0
#-----------------------------------------------------------------------------
t=$(tempfile) || exit
trap "rm -f -- '$t'" EXIT
@turesheim
turesheim / derby
Created Jul 17, 2013
Apache Derby startup script.
View derby
#!/bin/bash
#
# Startup script for Derby
#
# chkconfig: 345 94 16
# description: Derby startup script
# to enable on bootup on redhat "chkconfig --level 35 derby on"
# to enable on bootup on debian "update-rc.d derby defaults" or the
# slightly longer (but better run levels) "update-rc.d derby start 91 2 3 4 5 . stop 20 0 1 6 ."
@turesheim
turesheim / close-issues.sh
Last active Dec 14, 2015
Bash script for closing issues 50-5000 that were inadvertently created using Zapier synchronization.
View close-issues.sh
#!/bin/sh
for issue in {50..5000}
do
echo "Closing issue #$issue"
curl --progress-bar --user "<github-user>:<github-password>" -X PATCH \
--data '{"state":"closed","title":"Inadvertently created by Zapier sync","body":""}' \
https://api.github.com/repos/<github-user>/<github-repo>/issues/$issue > /dev/null
done
View avahi-alias.py
#! /usr/bin/env python
'''
Register a mDNS/DNS-SD alias name for your computer using the Avahi daemon
This script will register an alternate CNAME alias besides your hostname,
which could be useful for ex. when serving several http virtual hosts to
your ffriends on the local network and you don't want to make them configure
their /etc/hosts.
Why a CNAME? You could also publish your current address with avahi-publish-address
@turesheim
turesheim / EPUBFileUtil.java
Created Mar 15, 2012
Various file utilities originally written for the EPUB utilities in Mylyn Docs, but contains useful bits that can be taken elsewhere.
View EPUBFileUtil.java
/*******************************************************************************
* Copyright (c) 2011,2012 Torkild U. Resheim.
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Torkild U. Resheim - initial API and implementation
*******************************************************************************/
You can’t perform that action at this time.