Skip to content

Instantly share code, notes, and snippets.

View sirhopcount's full-sized avatar

Adrian van Dongen sirhopcount

View GitHub Profile
#!/bin/bash
#
# This is the script responsible for updating our Puppet master data,
# which includes modules, manifests, hiera data, etc. All of this data is
# managed in a git repository and upon "deploy" it is synced into the Puppet
# master.
#
# This script mirrors the remote git repository, looking for branches that
# match "env-*" (such as "env-production" or "env-test"). Each of these branches
# is setup as an environment into the Puppet master's data files. The
@sirhopcount
sirhopcount / vrancid
Created November 26, 2012 13:37 — forked from davidkrider/vrancid
RANCID for Vyatta
#! /usr/bin/perl
#
# usage: vrancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
getopts('dflV');
if ($opt_V) {
print "rancid 2.3.6\n";
exit(0);
}
@sirhopcount
sirhopcount / find_uncommitted.rb
Created November 26, 2012 13:37 — forked from davidkrider/find_uncommitted.rb
Rancid script to find uncommitted changes which would be lost on a reboot
#!/usr/bin/ruby
File.open("all/router.db").each do |line|
(device, type, state) = line.split(":")
if state == "up\n"
if type == "vyatta"
command = "~/bin/clogin"
written = `#{command} -c 'cat /opt/vyatta/etc/config/config.boot' #{device} > #{dev`
running = `#{command} -c 'show configuration' #{device} > #{device}.running`
else
@sirhopcount
sirhopcount / .bashrc
Created December 7, 2012 05:21 — forked from elasticdog/.gitconfig
Git Workflow
### git aliases
# shortcut for git-add hunk staging
alias gap='git add --patch'
alias gmup='master_update'
alias gmpu='master_push'
alias gsyn='sync_repo'
alias gbcr='branch_create'
alias gbup='branch_update'
source "http://rubygems.org"
gem "rails", "3.2.5"
# Supported DBs
gem "sqlite3"
gem "mysql2"
# Auth
gem "devise", "~> 2.1.0"
Complete gem list for gitlab on raspberry pi (raspbian):
gitlab@raspberrypi:~/gitlab$ bundle list
Gems included by the bundle:
* actionmailer (3.2.5)
* actionpack (3.2.5)
* activemodel (3.2.5)
* activerecord (3.2.5)
* activeresource (3.2.5)
* activesupport (3.2.5)
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
aptitude install gitolite
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
su - git
{
"title": "Apache logs",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
grep {
type => "syslog"
match => [ "syslog_program", "drupal" ]
add_tag => "Drupal"
drop => false
}
grok {
type => "syslog"
tags => [ "Drupal" ]
match => [ "@message", "^https?://%{HOSTNAME:drupal_vhost}\|%{NUMBER:drupal_timestamp}\|(?<drupal_action>[^\|]*)\|%{IP:drupal_ip}\|(?<drupal_request_uri>[^\|]*)\|(?<drupal_referer>[^\|]*)\|(?<drupal_uid>[^\|]*)\|(?<drupal_link>[^\|]*)\|(?<drupal_message>.*)" ]