Skip to content

Instantly share code, notes, and snippets.

View Justin-Schmitz's full-sized avatar

Justin Schmitz Justin-Schmitz

View GitHub Profile
@EikeDehling
EikeDehling / install-beats.sh
Created September 14, 2017 11:00
Install filebeat & metricbeat on debian (as root)
# Install filebeat & metricbeat
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list
apt-get update
apt-get install filebeat metricbeat
# Configure filebeat
cat >/etc/filebeat/filebeat.yml <<EOL
filebeat.prospectors:
@abstractart
abstractart / books.md
Last active February 28, 2025 11:33
Free Programming Ebooks - O'Reilly Media. Codeship free ebooks here - https://bit.ly/2oQ0knQ
@soerenmartius
soerenmartius / jenkins-kill-jobs-for-a-specific-project.groovy
Created June 28, 2017 12:09
jenkins kill all jobs for a specific project
import hudson.model.FreeStyleBuild
import hudson.model.Result
import hudson.model.Run
import jenkins.model.Jenkins
import org.jenkinsci.plugins.workflow.job.WorkflowRun
import org.jenkinsci.plugins.workflow.support.steps.StageStepExecution
if(!binding.hasVariable('dryRun')) {
dryRun = true
}
MAX_BUILDS = 5
MAX_ENV_BUILDS = 2
Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob.class).each { it ->
def job = Jenkins.instance.getItemByFullName(it.fullName, Job.class)
def limit = (it.fullName =~ /^environment/) ? MAX_ENV_BUILDS : MAX_BUILDS
def recent = job.getBuilds().limit(limit)
println "Processing job " + it.fullName + " " + it.class + " BuildCount: " + job.getBuilds().size() + " Limit: " + limit
@gergo-dryrun
gergo-dryrun / policy.yaml
Created March 19, 2017 17:37
Chaining FN::Sub/Select/Split/Ref
LambdaRolePolicies:
Type: AWS::IAM::Policy
Properties:
PolicyName: es-http-permissions
PolicyDocument:
Version: 2012-10-17
Statement:
-
Effect: Allow
Action:
@abayer
abayer / Jenkinsfile
Created February 15, 2017 15:17
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@schnell18
schnell18 / macosx_remove_java9.sh
Created October 8, 2016 13:26
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
#from post
#http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
#Delete stopped (exited) containers:
docker ps --no-trunc -aqf "status=exited" | xargs docker rm
#Delete unused (dangling) images:
docker images --no-trunc -aqf "dangling=true" | xargs docker rmi
@dwilkie
dwilkie / docker-cheat-sheat.md
Last active May 12, 2024 14:08
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes