Skip to content

Instantly share code, notes, and snippets.

View fvoges's full-sized avatar
:octocat:

Federico Voges fvoges

:octocat:
View GitHub Profile
@fvoges
fvoges / .gitconfig
Created September 26, 2016 09:25 — forked from hunner/.gitconfig
Pretty format `git lg`
[alias]
# See http://cat.pdx.edu/~hunner/git-lg.png for an example
lg = "log --decorate --pretty=format:'%C(yellow)%h%C(reset) %C(green)%G?%C(reset) %C(blue)%an%C(reset) %C(cyan)%cr%C(reset) %s %C(auto)%d%C(reset)' --graph --date-order"
@fvoges
fvoges / nginx.conf
Created August 8, 2016 00:16 — forked from bradleyboy/nginx.conf
nginx rewrite setup for Koken
# Enable gzip. Highly recommending for best peformance
gzip on;
gzip_comp_level 6;
gzip_types text/html text/css text/javascript application/json application/javascript application/x-javascript;
# By default, do not set expire headers
expires 0;
# Set expires header for console CSS and JS.
# These files are timestamped with each new release, so it is safe to cache them agressively.
@fvoges
fvoges / windows_dev_node.pp
Created June 7, 2016 17:23 — forked from natemccurdy/windows_dev_node.pp
Bootstrap to make editing code on Windows better
# GETTING STARTED
# 1. Install the Puppet agent from http://downloads.puppetlabs.com/windows/puppet-agent-1.3.6-x64.msi
# 2. puppet module install chocolatey-chocolatey
# 3. puppet module install cyberious-apm
# 4. puppet apply windows_dev_node.pp
include chocolatey
$choco_packages = [
'git',
@fvoges
fvoges / 0_pw_hash.rb
Created March 3, 2016 14:29 — forked from pschyska/0_pw_hash.rb
PW hashing with puppet parser function
# lib/puppet/parser/functions/pw_hash.rb
module Puppet::Parser::Functions
newfunction(:pw_hash, type: :rvalue) do |args|
raise Puppet::ParseError, "pw_hash takes exactly two arguments, #{args.length} provided" if args.length != 2
# SHA512 ($6), default number of rounds (5000)
# rounds could be specified by prepending rounds=<n>$ parameter before the salt, i.e.
# args[0].crypt("$6$rounds=50000$#{args[1]}")
args[0].crypt("$6$#{args[1]}")
end
@fvoges
fvoges / initialize.rules
Created November 3, 2015 18:53
Initialize all Values which are still Uninitialized after startup
// Imports
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
rule "Initialize all items"
when
System started
then
@fvoges
fvoges / puppet_cron
Last active August 29, 2015 14:27 — forked from npwalker/puppet_cron
A puppet manifest to disable the pe-puppet daemon and instead enable a cron job to run puppet with a random starting time. This will help avoid a thundering herd problem.
$first_run = fqdn_rand(30)
$second_run = fqdn_rand(30) + 30
cron { 'cron.puppet':
command => "/opt/puppet/bin/puppet agent -t > /dev/null",
user => "root",
minute => [ $first_run, $second_run ],
}
# make sure we haven't started the pe-puppet daemon ever
@fvoges
fvoges / request.php
Last active August 29, 2015 14:17 — forked from zllovesuki/request.php
<?php
$website = 'http://yourwebsite.com'; //no trailing slash
$key = 'kokenwtf';
/*
*
* RUNNING ON A MACHINE THAT HAS UNLIMITED EXECUTION TIME IS HIGHLY ENCOURAGED
<?php
$retina = true;
$key = 'kokenwtf'; //ENTER YOUR OWN KEY
if ($_GET['key'] != $key) die;
$ds = DIRECTORY_SEPARATOR;
$root = dirname(__FILE__);
$content = $root . $ds . 'storage';
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to generate a KML.
"""

Puppet with Jenkins

Setup Jenkins

With Puppet:

puppet module install rtyler-jenkins

puppet apply -v -e "include jenkins"