Skip to content

Instantly share code, notes, and snippets.

View darkpixel's full-sized avatar

Aaron C. de Bruyn darkpixel

View GitHub Profile
# Quick-and-dirty how-to for wrapping salt traffic in spiped. Critiques welcome. You'll probably need to adjust slightly if you aren't using FreeBSD.
# There's a great write-up with pictures here: https://hackacad.net/security/2020/05/06/how-to-secure-you-salstack-salt-master-using-spiped.html
## Master
# /usr/local/etc/salt/master needs to be bound to localhost, and it's better to be explicit than implicit with your ports.
interface: 127.0.0.1
publish_port: 4505
ret_port: 4506
@artschwagerb
artschwagerb / gist:35130c93b276d6aa2b05
Created January 28, 2015 18:25
Python LDAP - Change Password
def changePassword(user_dn, old_password, new_password):
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
l = ldap.initialize("LDAPS://DOMAIN.COM")
l.set_option(ldap.OPT_REFERRALS,0)
l.set_option(ldap.OPT_PROTOCOL_VERSION,3)
l.set_option(ldap.OPT_X_TLS,ldap.OPT_X_TLS_DEMAND)
l.set_option(ldap.OPT_X_TLS_DEMAND,True)
l.set_option(ldap.OPT_DEBUG_LEVEL,255)
l.simple_bind_s("[email protected]", "PASSWORD")
@temoto
temoto / clean-requirements.py
Created July 3, 2014 14:01
Helper to clean requirements.txt from unused dependencies
#!/usr/bin/env python
from __future__ import print_function
import argparse
import collections
import re
import subprocess
import sys
KNOWN_IMPORT_PACKAGE_MAP = {
@blackjid
blackjid / README.md
Last active August 29, 2015 14:01
Google Calendar Attendees widget for Dashing

Description

A Dashing widget for displaying the number of attendees for a specific calendar event on Google Calendar

It's specially designed to be used against a recursive event. For example, we use it at platanus to show how many people and who is going to have lunch in the office.

screen shot

Made by platanus in Chile

@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active November 7, 2024 12:23
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@taylor
taylor / README.md
Created November 17, 2011 11:09
wrapper to support SSH SRV records

Introduction

ssh-srv-wrapper is bash shell script which tries to find a SSH SRV record for the first host and uses what is found rather than what was passed (if a valid record is found).

Install

Run the script directly or feel free to rename or symlink to the name ssh. It will look for another ssh in your path to execute.

@saghul
saghul / pydmesg
Created August 21, 2010 20:00
pydmesg: dmesg with human readable timestamps
#!/usr/bin/env python
# coding=utf8
# Copyright (C) 2010 Saúl ibarra Corretgé <[email protected]>
#
"""
pydmesg: dmesg with human-readable timestamps
"""
@m0n5t3r
m0n5t3r / gunicorn-upstart.conf.template
Created July 30, 2010 12:27
template for a gunicorn upstart job that can run several instances of a django application
# %(mysite)s - run %(mysite)s instances (default is the main production instance)
#
# This runs gunicorn-django for %(mysite)s; to install:
# * sudo ln -s <this file> /etc/init/%(mysite)s
# * sudo initctl reload-configuration
#
# it expects the following directory layout:
#
# /home/%(mysite)s/public_html
# \-env -> virtualenv