Skip to content

Instantly share code, notes, and snippets.

View sgwilbur's full-sized avatar
🧠
omg

Sean G Wilbur sgwilbur

🧠
omg
View GitHub Profile
@dirkraft
dirkraft / build.gradle
Last active June 23, 2017 15:00
A build.gradle project template, which bootstraps all necessary parts of a Java, Maven, IntelliJ project on GitHub with the minimum artifact publishing requirements to Sonatype's Maven central.
/* Root build.gradle for Java, Maven, and IntelliJ with Maven central POM. Assumes GitHub.
You should eventually read through and understand this entire Gradle script. Last tried with IntelliJ 2017.1.
Quick start:
- Copy this file into a directory named for your project.
- Choose one Gradle integration mode. Once chosen, stick to it.
IntelliJ Gradle integration:
- Import the project directory as a Gradle project.
- To change Gradle files, enable auto-synchronize or click the synchronize button in the Gradle panel.
@whiteinge
whiteinge / fabfile.py
Created November 13, 2009 17:16
Example fabric script with VirtualBox automation
# -*- coding: utf-8 -*-
"""MyCompany Fabric script.
* Deploy code
* Set up a local development environment
There are two ways to deploy the myrepo code:
1. :func:`deploy` will do a full virtualenv installation/update and expand a
tarball of the specified git revision (defaults to HEAD) to a timestamped
@wizardishungry
wizardishungry / Gemfile
Last active February 12, 2018 18:49
Vagrant snippet to set VirtualBox guest CPU count to the number of host cores on Linux or OS X (broken 2018)
gem 'concurrent'
@halcyonCorsair
halcyonCorsair / Vagrantfile
Created September 5, 2012 21:10
A json file for chef-solo, and the equivalent Vagrantfile to setup koha
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
@rtacconi
rtacconi / install-chef-12-6-0-amazon-linux
Last active October 29, 2020 13:58
Install chef server 12.6.0 on Amazon Linux
echo "127.0.0.1 AWSVC009 AWSVC009" >> /etc/hosts
yum update -y
wget https://packages.chef.io/stable/el/5/chef-server-core-12.6.0-1.el5.x86_64.rpm
rpm -Uvh chef-server-core-12.6.0-1.el5.x86_64.rpm
chef-server-ctl reconfigure
mkdir /home/ec2-user/cookbooks
chown ec2-user /home/ec2-user/cookbooks
mkdir /home/ec2-user/.chef
chown ec2-user /home/ec2-user/.chef
@fnichol
fnichol / README.md
Last active August 6, 2022 20:29
Testing on Mac Platforms with Test Kitchen

Testing Mac Platforms with Test Kitchen

We'll assume an OS X Mavericks (10.9) box here.

Requirements

You'll need:

  • Vagrant
  • Vagrant's VMware Fusion provider
@jbarber
jbarber / LdapAuth.java
Created June 11, 2012 12:20
LDAP example for searching and simple binding (authentication)
/*
* First create the keystore (to allow SSL protection) by importing the LDAP
* certificate (cert.pem) with:
* keytool -import -keystore keystore -storepass changeit -noprompt -file cert.pem
*
* You can get the certificate with OpenSSL:
* openssl s_client -connect ldap.server.com:636 </dev/null 2>/dev/null | sed -n '/^-----BEGIN/,/^-----END/ { p }' > cert.pem
*
* Then compile this class with:
* javac LdapAuth.java
@arcaduf
arcaduf / Python: read and dump dictionary to YAML preserving order
Created January 15, 2018 10:08
Python: read and dump dictionary to YAML preserving order
```python
import collections , yaml
_mapping_tag = yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG
def dict_representer(dumper, data):
return dumper.represent_mapping(_mapping_tag, data.iteritems())
def dict_constructor(loader, node):
return collections.OrderedDict(loader.construct_pairs(node))
@vmassuchetto
vmassuchetto / purge.sh
Last active August 2, 2023 15:07 — forked from adrienbrault/purge.sh
Script to clean a Vagrant box before packaging it. Updated to work with Debian and some additional directories. It's also less general and does not remove any system packages at all.
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
# - https://gist.github.com/adrienbrault/3775253
# Unmount project
umount /vagrant
@phred
phred / pedantically_commented_playbook.yml
Last active November 3, 2023 01:55
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####