% Eating Habits % John Doe % September, 27 2013
- Eat eggs
- Drink coffee
map.namespace :ubiquo do |ubiquo| | |
ubiquo.with_options :path_prefix => 'admin' do |admin| | |
admin.resources :articles | |
end | |
end |
require 'monitor' | |
queue = [] | |
queue.extend(MonitorMixin) | |
cond = queue.new_cond | |
consumers, producers = [], [] | |
for i in 0..5 | |
consumers << Thread.start(i) do |i| | |
print "consumer start #{i}\n" |
# encoding: utf-8 | |
require 'date' | |
# Validation of Czech (Slovak) birth number | |
class BirthNumberValidator < ActiveModel::EachValidator | |
attr_reader :record, :attribute, :value | |
RC_FORMAT = Regexp.compile /^\s*(\d\d)(\d\d)(\d\d)[ -\/]*(\d\d\d)(\d?)\s*$/ | |
def validate_each(record, attribute, value) | |
@record, @attribute, @value = record, attribute, value |
require 'benchmark' | |
require 'set' | |
n = 100000 | |
bench = {} | |
set = Set.new | |
array = Array.new | |
rand= Random.new |
class apt::repo { | |
# Base Directory shortcut | |
$basedir = '/var/www/apt/repo' | |
# Main reprepro class | |
class { 'reprepro': | |
basedir => $basedir, | |
} |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: graphite-api | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: graphite api init script | |
# Description: An init script for Graphite's API daemon. | |
### END INIT INFO |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: rserve | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Startup script for RServe | |
# Description: Rserve is a server for execution of R code | |
### END INIT INFO |
Debug: /Stage[main]/Accounts::Groups/require: requires Class[Accounts::Users] | |
Debug: /Stage[main]/Accounts::Users/Accounts::User[john]/User[john]/require: requires Anchor[accounts::user::groups::john] | |
Debug: /Stage[main]/Accounts::Users/Accounts::User[john]/File[/home/john/.ssh]/require: requires File[/home/john] | |
Debug: /Stage[main]/Accounts::Users/Accounts::User[john]/File[/home/john/.ssh]/before: requires File[/home/john/.ssh/authorized_keys] | |
Debug: /Stage[main]/Accounts::Users/Accounts::User[john]/Group[john]/before: requires Anchor[accounts::user::groups::john] | |
Debug: /Stage[main]/Accounts::Users/Accounts::User[john]/Ssh_authorized_key[john_ssh-rsa]/require: requires File[/home/john/.ssh/authorized_keys] | |
Debug: /Stage[main]/Accounts::Users/Accounts::User[john]/File[/home/john/.ssh]: Autorequiring |
#!/bin/sh | |
puppet module install deric-accounts | |
mkdir -p /etc/puppet/hieradata | |
cat <<EOF > /etc/puppet/hiera.yaml | |
--- | |
:backends: | |
- yaml | |
:hierarchy: | |
- common |