Skip to content

Instantly share code, notes, and snippets.

@carlosrodlop
carlosrodlop / quietShutDownBeforeDrain.sh
Created December 22, 2021 12:59
Bash script to move Jenkins apps to "quietmode" for a specific time passed as parameter before draining node of your CI k8s cluster
#!/bin/bash
set -euo pipefail
shopt -s inherit_errexit nullglob compat"${BASH_COMPAT=42}"
#Parameters
JENKINS_USER_ID=example.user
JENKINS_API_TOKEN=******
JENKINS_NS_LIST=("ns-example-1" "ns-example-2")
SLEEP_SEC=3600
  1. Generate the file:
$ awk 'BEGIN { for(c=0;c<10000000;c++) printf "<p>LOL</p>" }' > 100M.html
$ (for I in `seq 1 100`; do cat 100M.html; done) | pv | gzip -9 > 10G.boomgz
  1. Check it is indeed good:
@shortjared
shortjared / list.txt
Last active April 28, 2024 07:20
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@regis-leray
regis-leray / release-git-script
Last active March 25, 2023 20:50
Release script using git and maven release plugin. Based on the "successful git branch model" and https://gist.github.com/searls/1043970 Its also managed the hotfix feature
#!/bin/bash
# How to perform a release with git & maven following the git flow conventions
# ----------------------------------------------------------------------------
# Finding the next version: you can see the next version by looking at the
# version element in "pom.xml" and lopping off "-SNAPSHOT". To illustrate,
# if the pom's version read "0.0.2-SNAPSHOT", the following instructions would
# perform the release for version "0.0.2" and increment the development version
# of each project to "0.0.3-SNAPSHOT".
#
@jhidalgo3
jhidalgo3 / downloader.js
Last active January 16, 2021 09:48
Use NodeJS to download files
var path = require('path');
var url = require('url');
var http = require('http');
var fs = require('fs');
var write_file;
//what global variable do we have?
var complete = false;
var content_length = 0;
var downloaded_bytes = 0;
@SeonghoonKim
SeonghoonKim / elasticsearch-bootstrap.sh
Created December 26, 2012 09:31
elasticsearch install script
#!/bin/bash
INSTALL_ROOT="/opt"
echo "Installing ElasticSearch..."
cd $INSTALL_ROOT
curl -L http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.1.tar.gz | tar -xz
ln -s elasticsearch-0.20.1/ elasticsearch
echo "Installing ElasticSearch service wrapper..."
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
@searls
searls / maven-git-flow.sh
Created June 24, 2011 00:25
My approximation of nvie's git flow when using maven-release-plugin to cut releases. - http://nvie.com/posts/a-successful-git-branching-model/
# How to perform a release with git & maven following the git flow conventions
# ----------------------------------------------------------------------------
# Finding the next version: you can see the next version by looking at the
# version element in "pom.xml" and lopping off "-SNAPSHOT". To illustrate,
# if the pom's version read "0.0.2-SNAPSHOT", the following instructions would
# perform the release for version "0.0.2" and increment the development version
# of each project to "0.0.3-SNAPSHOT".
# branch from develop to a new release branch
git checkout develop