Skip to content

Instantly share code, notes, and snippets.

View dicbobz's full-sized avatar

dicbob dicbobz

  • Drawbridge, Inc
  • San Francisco, CA
View GitHub Profile
### Keybase proof
I hereby claim:
* I am dicbobz on github.
* I am dicbobz (https://keybase.io/dicbobz) on keybase.
* I have a public key ASAi2ut3OP7h7LcufMHjJnHAu3nNGNNKa2ObPpJzyjPAeQo
To claim this, I am signing this object:
#!/bin/bash
# Check IP addres and convert to in-addr.arpa address
# Write the commands to a file. Then execute ./dns-import.log to run migration
FILE=$1
TMP="$(mktemp)"
LOG="$(pwd)/dns-import.log"
DOMAIN="domain.tld"
function validate_ip()
{
@dicbobz
dicbobz / Backup zone files to s3
Last active June 19, 2016 10:40
Backup BIND zone files to S3
#!/bin/sh
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
#### BEGIN CONFIG ####
# Make a temp file for list of file to backup
# Chroot breaks the ability to just backup the directory
OF=$(mktemp /tmp/tar_config.XXXX) || { echo "Can't get temp file"; exit 1; }
LIST=$OF
@dicbobz
dicbobz / main.yml
Last active September 23, 2015 04:19
#- include_vars: "{{ user_name }}.yml"
# with_first_found:
# - "{{ user_name }}.yml"
# - default.yml
- name: create group {{ user_group }}
group: name={{ user_group }} gid={{ user_id }} state={{ user_state }}
when: '"present" in user_state'
tags:
- users
@dicbobz
dicbobz / chgLDAPsshkey.py
Created July 28, 2015 08:43
Allow users to update their own ssh key
#!/usr/bin/python
# rick@drawbrid.ge
import sys
import ldap
import getpass
import struct
from base64 import decodestring as decode
import argparse
parser = argparse.ArgumentParser(description="Update SSH Keys")
parser.add_argument('--file','-f', action='store', type=str, nargs=1, default='~/.ssh/id_rsa.pub', help='Supply ssh public key file')
@dicbobz
dicbobz / chgLDAPpassword.py
Last active August 29, 2015 14:26
User self LDAP update script
#!/usr/bin/python
# rick@drawbrid.ge
import ldap
import hashlib
import os, sys
import getpass
from base64 import encodestring as encode
def makehash(password):
salt = os.urandom(4)