Skip to content

Instantly share code, notes, and snippets.

cp /dev/null $AWS_ROOT_CA_FILE
for ca in \ \ \ \ \; do
actionjack / killAllBuilds.groovy
Created Mar 16, 2022 — forked from brandonfl/killAllBuilds.groovy
Kill all build and remove queued ones
View killAllBuilds.groovy
import java.util.ArrayList;
import hudson.model.*;
def q = Jenkins.instance.queue
for (queued in Jenkins.instance.queue.items) {
for (job in Jenkins.instance.items) {
actionjack /
Created Mar 9, 2022 — forked from nepsilon/
How to generate and apply patches with git? — First published in issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff > some-changes.patch
actionjack / Jenkinsfile.groovy
Created Feb 21, 2022 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
actionjack / seed-sqsqueue-with-s3-notification-messages
Created Feb 3, 2022 — forked from rprakashg/seed-sqsqueue-with-s3-notification-messages
bash script to create SQS messages for files added to S3 between a specific date range
View seed-sqsqueue-with-s3-notification-messages
purge-sqs-queue() {
if [ -z "$1" ]; then
echo "need to pass queue name prefix"
actionjack /
Created Jan 9, 2022 — forked from nikhan/
twitter ffmpeg
ffmpeg -i -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
import contextlib
import os
import tempfile
half_lambda_memory = 10**6 * (
int(os.getenv('AWS_LAMBDA_FUNCITON_MEMORY_SIZE', '0')) / 2)
actionjack /
Created Nov 18, 2021 — forked from wojteklu/
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

actionjack /
Created Jul 23, 2021 — forked from tswaters/
Adding subdirectory of a remote repo to a subdirectory in local repo

This is way more complicated than it should be. The following conditions need to be met :

  1. need to be able to track and merge in upstream changes
  2. don't want remote commit messages in master
  3. only interested in sub-directory of another repo
  4. needs to go in a subdirectory in my repo.

In this particular case, I'm interested in bringing in the 'default' template of jsdoc as a sub-directory in my project so I could potentially make changes to the markup it genereates while also being able to update from upstream if there are changes. Ideally their template should be a separate repo added to jsdoc via a submodule -- this way I could fork it and things would be much easier.... but, it is what it is.

After much struggling with git, subtree and git-subtree, I ended up finding this -- it basically sets up separate branches from tracking remote, the particular sub-directory, and uses git subtree contrib module to pull it all togther. Following are

View #1 Merging Rubygems and

Merging Rubygems and Bundler

set -eux
rm -rf rubygems bundler
git clone
git clone