Skip to content

Instantly share code, notes, and snippets.

@bjoernalbers
bjoernalbers / osx_service.rb
Created September 30, 2016 21:11
osx_service - Ansible module to manage launchd services on Mac OS X
#!/usr/bin/ruby
# WANT_JSON
#
# osx_service - Ansible module to manage launchd services on Mac OS X
#
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Björn Albers <bjoernalbers@gmail.com>
#
@ksylvan
ksylvan / gist:2aacf2b466741a5468b2ea7ab475ee97
Last active October 10, 2017 13:52
Ansible playbook for fixing up a Mac Dock using dockutil
# Based on https://blog.vandenbrand.org/2016/01/04/how-to-automate-your-mac-os-x-setup-with-ansible/
#
- hosts: all
tasks:
- name: Current Dock names
shell: >
dockutil --list |
python -c 'import sys; [sys.stdout.write(line.split("\t")[0] + "\n")
for line in sys.stdin]'
register: dockitems
@madalinignisca
madalinignisca / readme.markdown
Last active August 24, 2022 06:10 — forked from larrybotha/readme.markdown
Postfix Using Mailhog to capture email for web development

Configure Postfix for Localhost SMTP in Mac OSX Mavericks with Mailhog

Using Homebrew install mailhog and enable the service as instructed in the installation.

Open in any browser http://localhost:8025

Edit file /etc/postfix/main.cf

sudo vim /etc/postfix/main.cf
@cecil
cecil / makerepo.yaml
Last active October 9, 2023 13:33
ansible playbook to create a local yum http repo
---
- hosts: hou-dc-repo
tasks:
- name: confirm apache createrepo rsync installed
yum: name={{item}} state=installed
with_items:
- httpd
- createrepo
- rsync
- name: create dirs for centos6 and EPEL repo
@rb2k
rb2k / gist:8372402
Last active April 15, 2024 19:30
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {