Skip to content

Instantly share code, notes, and snippets.

View mrintegrity's full-sized avatar

Alan McGinlay mrintegrity

View GitHub Profile
@mrintegrity
mrintegrity / DanskeBank.php
Created January 31, 2012 21:48 — forked from fasmide/DanskeBank.php
Danske Bank console app and php class
<?
class DanskeBank {
private $_magicKey;
private $_curlHandle;
public function __construct()
{
$this->_curlHandle = curl_init();
$data = array(
'os' => 'Android', //hmmf tried with php_uname('s') but then the service rejects logins
'model' => php_uname('m'),
# Definition: pound::listener
#
# This class installs Pound listeners
#
# Parameters:
# - The $listen_ip to configure the ip that the listener will listen on
# - The $listen_port to configure the port that the listener will listen on
# - The $listen_protocol to configure the protocol that the listener accepts (currently http or https)
# - The $ssl_cert_path to set the location of the SSL certificate if the listen_protocol is https
# - The $head_require to set the required header to allow connections through to the backend
# poundtest.pp
node 'poundtest' {
include pound
pound::listener {
testlistener :
listen_ip => '10.10.10.10',
listen_port => '80',
listen_protocol => 'ListenHTTP',
head_require => 'Host: .*www.example.com*',
backend_ip => '10.0.100.10',
# Class: pound
#
# This module manages pound
#
# Parameters:
#
# Actions:
#
# Requires:
#
@mrintegrity
mrintegrity / dumpoverssh.sh
Created September 26, 2012 08:15 — forked from kirkegaard/dumpoverssh.sh
pipe a mysql dump through gzip and send it over ssh
mysqldump -u MYSQL_USERNAME -p YOUR_DATABASE | gzip -c | ssh USERNAME@YOUR_TO_HOST 'cat > ~/dump.sql.gz'
apt::source { 'quantal':
location => 'http://se.archive.ubuntu.com/ubuntu',
release => 'quantal',
repos => 'universe',
pin => '-10',
include_src => true
}
root@puppet:~# echo include puppet, puppet::server, foreman, foreman_proxy | puppet apply --modulepath $MODULE_PATH
notice: /Stage[main]/Puppet::Server::Passenger/File[/etc/default/puppetmaster]/ensure: defined content as '{md5}0f7a068f943de1ee1568c7da292c1e06'
notice: /Stage[main]/Tftp::Install/Package[syslinux]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Foreman::Install/Foreman::Install::Repos[foreman]/File[/etc/apt/sources.list.d/foreman.list]/ensure: defined content as '{md5}22d4e292d3323e9ccbe1471fa3d3cde0'
notice: /Stage[main]/Foreman::Install/Foreman::Install::Repos[foreman]/Exec[foreman-key-foreman]: Triggered 'refresh' from 1 events
notice: /Stage[main]/Foreman::Install/Foreman::Install::Repos[foreman]/Exec[update-apt-foreman]: Triggered 'refresh' from 1 events
err: /Stage[main]/Foreman::Install/Package[foreman-sqlite3]/ensure: change from purged to latest failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install foreman-sqlite3'
Started GET "/compute_resources/1-asdf_drs/vms" for 1xx.xx.xx.2 at Tue Oct 09 13:25:00 +0200 2012
Processing by ComputeResourcesVmsController#index as HTML
Parameters: {"compute_resource_id"=>"1-kista_drs"}
Operation FAILED: undefined method `[]=' for nil:NilClass
Rendered common/500.rhtml (4.0ms)
Completed 500 Internal Server Error in 18087ms (Views: 10.1ms | ActiveRecord: 8.2ms)
err: /Stage[main]/Foreman::Install/Package[foreman-sqlite3]/ensure: change from absent to latest failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install foreman-sqlite3' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
foreman-sqlite3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up foreman (1.0.1+ubuntu1) ...
dpkg: error processing foreman (--configure):
subprocess installed post-installation script returned error exit status 6
foreman@puppet:~$ ./extras/dbmigrate
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== ChangeHostBuildDefaultToFalse: migrating ==================================
-- change_column(:hosts, :build, :boolean, {:default=>false})
-> 0.0071s
rake aborted!
An error has occurred, all later migrations canceled: