Skip to content

Instantly share code, notes, and snippets.

@thomaslorentsen
thomaslorentsen / Dockerfile
Created March 2, 2022 17:57
Jenkins Agent with Docker installed
FROM jenkins/agent:latest-jdk11
USER root
RUN apt-get update \
&& apt-get install -y \
curl \
unzip \
rsync \
apt-transport-https \
@thomaslorentsen
thomaslorentsen / README.md
Created January 11, 2022 23:37
Split strings in bash

Example Usage

cat data.csv | sed s/","/" "/g | xargs -L 1 | split.sh
@thomaslorentsen
thomaslorentsen / main.py
Created October 5, 2020 12:38
Test connection with Python 2.7 Lambda
import json
import urllib2
import ssl
def lambda_handler(event, context):
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
@thomaslorentsen
thomaslorentsen / jenkins.java
Created June 6, 2019 22:41
Run shell commands in jenkins
process = Runtime.getRuntime().exec("echo hello")
process.waitFor()
input = process.getInputStream()
while ((c=input.read()) != -1) {
print((char) c);
}
@thomaslorentsen
thomaslorentsen / minikube.md
Last active March 19, 2019 12:33
minikube
@thomaslorentsen
thomaslorentsen / .gitconfig
Created October 26, 2018 09:20
Git Config
[core]
excludesfile = ~/.gitignore_global
editor = nano
[user]
email =
name =
signingkey =
[color]
ui = true
[commit]

Skip all symlinks that are absolute. Good for doing data migrations to another disk in a live system.

rsync -va --safe-links /from/ /to
@thomaslorentsen
thomaslorentsen / server.go
Last active December 20, 2017 19:11
Test server shutdown
package main
import "log"
import "net/http"
import "github.com/gorilla/mux"
import "os"
import "time"
var server *http.Server
@thomaslorentsen
thomaslorentsen / kubernetes.md
Last active October 20, 2017 12:37
Getting Started With Kubernetes

Kubernetes

Installing

Install on OSX with"

brew cask install minikube

Then install kubectl

curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.7.5/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
@thomaslorentsen
thomaslorentsen / minishift.md
Last active October 20, 2017 13:18
MiniShift

Install MiniShift

brew cask install minishift

The upgrade MiniShift with:

minishift update