Skip to content

Instantly share code, notes, and snippets.

View jeremypruitt's full-sized avatar
:octocat:
@ Waabi.ai

Jeremy Pruitt jeremypruitt

:octocat:
@ Waabi.ai
View GitHub Profile
@yashh
yashh / lync_bot.py
Created July 26, 2014 23:53
Python lync API bot
import base64, copy, sys
import requests
import json
from urlparse import urlparse
sip_domain = "company.com"
username = "[email protected]"
password = "somepassword"
def extractAuthURL(str):
marked = require('marked')
hyperglue = require('hyperglue')
html = '<div id="hoho"></div>'
html = hyperglue(html, {'div#hoho':marked('# what what')})
console.log(html)
@trondhindenes
trondhindenes / configure-ansibletarget.ps1
Last active August 2, 2024 13:26
Configure Windows 2008R2/2012/2012R2 for SSL-based remoting
Param (
[string]$SubjectName = $env:COMPUTERNAME,
[int]$CertValidityDays = 365,
$CreateSelfSignedCert = $true
)
#region function defs
Function New-LegacySelfSignedCert
{
@maxim
maxim / tasks.yml
Created June 26, 2014 21:02
How to recursilvely chmod dirs and files (separately) with Ansible, without always seeing "changed" status.
- name: ensure all dir permissions are set correctly
shell: find /my/dir -type d -print0 | xargs -0 chmod -c 2755
register: chmod_result
changed_when: "chmod_result.stdout != \"\""
- name: ensure all file permissions are set correctly
shell: find /my/dir -type f -print0 | xargs -0 chmod -c 0650
register: chmod_result
changed_when: "chmod_result.stdout != \"\""
@saicoder
saicoder / amazon_eb_deploy.rb
Created June 17, 2014 15:54
amazon_elasticbeanstalk_deploy
#!/usr/bin/env ruby
`rm -rf tmp/*`
puts 'Temp cleared'
`rm -rf public/assets`
puts 'Assets cleared'
`say "Compiling assets"`
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active March 25, 2025 12:44
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@halberom
halberom / output
Created June 5, 2014 10:36
ansible - using lookup to get a date timestamp into a variable
...
TASK: [debug var=mydate] ******************************************************
ok: [localhost] => {
"mydate": "20140605101824"
}
...
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@hostmaster
hostmaster / authorized_keys.j2
Last active August 2, 2021 20:02
Purge unmanaged keys from ~/.ssh/authorized_keys , keep only listed public keys
# {{ ansible_managed }}
{% for key in pub_keys.results %}
{{ key.stdout }}
{% endfor %}
@hostmaster
hostmaster / deploy-github-pub-keys.yml
Last active August 29, 2015 14:01
Use public keys from github accounts for authorized_key file
# github_pub_keys:
# - username1
# - username2
- shell: curl -s "https://github.com/{{ item }}.keys"
with_items: github_pub_keys
register: pub_keys
changed_when: False
tags: keys