Skip to content

Instantly share code, notes, and snippets.

@actionjack
actionjack / killAllBuilds.groovy
Created March 16, 2022 15:38 — forked from brandonfl/killAllBuilds.groovy
Kill all build and remove queued ones
import java.util.ArrayList;
import hudson.model.*;
def q = Jenkins.instance.queue
for (queued in Jenkins.instance.queue.items) {
q.cancel(queued.task)
}
for (job in Jenkins.instance.items) {
stopJobs(job)
@actionjack
actionjack / README-oneshot-systemd-service.md
Created September 7, 2018 15:17 — forked from drmalex07/README-oneshot-systemd-service.md
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@actionjack
actionjack / Papercuts.md
Last active May 23, 2017 04:04
PAPERCUTS.md

Paper cuts

This is a log of things that have hurt us in the current environment that while not necessarily being technical debt, could possibly be things for us to discuss and possibly fix in the future.

Table of contents

Issue 1

Issue 2

@svrist
svrist / cf_create_or_update.py
Created February 7, 2017 21:34
Update or create a CloudFormation stack given a name and template + params'
'Update or create a stack given a name and template + params'
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import logging
import json
import sys
import boto3
import botocore
@rprakashg
rprakashg / seed-sqsqueue-with-s3-notification-messages
Last active February 3, 2022 21:36
bash script to create SQS messages for files added to S3 between a specific date range
#!/bin/bash
profile={replace}
s3bucket={replace}
folder={specify}
queueprefix={replace}
purge-sqs-queue() {
if [ -z "$1" ]; then
echo "need to pass queue name prefix"
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active March 6, 2024 18:14
Jenkinsfile idiosynchrasies with escaping and quotes
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"
@rachelmyers
rachelmyers / Chromebook_setup.md
Last active October 25, 2023 10:00
How I set up my Chromebooks' dev environment

Chromebook Setup Options

Option 1: Stay in Chrome OS

If you're writing bare-bones javascript for the browser, creating Chrome Apps and Extensions, or using remote coding apps like cloud9, Koding, or Nitrous, you may not need to install Ubuntu. Some tutorials can be done entirely within the browser. The tradeoff is that you won't have a full-featured command line, and you may hit a point where you can't install something that you need.

To start coding within Chrome OS, install Text or Caret as a text editor. (Text stores files in Google Docs and Caret stores the files locally on your machine, which may help you choose.) After that, you're good to go, since Chromebooks come with a browser installed.

Optio

@actionjack
actionjack / concourse-example-tasks.md
Created November 25, 2015 11:42 — forked from drnic/concourse-example-tasks.md
A simple concourse example task - fork and try anything

Concourse Tutorial - Example Tasks

This gist includes some https://concourse.ci job tasks

  • hello-world.yml - displays "hello world"
  • display-other-task.yml - uses this task as a resource itself and displays the hello-world.yml YAML; assumes that the gist is available in the concourse pipeline as resource-gist.
  • display-other-task-renamed-resource-input.yml - is like the task above, but assumes the resource is now named gist rather than resource-gist
@keymon
keymon / README.md
Last active August 29, 2015 14:26
GNU plot ab performance and CPU for a tsuru installation

AB benchmark and plotting

Small script to execute a apache benchmark ab from one host to other.

The scripts are designed for benchmark tsuru routers, and compare between hipache+nginx vs. vulcand.

It will gather metrics of request time and CPU in the target so they can be later plot using gnuplot.

@phrawzty
phrawzty / S3_as_Yum_repo.md
Last active November 10, 2023 19:20
Use S3 as a Yum repo

S3 as Yum repo

There are two parts to this:

  • Managing access to non-public S3 resources.
  • Building RPM repositories in an automated, deterministic way that Yum can use.

Environment

In general, a CentOS 7 x86_64 box in AWS EC2; in specific, this Packer profile.