Open ~/.bash_profile in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {| # https://docs.docker.com/compose/yml/ | |
| # Each service defined in docker-compose.yml must specify exactly one of | |
| # image or build. Other keys are optional, and are analogous to their | |
| # docker run command-line counterparts. | |
| # | |
| # As with docker run, options specified in the Dockerfile (e.g., CMD, | |
| # EXPOSE, VOLUME, ENV) are respected by default - you don't need to | |
| # specify them again in docker-compose.yml. | |
| # | |
| service_name: |
| param($username, $password, $command, $arguments = " ") | |
| # Don't use c:\windows\temp below, as standard users don't have access to it | |
| $errfile = "c:\users\public\runas_error.txt" | |
| $outfile = "c:\users\public\runas_out.txt" | |
| $envusername = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name | |
| write-host "Supplied Username = " $username | |
| write-host "Env Username = " $envusername | |
| write-host "Password = " $password |
| { | |
| "AWSTemplateFormatVersion" : "2010-09-09", | |
| "Description": "Deis on EC2: http://deis.io/", | |
| "Parameters" : { | |
| "KeyPair" : { | |
| "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the Deis hosts", | |
| "Type" : "String", | |
| "MinLength": "1", | |
| "MaxLength": "64", | |
| "AllowedPattern" : "[-_ a-zA-Z0-9]*", |
| #!/bin/bash | |
| # Author: Erik Kristensen | |
| # Email: erik@erikkristensen.com | |
| # License: MIT | |
| # Nagios Usage: check_nrpe!check_docker_container!_container_id_ | |
| # Usage: ./check_docker_container.sh _container_id_ | |
| # | |
| # Depending on your docker configuration, root might be required. If your nrpe user has rights | |
| # to talk to the docker daemon, then root is not required. This is why root privileges are not |
| #! /bin/bash | |
| # HEADS UP! Make sure to use '*' or a valid hostname for the FDQN prompt | |
| echo 01 > ca.srl | |
| openssl genrsa -des3 -out ca-key.pem | |
| openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem | |
| openssl genrsa -des3 -out server-key.pem | |
| openssl req -new -key server-key.pem -out server.csr |
| import javax.net.ssl.SSLParameters; | |
| import javax.net.ssl.SSLSocket; | |
| import javax.net.ssl.SSLSocketFactory; | |
| import java.io.*; | |
| /** Establish a SSL connection to a host and port, writes a byte and | |
| * prints the response. See | |
| * http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services | |
| */ | |
| public class SSLPoke { |
| #!/usr/bin/python | |
| import urllib2 | |
| import json | |
| apikey = '' | |
| user = '' | |
| baseurl = '' | |
| query_enable = { 'is_enabled' : True } |
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
| """ | |
| IAM boto examples: | |
| In this example we create a group that provides access | |
| to all EC2 and S3 resources and actions and then add a | |
| user to that group. | |
| """ | |
| import boto | |
| # | |
| # First create a connection to the IAM service |