Skip to content

Instantly share code, notes, and snippets.

View turingmachine's full-sized avatar

Simon Josi turingmachine

View GitHub Profile
[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:
package{'postgresql-server':
ensure => present,
}
service{'postgresql':
enable => true,
ensure => running,
hasstatus => true,
require => Package[postgresql-server],
}
exec{'initialize_database':
#
# 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
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
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,
[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 => [
#!/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")
<?php
/*
Author: radiok
Plugin Name: Register Plus Redux
Author URI: http://radiok.info/
import os, sys, re, commands
from fabric.api import *
from fabric.contrib.console import *
from fabric.contrib.project import *
from fabric.contrib.files import contains, exists
import xmlrpclib
import pip
from itertools import izip_longest
from fabric.version import VERSION
<?php
function list_supporters() {
global $wpdb;
$wp_supporter_search = $wpdb->get_results("
SELECT user_id
FROM $wpdb->usermeta
WHERE meta_value = '1' AND user_id != '60'
ORDER BY user_id
");
foreach($wp_supporter_search as $supporter) {