Skip to content

Instantly share code, notes, and snippets.

Avatar

Neil Millard neilmillard

View GitHub Profile
@shanedroid
shanedroid / halp.MD
Last active May 22, 2020
Add GitHub SSL Certificate to Jenkins Keystore
View halp.MD

I needed to do this as a workaround while running Jenkins via HTTPS, for some reason I was unable to get any GitHub Webhooks to work and would see the following errs in Jenkins log:

jenkins github webhook javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  1. Fetch the certificate from local GitHub:
openssl s_client -connect www.github.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/github_public.crt
@clstokes
clstokes / assume-role-policy.json
Last active Dec 10, 2020
Example: Terraform IAM Role
View assume-role-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
@diegopacheco
diegopacheco / aws-dns-route53-dig.md
Last active Jan 6, 2016
AWS Route53 Fun with DNS: dig & cli53
View aws-dns-route53-dig.md

How to Install on CentOs?

sudo yum install -y bind-utils
pip install cli53

Figureout the box name?

@reinaldomendes
reinaldomendes / curl.ini
Last active Dec 31, 2020
PHP Curl error 77 on ssl conections
View curl.ini
;###################################################
; NOTE
;####################################################
; change your curl.ini on /etc/php.d/curl.ini
;
;This config was only tested on amazon AMI
;Please check if /etc/ssl/certs/ca-bundle.crt exists
;
;If you don't have the ca-bundle root certificate you
; can get this in
@matthewspencer
matthewspencer / install-composer.sh
Created Feb 13, 2014
Install Composer on Webfaction
View install-composer.sh
cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
View rdns.sh
#!/bin/bash
. /usr/share/foreman/config/hooks.d/lib/utils.sh
. $FOREMAN_HOME/config/hooks.d/lib/hook_functions.sh
set -x
IP=$(hook_data host.ip)
DNSNAME=$(hook_data host.name)
REVERSE=$(reverseIp ${IP})
rdns_create() {
echolog IP ${IP} calling nsupdate: dns3.server.name update add ${REVERSE}.in-addr.arpa. 86400 PTR $DNSNAME
View utils.sh
#!/bin/bash
export FOREMAN_SERVER=$foremanserver/api
export FOREMAN_USER=apiuser
export FOREMAN_PASSWORD=$password
export FOREMAN_HOME=/usr/share/foreman
export PATH=$PATH:/usr/local/bin
reverseIp() {
local a i n
IFS=. read -r -a a <<< "$1"
View Twig Template Add function base64_encode
// Datos view Template
$data=array(
//...
);
//Load lib
require_once'libs/Twig/Autoloader.php';
Twig_Autoloader::register();
//config path template
@mrinaudo
mrinaudo / LICENSE
Last active Sep 22, 2018
Basic Template Builder for AWS VPC - Interactively generate basic AWS CloudFormation-based AWS VPC templates.
View LICENSE
The MIT License (MIT)
Copyright (c) 2014 Matteo Rinaudo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@sugendran
sugendran / gist:4773412
Created Feb 12, 2013
CREATE UUID in Objective-C with ARC
View gist:4773412
// CREATE UUID in Objective-C with ARC
NSString* createUUID()
{
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef uuidStr = CFUUIDCreateString(kCFAllocatorDefault, uuid);
NSString *result = [NSString stringWithString:(__bridge NSString*)uuidStr];
CFRelease(uuid);
CFRelease(uuidStr);
return result;