Skip to content

Instantly share code, notes, and snippets.

View stevenscg's full-sized avatar

Chris Stevens stevenscg

View GitHub Profile
@skippy
skippy / ENVs
Last active August 29, 2016 20:29
managing vault tls
you'll want to setup ENVs, such as:
(dockerfile)
```
ENV VAULT_ADDR "https://active.vault.service.capsci:8200"
ENV VAULT_CACERT "/vault/config/vault_tls.ca"
ENV CURL_CA_BUNDLE "/vault/config/vault_tls.ca"
```
/vault/config/vault_tls.ca is pre-cached from when vault is initally bootstrapped and the PKI instance is initalized. But once it is, and you put it into your container, you are good to go.
@redconfetti
redconfetti / main.yml
Created March 4, 2016 04:04
Ansible - Remote User Config
# /ansible/roles/remote-user/tasks/main.yml
#
---
- name: Test Default SSH port
local_action: wait_for port=22 timeout=5 host={{inventory_hostname}}
register: default_ssh
ignore_errors: true
- name: set ansible_ssh_port to default
set_fact: ansible_ssh_port=22
1. No way of reusing task output in main play.
2. Cannot specify multiple fail_when statements.
3. [*] A play is atomic, i.e. I can't take the output from a command, parse its json then act on it. I need to create an intermediary fact containing the json dict then use that in another play. It's tedious.
4. If you're missing a variable in a variable file, Ansible won't fail to parse it. It will just tell you "VARIABLE IS NOT DEFINED!," which is ambiguous
5. Doing anything "complicated" (like looping within a loop for deeply nested Ansible variables) is right out.
6. selectattr doesn't actually do what you think it does!
7. Missing vars within tasks or roles can lead to very very VERY cryptic errors
8. So you can't set booleans with set_facts without casting......... https://github.com/ansible/ansible/issues/5463
9. It would be great if I could say something like:
@jefferai
jefferai / pkitest.sh
Created January 20, 2016 00:47
PKI test script
#!/bin/bash
vault mount -path=rootpki pki
vault mount-tune -max-lease-ttl="175200h" rootpki
vault write rootpki/root/generate/exported common_name=example.com ttl="175200h"
vault write rootpki/root/generate/internal common_name=example.com ttl="175200h"
vault write rootpki/intermediate/generate/exported common_name=example.com ttl="175200h"
vault write rootpki/intermediate/generate/internal common_name=example.com ttl="175200h"
vault mount -path=intermediatepki pki
vault mount-tune -max-lease-ttl="8760h" intermediatepki
@stephenturner
stephenturner / install-gcc48-linuxbrew-centos6.md
Last active March 6, 2022 02:49
Installing gcc 4.8 and Linuxbrew on CentOS 6

Installing gcc 4.8 and Linuxbrew on CentOS 6

The GCC distributed with CentOS 6 is 4.4.7, which is pretty outdated. I'd like to use gcc 4.8+. Also, when trying to install Linuxbrew you run into a dependency loop where Homebrew's gcc depends on zlib, which depends on gcc. Here's how I solved the problem.

Note: Requires sudo privileges.

Resources:

@viesti
viesti / ec2_group_set
Created October 11, 2015 19:28
Alter security groups on EC2 nodes
#!/usr/bin/python
from boto.ec2 import connect_to_region
from boto.ec2.group import Group
def main():
module = AnsibleModule(
argument_spec = dict(
ec2_id = dict(required=True),
group_names = dict(required=True),
@ponelat
ponelat / index.html
Last active November 8, 2022 05:11
Select Box Url Swagger-UI
<!DOCTYPE html>
<html>
<head>
<title>Swagger UI</title>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
@pjdietz
pjdietz / cloudSettings
Last active June 18, 2020 22:29
Testing Protected Method of Abstract Class with PHPUnit
{"lastUpload":"2020-06-18T22:29:09.889Z","extensionVersion":"v3.4.3"}
#!/bin/bash -e
curl -O http://ftp.heanet.ie/pub/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
export VM="MASTER"
export VMDISK="$VM-disk"
export REDHAT_IMAGE="/Users/user/Downloads/CentOS-7.0-1406-x86_64-Minimal.iso"
VBoxManage hostonlyif create
VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.20.1
@josephholsten
josephholsten / json-log.conf
Created January 22, 2015 01:12
Complete JSON nginx log_format
# json-log.conf - log all useful nginx variables in json formatted log
# for details about these variables, see http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
log_format json-log '{'
# $arg_*
# $args
# $binary_remote_addr
'"body_bytes_sent":"$body_bytes_sent",'
'"bytes_sent":"$bytes_sent",'
'"connection":"$connection",'
# $connection_requests