This will demonstrate how to upload build files from Travis CI to S3.
NOTE: Keys have been changed to protect the innocent.
Create an S3 ACL policy, see s3_policy.json for an example.
# LCI | |
sub vcl_fetch { | |
# For successful unsafe responses | |
if (beresp.status >= 200 && beresp.status < 400 | |
&& (req.request == "PUT" || req.request == "POST" || req.request == "DELETE")) { | |
# Purge all the resources marked for cascading purge | |
ban("req.http.host == " + req.http.host + " && obj.http.link ~ <" + req.url + ">;.rel=.inv-by."); | |
} | |
} |
This will demonstrate how to upload build files from Travis CI to S3.
NOTE: Keys have been changed to protect the innocent.
Create an S3 ACL policy, see s3_policy.json for an example.
#!/usr/bin/ruby | |
require 'socket' | |
HOSTNAME = `facter hostname`.chomp | |
SOCKET = UDPSocket.new | |
IO.popen(["curl","http://localhost:8000/haproxy;csv"]) do |haproxy_csv| | |
header_line = haproxy_csv.gets | |
header_line.gsub!(/# /,'') | |
HEADERS = header_line.split(/,/)[0..-2] |
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]
Prerequisites:
Software components used:
#!/bin/bash | |
# This scripts scans the elasticsearch source code for all the registered REST endpoints | |
# It will put the formatted output in $DEFINITIONOUTPUTFILE | |
# [MethodName] [HttpVerb] [Route] | |
ESFOLDER="../elasticsearch" | |
DEFINITIONOUTPUTFILE="src/Generated/rest-actions.txt" | |
# Find all the lines that registerHandlers |
listen 443 ssl; | |
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers kECDH:HIGH:!aNULL:!MEDIUM:!LOW:!NULL:!SSLv2:!ADH@STRENGTH; | |
ssl_prefer_server_ciphers on; | |
ssl_certificate /path/to/file.crt; | |
ssl_certificate_key /path/to/file.key; | |
#to enable forward secrecy. Generate the file using | |
#openssl dhparam -outform PEM -out dh.pem 1024 | |
ssl_dhparam /path/to/dh.pem; |
$ aws opsworks describe-stacks | |
{ | |
"Stacks": [ | |
{ | |
"ServiceRoleArn": "arn:aws:iam::047170177871:role/aws-opsworks-service-role", | |
"StackId": "575e1389-1df3-427d-99d3-d60f89a41442", | |
"DefaultRootDeviceType": "ebs", | |
"Name": "rhenning_test", | |
"ConfigurationManager": { | |
"Version": "11.4", |
class ChefRunner < FPM::Cookery::Recipe | |
GOPACKAGE = "github.com/mlafeldt/chef-runner" | |
name "chef-runner" | |
version "0.8.0" | |
revision 1 | |
source "https://#{GOPACKAGE}/archive/v#{version}.tar.gz" | |
sha256 "a7de23f989f8353ecf838b551a8ceff09b83c8aeff2553b2c31d57615f8fcc53" | |
description "The fastest way to run Chef cookbooks" |
Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki