Skip to content

Instantly share code, notes, and snippets.

View dickolsson's full-sized avatar

Dick Olsson dickolsson

View GitHub Profile
@dickolsson
dickolsson / puppet-provisioner
Last active October 10, 2015 19:58
Puppet bootstrap script for Ubuntu servers.
#!/bin/bash
# Puppet bootstrapping. Currently only supports Ubuntu 12.04.
#
# TODO:
# - Make idempotent
# - Support Ubuntu 10.04 and Debian 6
version_os=`expr match "$(lsb_release -c)" '.*\<\(.*\)$'`
version_stdlib=03ec16e291a70ac5ac412be36ae3b86a771b98af
@dickolsson
dickolsson / drupal-provisioner
Last active June 8, 2017 15:55
Provisioning script for a simple PHP/Drupal development environment
#!/bin/bash
#
# Configure your IDE to listen to connections with these settings:
#
# * Max simultaneous connections: 3
# * Xdebug port: 9001
# * DBGp host: <blank>
# * DBGp port: 9001
# * IDE key: MYIDE
#
@dickolsson
dickolsson / Vagrantfile
Created October 7, 2014 19:12
Basic Vagrantfile
Vagrant.configure("2") do |c|
c.vm.box = "trusty"
c.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
c.vm.network :private_network, ip: "192.168.33.30"
c.ssh.forward_agent = true
c.vm.synced_folder "./html", "/var/www/html", nfs: true
c.vm.synced_folder "./src", "/usr/local/src", nfs: true
@dickolsson
dickolsson / backup.sh
Last active August 16, 2022 17:13
Simple backup script that will backup package list, files and databases.
#!/bin/sh
#
# A simple Arch Linux backup script.
#
# Example config that targets external mount, keeping backups for a week and
# mirror the backups to local and external disks:
#
# $ cat /etc/backuprc
# backup_target=/mnt/data01/myhost
# backup_days_kept=7

Keybase proof

I hereby claim:

  • I am dickolsson on github.
  • I am dickolsson (https://keybase.io/dickolsson) on keybase.
  • I have a public key whose fingerprint is F71C CD27 7C10 9E6A ED91 900F DDD7 F2AA E87B DA78

To claim this, I am signing this object:

@dickolsson
dickolsson / genesis.json
Last active March 6, 2025 13:57
Example genesis.json for an Ethereum blockchain
{
"config": {
"chainId": 33,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"nonce": "0x0000000000000033",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
@dickolsson
dickolsson / Migrations.sol
Last active June 18, 2017 09:08
Example migration contract for an Ethereum blockchain
pragma solidity ^0.4.4;
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) _;
}
@dickolsson
dickolsson / 1_initial_migration.js
Created June 18, 2017 09:08
Example deployment script of initial contract migrations for an Ethereum blockchain
var Migrations = artifacts.require("./Migrations.sol");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
@dickolsson
dickolsson / truffle.js
Created June 18, 2017 10:03
Example truffle.js for connecting to a local Ethereum blockchain
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*"
}
}
};
@dickolsson
dickolsson / IronDoers.sol
Last active January 8, 2018 12:05
Example contract of an organisation on an Ethereum blockchain
pragma solidity ^0.4.0;
contract IronDoers {
address public trustee;
mapping(address => bool) public doers;
uint public doerCount;
modifier onlyTrustee {
if (msg.sender != trustee) throw;