Skip to content

Instantly share code, notes, and snippets.

John Weldon johnweldon

Block or report user

Report or block johnweldon

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
@johnweldon
johnweldon / start-sshagent
Created Dec 20, 2011
powershell script to start the ssh-agent
View start-sshagent
$ gcm start-sshagent | fl
Name : start-sshagent
CommandType : Function
Definition :
if($env:SSH_AGENT_PID) { echo "ssh-agent running"; return }
$private:gp = get-gitbinpath
if($private:gp) {
$private:out = & (join-path $private:gp "ssh-agent")
View test_12063689.sql
DROP TABLE tempA; CREATE TABLE tempA ( style_cd CHAR(3), id_cd VARCHAR(15) );
DROP TABLE tempB; CREATE TABLE tempB ( item_desc VARCHAR(50), item_num CHAR(4), style_cd CHAR(3), id_cd VARCHAR(15) );
INSERT INTO tempA
SELECT 'A', 123456
UNION SELECT 'A', 654321
UNION SELECT 'B', 321456
UNION SELECT 'A', 654123
UNION SELECT 'C', 424242;
@johnweldon
johnweldon / read_xlsx.cs
Created Oct 9, 2012
Read Excel .xlsx file and return first worksheet as a DataTable
View read_xlsx.cs
using System.Data;
using System.Data.OleDb;
using System.Diagnostics;
namespace JW4.DB.Util
{
public static class Excel
{
public static DataTable GetFirstWorksheetAsTable(string filename)
{
View git-recent
#!/bin/bash
read -r -d '' AWK <<EOF
{
date=\$1;
refname=\$2;
subject=substr(\$3,1,72);
sha=\$4;
len=split(refname, ref, "/");
View synmon-prod-2016.04.08-14.00.04.log.txt
-------------------- Starting drone test 1 ------------------------
TRACE 2016/04/08 14:00:04 synmon.go:130: Starting task id 1 Login Test for iteration 0
TRACE 2016/04/08 14:00:04 drone.go:35: Start Drone Login Test
TRACE 2016/04/08 14:00:04 drone.go:44: Successfully got current user: syntheticmonitortool@gmail.com
TRACE 2016/04/08 14:00:04 drone.go:45: {"remote":"","login":"syntheticmonitor","name":"","email":"syntheticmonitortool@gmail.com","gravatar":"","admin":false,"active":true,"syncing":false,"created_at":0,"updated_at":0,"token":""}
TRACE 2016/04/08 14:00:04 util.go:96: file(2016.04.08/synmon-prod-2016.04.08-14.00.04.log) url() errorstring()
14:00 | Login Test | ID: 1 | 19.365907ms | | 👍 OK
INFO 2016/04/08 14:00:05 util.go:184: Task Info:
Task Status: Ok
@johnweldon
johnweldon / debug.go
Created Apr 26, 2016
Useful http debugging file. Replaces http.DefaultTransport with a logger of all http traffic.
View debug.go
package main
import (
"fmt"
"io"
"net/http"
"net/http/httputil"
"os"
)
View keybase.md

Keybase proof

I hereby claim:

  • I am johnweldon on github.
  • I am johnweldon (https://keybase.io/johnweldon) on keybase.
  • I have a public key whose fingerprint is 77E9 1E85 501D 0B6A 476D 9B39 9CF9 AF9D 7956 0500

To claim this, I am signing this object:

View crash.log
2016/10/24 23:09:18 [INFO] Terraform version: 0.7.7
2016/10/24 23:09:18 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.7.7/bin/terraform", "state", "show"}
2016/10/24 23:09:18 [DEBUG] Detected home directory from env var: /Users/weldon
2016/10/24 23:09:18 [DEBUG] Detected home directory from env var: /Users/weldon
2016/10/24 23:09:18 [DEBUG] Attempting to open CLI config file: /Users/weldon/.terraformrc
2016/10/24 23:09:18 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2016/10/24 23:09:18 [DEBUG] Detected home directory from env var: /Users/weldon
2016/10/24 23:09:18 [TRACE] Preserving existing state lineage "bd67628c-5cf1-46c6-adb0-036a829b75e1"
2016/10/24 23:09:18 [TRACE] Preserving existing state lineage "bd67628c-5cf1-46c6-adb0-036a829b75e1"
2016/10/24 23:09:18 [DEBUG] plugin: waiting for all plugin processes to complete...
@johnweldon
johnweldon / update_dynamic_dns
Created Mar 4, 2018
bash script to update dynamic dns ip address on google domains from a Zyxel C3000Z modem
View update_dynamic_dns
#!/usr/bin/env bash
#
# Update Google Domains Dynamic DNS from Zyxel C3000Z modem information.
# Tested on a Centurylink issued modem, YMMV
#
# See https://support.google.com/domains/answer/6147083?hl=en for
# Google Domains help and credentials information
#
View exception.txt
13-Mar-2018 15:19:18.744 INFO [http://stage.cacurrent.net/rest/job] org.apache.catalina.core.ApplicationContext.log RestletServlet: [Restlet] ServerServlet: component class is null
13-Mar-2018 17:01:18.624 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.xwiki.container.servlet.XWikiServletContextListener]
java.lang.ClassCastException: org.xwiki.environment.internal.StandardEnvironment cannot be cast to org.xwiki.environment.internal.ServletEnvironment
at org.xwiki.container.servlet.XWikiServletContextListener.contextInitialized(XWikiServletContextListener.java:85)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4579)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5041)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catal
You can’t perform that action at this time.