Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
jedi4ever / gist:898114
Created April 1, 2011 13:06
update jenkins Updatecenter from CLI
$ java -jar jenkins-cli.jar -s http://localhost:9000 install-plugin findbugs
findbugs is neither a valid file, URL, nor a plugin artifact name in the update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/update-center.json
findbugs looks like a short plugin name. Did you mean 'null'?
# Specifying a full URL works!
$ java -jar jenkins-cli.jar -s http://localhost:9020 install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi
# Get the update center ourself
@kirbysayshi
kirbysayshi / mass-aggregation-change.sh
Created November 23, 2011 17:14
quick examples of how to change many many wsp (graphite/whisper) files settings
for f in $(find $1 -iname "*.wsp"); do
if [ -a $f ];
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max;
fi;
done
@KylePDavis
KylePDavis / sh_env_var_opts.sh
Last active September 14, 2023 01:26
Simple bash shell script templates. There are two versions: 1) simple env var based options, and 2) with added command line argument parsing and error handling.
#!/bin/bash -e
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE
# USAGE:
# DESCRIPTION OF ENV VARS HERE
###############################################################################
set -e # exit on command errors (so you MUST handle exit codes properly!)
set -o pipefail # capture fail exit codes in piped commands
#set -x # execution tracing debug messages
# Get command info
for (anItem in hudson.model.Hudson.instance.getQueue().getItems()) {
anItem.doCancelQueue()
}
@brobertsaz
brobertsaz / serversetup.md
Last active July 6, 2020 08:56
Ubuntu 12.04 Ruby, Rails, Nginx, Unicorn

Ubuntu 12.04, Ruby, Rails, Nginx, Unicorn and git-deploy

In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.

Server Setup

  • Create new server
  • Login to new server
    • ssh root@IPaddress (you can also use the domain name if you have the DNS setup already)
    • accept the RSA key
@killme2008
killme2008 / solr_monitor.rb
Last active December 18, 2015 07:37
A nagios plugin ruby script to monitor solr cloud cluster
####
# Description:a nagios plugin script to monitor solr cloud cluster
# Requirements: zookeeper
# sudo gem install zookeeper
# sudo gem install rsolr
#
#####
require 'rubygems'
require 'zookeeper'
require 'rsolr'
@bcarlin
bcarlin / .bashrc
Last active July 12, 2019 17:23
Alias for sublime text to automatically open a project when calling "subl" if a .sublime-project file is found in the current directory.This alias declaration to put in a bashrc file.
# [...]
function project_aware_subl {
project_file=$(ls *.sublime-project 2>/dev/null | head -n 1)
command subl ${*:-${project_file:-.}}
}
alias subl="project_aware_subl"
# [...]
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@oogali
oogali / ssh-tab-completion.bash
Created July 11, 2013 13:58
Should have known better than to paste into HN...
# Tab completion for scp/sftp/ssh based on ~/.ssh/config
complete -o default -o nospace -W "$(/usr/bin/ruby -ne 'puts $_.split(/[\s,]+/)[1..-1].reject { |h| h.match /\*|\?/ } if $_.match /^\s*Host[s]*\s+/' < ~/.ssh/config)" scp sftp ssh 2>/dev/null
@jkrell
jkrell / check_solr_cloud.py
Created September 12, 2013 13:02
A simple python script for checking status of a SolrCloud instance using Nagios
#!/usr/bin/python2.7
"""
check_solr_cloud.py
Nagios plugin for checking the status of a SolrCloud instance by
examining the clusterstate.json file on zookeeper.
Usage:
check_solr_cloud.py --zkhosts=<zookeeper hosts> --collection=<collection>