Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import click
from glob import glob
import graphviz as gv
import os
import sys
import yaml
''' Generate a directed graph of ansible role dependencies.
@oodavid
oodavid / ssl-letsencrypt-auto-renew.sh
Last active January 11, 2023 22:17
Automatically renew letsencrypt SSL certificates via cron.
#!/bin/bash
# Source
# https://gist.github.com/oodavid/54cadfb92ff49618797d
# Adapted from
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04
# Make sure this is added to the crontab, ie:
# sudo crontab -e
# 30 2 * * 1 /home/ubuntu/khan-draw/ssl-letsencrypt-auto-renew.sh >> /var/log/ssl-letsencrypt-auto-renew.log
# Config
@ManzDev
ManzDev / reducepdf.bat
Last active November 1, 2019 11:21
Reduce size PDF file (needs GhostScript)
@echo off
chcp 1252 >nul
set argc=0
for %%x in (%*) do set /a argc+=1
if [%argc%] == [0] goto syntax
if [%argc%] == [1] goto default
if [%argc%] == [2] goto param
@jbtule
jbtule / build.fsx
Last active March 24, 2020 16:06
Crossplatform FSharp Makefile Bootstrapper
#!/bin/sh
#if run_with_bin_sh
# Doing this because arguments can't be used with /usr/bin/env on linux, just mac
exec fsharpi --define:mono_posix --exec $0 $*
#endif
(*
* Crossplatform FSharp Makefile Bootstrapper
* Apache licensed - Copyright 2014 Jay Tuley <jay+code@tuley.name>
* v 2.0 https://gist.github.com/jbtule/9243729
070-158 - TS: Forefront Identity Manager, Configuring
070-177 - TS: Microsoft Project Server 2010, Configuring
070-178 - Microsoft Project 2010, Managing Projects
070-243 - Administer & Deploy System Center 2012 Config Manager
070-246 - Private Cloud Monitoring & Operations w/System Center 2012
070-247 - Private Cloud Config & Deployment w/System Center 2012
070-321 - Deploying Office 365
070-323 - Administering Office 365
070-331 - Core Solutions of MS SharePoint Server 2013
070-332 - Advanced Solutions of MS SharePoint Server 2013
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@tony4d
tony4d / p4merge4git.md
Created August 24, 2012 19:00
Setup p4merge as a visual diff and merge tool for git
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@pwenzel
pwenzel / git-log-to-tsv.sh
Created June 6, 2012 20:53
Git Log to Tab-Delimited CSV File
# Local Dates:
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
# ISO Dates:
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
@ioc32
ioc32 / ip6.addressing.sample.dot
Created June 4, 2012 18:04
IPv6 sample addressing plan Graphviz visualization
digraph unix {
node [color=lightblue2, style=filled];
"AS64496?\n2001:db8::/32";
"DC1?\n2001:db8:0TTT::/36";
"DC2?\n2001:db8:4TTT::/36";
"AS64496?\n2001:db8::/32" -> "DC1?\n2001:db8:0TTT::/36"
"AS64496?\n2001:db8::/32" -> "DC2?\n2001:db8:4TTT::/36"
"DC1?\n2001:db8:0TTT::/36" -> "INFRA?\n2001:db8:0:TXXX::/48\n2001:db8:0::/48";
"DC1?\n2001:db8:0TTT::/36" -> "VIP1?\n2001:db8:100::/46";