This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Author: radiok | |
Plugin Name: Register Plus Redux | |
Author URI: http://radiok.info/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class SubsetSum | |
attr_accessor :nearest | |
def initialize(items, target) | |
@nearest = 0 | |
for combination_dec in 1..(2**items.size - 1) | |
subset_sum = 0 | |
combination_bin = combination_dec.to_s(base=2).rjust(items.size, "0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@host ~]# test `ls -1 /dev/iscsi* | wc -l` -eq 0 | |
[root@host ~]# echo $? | |
1 | |
class iscsi | |
... | |
file{'/etc/iscsi/iscsid.conf': | |
content => template('iscsi/iscsid.conf.erb'), | |
require => Package['iscsi-initiator-utils'], | |
notify => [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class disks::dbserver_domu::pgsql { | |
# write ahead log (WAL) | |
file{'/srv/db_rw_log/pgsql': | |
ensure => directory, | |
require => Mount['/srv/db_rw_log'], | |
owner => postgres, group => postgres, mode => 0700; | |
} | |
file{'/var/lib/pgsql': | |
ensure => directory, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'puppet/util' | |
require 'puppet/util/logging' | |
require 'erb' | |
# A template wrapper that evaluates a template in the | |
# context of a resource, allowing the resource attributes | |
# to be looked up from within the template. | |
# This provides functionality essentially equivalent to | |
# the language's template() function. You pass your file | |
# path and the resource you want to use into the initialization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# iscsi module | |
# | |
# Copyright 2008, Puzzle ITC GmbH | |
# Marcel Härry haerry+puppet(at)puzzle.ch | |
# Simon Josi josi+puppet(at)puzzle.ch | |
# | |
# This program is free software; you can redistribute | |
# it and/or modify it under the terms of the GNU | |
# General Public License version 3 as published by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package{'postgresql-server': | |
ensure => present, | |
} | |
service{'postgresql': | |
enable => true, | |
ensure => running, | |
hasstatus => true, | |
require => Package[postgresql-server], | |
} | |
exec{'initialize_database': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@arcos src]# flashrom-0.9.1/flashrom -w 8DTN5049.ROM | |
flashrom v0.9.1-r710 | |
No coreboot table found. | |
Found chipset "Intel ICH10R", enabling flash write... OK. | |
This chipset supports the following protocols: LPC,FWH,SPI. | |
Calibrating delay loop... OK. | |
Found chip "Atmel AT25DF321" (4096 KB, SPI) at physical address 0xffc00000. | |
Flash image seems to be a legacy BIOS. Disabling checks. | |
Writing flash chip... Programming page: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Puppet, la solution de gestion de configuration système. | |
Le framework Puppet vous offre le moyen de formaliser les directives que | |
vous souhaitez imposer dans votre infrastructure informatique, d'appliquer | |
ces directives sur vos serveurs pour composer vos services, et finalement | |
de superviser et d'ajuster ces directives pour permettre une évolution dans | |
le temps de votre parc. | |
Puppet permet de concevoir une infrastructure totalement automatisée, sans | |
intervention humaine. Les avantages d'une telle infrastructure vont au-delà |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time augtool match /files/etc/services/service-name hp-collector | |
/files/etc/services/service-name[899] | |
/files/etc/services/service-name[900] | |
real 9m57.568s | |
user 9m30.142s | |
sys 0m0.818s |