Skip to content

Instantly share code, notes, and snippets.

@vStone
vStone / keybase.md
Created August 11, 2016 06:10
Keybase proof

Keybase proof

I hereby claim:

  • I am vstone on github.
  • I am vstone (https://keybase.io/vstone) on keybase.
  • I have a public key ASCF9MBdc4aceHSGtMwqgiPx42QaaXu9Ge0GQZDfJgTLZQo

To claim this, I am signing this object:

@vStone
vStone / cleanup_plugins.sh
Created October 4, 2013 10:25
Cleanup old jenkins (plugin) packages
green='\033[0;32m'; red='\033[0;31m';
reset='\033[0m';
## Keep the haltest # number of versions for each plugin.
KEEP_PLUGINS=2
echo "Begin processing..."
count=$( ls *.rpm | grep -o "jenkins-plugin-[a-z]\+[0-9a-z-]*[0-9a-z]\+-" | sort | uniq | wc -l )
i=0
@vStone
vStone / squid.conf
Created August 20, 2013 08:47
Squid config I have on my synology using optware
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
@vStone
vStone / augeas console
Created May 30, 2013 17:12
Weird augeas automounter lens issue
augtool> print /files/etc/auto.test/*[label() != '#comment'][. = 'test']
/files/etc/auto.test/2 = "test"
/files/etc/auto.test/2/location
/files/etc/auto.test/2/location/1
/files/etc/auto.test/2/location/1/host = "localhost"
/files/etc/auto.test/2/location/1/path = "/my/path"
augtool> set /files/etc/auto.test/*[label() != '#comment'][. = 'test']/opt[last() + 1] nocto
augtool> print /files/etc/auto.test/*[label() != '#comment'][. = 'test']
@vStone
vStone / custom.pp
Created May 29, 2013 08:18
Dirty augeas from puppet apply hack
## Use a custom lens to do something.
class example::custom {
if $::servername {
} else {
warning("puppet apply runs do not detect the correct lensdir: using dirty hack")
$lensdir = inline_template("<%= File.expand_path(File.join(File.dirname(scope.source.file),'../lib/augeas/lenses')) %>")
Augeas {
load_path => "${lensdir}"
}
@vStone
vStone / gitolite-gitweb-command-web.sh
Last active December 17, 2015 09:49
Additional gitolite command to show or set gitweb.* configuration for user-created ("wild") repo.
#!/bin/sh
#
# Installation:
# To use this script, place it in the commands directory of your
# gitolite installation. (Hint: ~/gitolite/src/commands/)
# You will also have to add the command to the allowed commands in
# your .gitolite.rc configuration file.
#
# Permissions:
# The script requires the same permissions as the desc command.
@vStone
vStone / percona-node.pp
Created January 17, 2013 12:34
Setting the initial root password using puppet-percona
## github.com/UnifiedPost/puppet-percona (development)
node /^perconadb/ {
$adminpass = 'skittles'
percona::mgmt_cnf {'/etc/.puppet.cnf':
password => $adminpass,
}
class {'percona::adminpass': password => $adminpass }
class {'percona':
server => true,
mgmt_cnf => '/etc/.puppet.cnf',
@vStone
vStone / Gemfile
Created November 30, 2012 11:53
Rakefile for your puppet modules.
source :rubygems
gem 'rake'
gem 'rspec', '>2'
gem 'rspec-puppet'
gem 'puppetlabs_spec_helper'
## Optionally use puppet-lint for style checks.
#gem 'puppet-lint'
@vStone
vStone / noeolfile
Created August 3, 2012 09:18
Perl script to strip newline at end of files.
#!/usr/bin/perl
## Strips the newline from the end of a file.
# This is important because we cant have newlines after the pw hash.
# Run this on a file before committing.
use autodie qw(open sysseek sysread truncate);
my $file = shift;
open my $fh, '+>>', $file;
@vStone
vStone / params.pp
Created January 19, 2012 15:25
Example / Trial use case for 'dynamic' module incorp.
# === Actions:
#
# === Requires:
#
# === Sample Usage:
#
class passenger::params (
$packages = undef,
$configpath = undef,
$version = undef,