Skip to content

Instantly share code, notes, and snippets.

@jglick
jglick / slack.sh
Last active Jul 23, 2019
Script to launch Slack on Xubuntu with an icon
View slack.sh
#!/bin/bash -xe
# adapted from https://launchpadlibrarian.net/422519169/slack via https://bugs.launchpad.net/ubuntu/+source/xfwm4/+bug/1827302/comments/12
ICON=/snap/slack/current/usr/share/pixmaps/slack.png
nohup /snap/bin/slack
WINDOWS=
while [ -z "$WINDOWS" ]
do
@jglick
jglick / Dockerfile.minikube
Last active Sep 6, 2018 — forked from andrewjjenkins/Dockerfile.minikube
Istio-Minikube and Jenkins
View Dockerfile.minikube
# Portions Copyright 2016 The Kubernetes Authors All rights reserved.
# Portions Copyright 2018 AspenMesh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@jglick
jglick / backport.sh
Last active Jun 2, 2020
Example of setting up a Jenkins plugin backport branch
View backport.sh
export BASE=1.19 # or whatever; last release compatible with targeted core or other deps
export BASETAG=mystuff-${BASE} # or as per http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#tagNameFormat
export FIX=abcd1234 # whatever the backportable fix was, in master or somewhere newer than $BASE
git checkout -b ${BASE}.x $(git log --reverse --ancestry-path --pretty=%H ${BASETAG}..master | head -1)
# or for JEP-305 use: mvn versions:set-property -Dproperty=revision -DnewVersion=${BASE}.1
mvn versions:set -DnewVersion=${BASE}.1-SNAPSHOT
git commit -a -m "Prepare for ${BASE}.1"
git push -u origin ${BASE}.x
git cherry-pick -x -m1 $FIX
mvn -B release:{prepare,perform}
@jglick
jglick / .gitconfig
Created Oct 20, 2017
git first-child
View .gitconfig
[alias]
# http://stackoverflow.com/a/30010601/12916
first-child = "!f() { git log --reverse --ancestry-path --pretty=%H $1..${2:-HEAD} | head -1; }; f"
View .gitconfig
[alias]
out = !git log --patch-with-stat --irreversible-delete --find-renames @{u}.. > /tmp/out.diff && $EDITOR /tmp/out.diff
@jglick
jglick / find-git-unreleased.sh
Last active Jul 25, 2019
run with optional args, e.g., {workflow,pipeline}-*-plugin
View find-git-unreleased.sh
#!/bin/bash
# http://stackoverflow.com/a/37730085/12916
if [ $# -ge 1 ]
then
files="$@"
else
files=*
fi
for r in $files
do
@jglick
jglick / JENKINS-41745-proposal.md
Last active Aug 22, 2017
Proposal for JENKINS-41745: Remoting-free CLI
View JENKINS-41745-proposal.md

Summary

JENKINS-41745: Deprecate the Remoting-based protocol for the Jenkins CLI feature. Enhance the client and server to conveniently perform most existing CLI tasks with simpler and safer protocols.

Goals

@jglick
jglick / maven-release.sh
Last active Jul 17, 2018
Script to do a Maven release relatively safely
View maven-release.sh
#!/bin/sh
set -e
git branch
git status -s
git pull
git log --patch-with-stat --irreversible-delete --find-renames @{u}..
gitg
git tag --sort=version:refname
@jglick
jglick / git-grep-dired.el
Created Dec 8, 2016
Emacs command to look for a regexp among versioned files in a Git repo
View git-grep-dired.el
(defun git-grep-dired (repo wildcards regexp)
"Find Git-controlled files in DIR with a name like WILDCARDS containing a regexp REGEXP and start Dired on output."
(interactive "DGit-grep (directory): \nsGit-grep (filename wildcard(s), e.g. *.xml): \nsGit-grep (grep regexp): ")
(setq repo (file-name-as-directory (expand-file-name repo)))
(switch-to-buffer (concat "*Git Grep " repo "*"))
(fundamental-mode)
(setq buffer-read-only nil)
(erase-buffer)
(setq default-directory repo)
(let ((cmd (format "git --git-dir %s/.git ls-files -z%s | xargs -0 grep -lZ -- %s | xargs -0 ls -l"
View gist:b906ae79a0dd857dae0098453fe03612
… WARNING org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$6 onSuccess
Failed to abort Owner[…/…:… #…]
hudson.remoting.ChannelClosedException: channel is already closed
at hudson.remoting.Channel.send(Channel.java:578)
at hudson.remoting.Request.call(Request.java:130)
at hudson.remoting.Channel.call(Channel.java:780)
at hudson.Launcher$RemoteLauncher.launch(Launcher.java:928)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.Launcher$ProcStarter.join(Launcher.java:388)
at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Decorator$1.kill(WithContainerStep.java:237)
You can’t perform that action at this time.