Skip to content

Instantly share code, notes, and snippets.

View rbramwell's full-sized avatar
🚀
Blazing a trail the likes of which has never been seen.

Rory Bramwell rbramwell

🚀
Blazing a trail the likes of which has never been seen.
View GitHub Profile
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@gschueler
gschueler / Curl job run.md
Created January 18, 2011 04:07
How to run a rundeck job using curl

Run a Job using Curl

This document describes how to use CURL to interact with the RunDeck server to invoke a Job to run.

The steps are as follows:

  1. Authenticate to the RunDeck server and acquire a session cookie.
  2. Submit run request for particular Job ID, sending session cookie.
@marvin
marvin / gist:1017389
Created June 9, 2011 18:27
ruby regular expression validate http, email, ip, netmask, ip in range
validate email: /\A([\w\.\-\+]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
validate url: ^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix
validate ip: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i
validate ip ranges: /^\b(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-4]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9]?)\b$/i
validate netmask: /^(((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(0|128|192|224|240|248|252|254)\.0\.0)|(255\.255\.(0|128|192|224|240|248|252|254)\.0)|(255\.255\.255\.(0|128|192|224|240|248|252|254)))$/i
@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@cluther
cluther / zenoss-shell-functions
Last active January 7, 2020 21:58
Zenoss JSON API Examples (curl)
# This shell script is intended to be sourced into your shell. It adds
# Default Zenoss server settings.
[ -z "$ZENOSS_URL" ] && export ZENOSS_URL="http://localhost:8080"
[ -z "$ZENOSS_USERNAME" ] && export ZENOSS_USERNAME="admin"
[ -z "$ZENOSS_PASSWORD" ] && export ZENOSS_PASSWORD="zenoss"
# Generic call to make Zenoss JSON API calls easier on the shell.
zenoss_api () {
ROUTER_ENDPOINT=$1
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@wting
wting / dreamhost_python_setup.sh
Created May 31, 2012 00:16
Dreamhost Python Setup script
#!/usr/bin/env bash
# Written by William Ting for the following blog post:
# http://williamting.com/posts/2012/04/18/set-up-python-and-django-on-dreamhost/
rcfile="${HOME}/.bashrc"
version="2.7.3"
setuptools_version="2.7"
tmp_dir="${HOME}/tmp-${RANDOM}"
if [[ ${#} == 0 ]]; then
@stephenc
stephenc / gist:3053561
Created July 5, 2012 13:05
Continuous Deployment with Jenkins and Puppet

Puppet with Jenkins

Setup Jenkins

With Puppet:

puppet module install rtyler-jenkins

puppet apply -v -e "include jenkins"

@leifg
leifg / Vagrantfile
Last active November 12, 2023 08:31
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
@fclairamb
fclairamb / log4j2.rolling.xml
Last active April 6, 2023 16:45
log4j2.xml sample setup files: * rolling: To enable rolling logging. * setup file to log on file (rotation should be handled by logrote), syslog (to collect all the logs from the different services) and console...
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<properties>
<property name="name">app</property>
<property name="pattern">%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5.5p | %-10.10t | %-20.20C:%-5.5L | %msg%n</property>
<!--
It will look like that:
2013-04-03 07:37:51.993 | WARN | main | lnetgateway.Server:56 | My app is logging stuff
-->
</properties>