Skip to content

Instantly share code, notes, and snippets.

💭
.

Paul Tötterman ptman

Block or report user

Report or block ptman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ptman
ptman / runrole.yaml
Created Sep 6, 2018
Ansible runrole playbook
View runrole.yaml
# vim: set ft=yaml:
# usage: ansible-playbook -l test -e role=debian runrole.yaml
---
- hosts: all
remote_user: "{{remote_user|default('root')}}"
become: true
roles:
- '{{role}}'
@ptman
ptman / determrand.py
Created Mar 22, 2016
Deterministic "random" numbers filter_plugin for ansible
View determrand.py
# vim: set ft=python:
"""Deterministic "random" numbers jinja filter for ansible.
Place in filter_plugins/ to use.
"""
import random
def determrand(high, seed, low=0):
@ptman
ptman / reversestringer.go
Created Nov 12, 2015
Complement for go stringer
View reversestringer.go
import "strings"
func ParseType(s string) Type {
return parseType(0, s)
}
func parseType(i int, s string) Type {
j := strings.Index(_Type_name[i:], s)
if j == -1 {
View wordlist-v0.732.txt
abraham
absent
absorb
absurd
academy
accent
acid
acrobat
action
active
View keybase.md

Keybase proof

I hereby claim:

  • I am ptman on github.
  • I am ptman (https://keybase.io/ptman) on keybase.
  • I have a public key whose fingerprint is 64EA 32C2 AF36 C731 5C6F 4A1F B107 C10B AE7B 74EC

To claim this, I am signing this object:

@ptman
ptman / lookup_plugins:ldap_sshkeys.py
Last active Jan 23, 2019
Trying to get and use complex data from LDAP for Ansible.replace : in filename with /
View lookup_plugins:ldap_sshkeys.py
# vim: set si ai et sw=4 sts=4 ts=4 ft=python:
# coding: utf-8
# Copyright (c) 2013, ZenRobotics Ltd.
# Author: Paul Tötterman <paul.totterman@zenrobotics.com>
"""Ansible lookup plugin for looking up user data in an LDAP directory."""
from ansible import utils, errors
import ldap
@ptman
ptman / watchdog.ps1
Created Sep 19, 2013
SuperMicro IPMI Watchdog for Windows
View watchdog.ps1
# coding: utf-8
# vim: set ts=4 sw=4 sts=4 si ai et ft=powershell:
# Copyright (c) 2013, ZenRobotics Ltd.
# author: Paul Tötterman <paul.totterman@zenrobotics.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
View ipm.py
#!/usr/bin/env python
# coding: utf-8
# vim: set ts=4 sts=4 sw=4 si ai et ft=python:
# author: Paul Tötterman <paul.totterman@zenrobotics.com>
#
# Copyright (c) 2013, ZenRobotics Ltd.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
@ptman
ptman / ssh_scan_keys.py
Created Jul 12, 2013
Usage: ./ssh_scan_keys.py /home /export/home
View ssh_scan_keys.py
#!/usr/bin/env python
# coding: utf-8
# vim: set ts=4 sts=4 sw=4 si ai et ft=python:
# author: Paul Tötterman <paul.totterman@zenrobotics.com>
#
# Copyright (c) 2013, ZenRobotics Ltd.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
@ptman
ptman / dhcpd.conf.erb
Created Jun 11, 2013
Build dhcpd.conf based on information in LDAP, using erb templating in puppet.
View dhcpd.conf.erb
# file managed by puppet
<%# Copyright (c) 2013, ZenRobotics Ltd. All rights reserved. %>
<%
require 'ipaddr'
raise Puppet::Error, 'Could not set up LDAP Connection: Missing ruby/ldap libraries' unless Puppet.features.ldap?
conn = Puppet::Util::Ldap::Connection.instance
conn.start
connection = conn.connection
base = Puppet.settings[:ldapbase]
You can’t perform that action at this time.