This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "net/http" | |
require "facter" | |
require "facter/ec2" | |
# vpc-id is in a newer metadata api rev than the usual EC2 facts | |
Facter.add(:ec2_vpc_id) do | |
setcode do | |
if !Facter.value('ec2_instance_id').nil? && !Facter.value('ec2_mac').nil? | |
mac = Facter.value('ec2_mac') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You might get a couple of errors: | |
# 1. This is not Glacier type | |
# Restore is not allowed, as object's storage class is not GLACIER | |
# 2. Already requested | |
# Object restore is already in progress | |
# 3. This is a path object | |
# The specified key does not exist. | |
for key in `aws s3 ls --recursive s3://{BUCKET}/{PATH} | awk '{ print $4}'` ; do echo "==> $key"; aws s3api restore-object --bucket {BUCKET} --key $key --restore-request '{"Days": 1}' ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ab -n 400 -c 10 -g "perf-data.tsv" "http://example.com/" | |
gnuplot <<- EOF | |
# Let's output to a jpeg file | |
set terminal png size 1000,600 | |
# This sets the aspect ratio of the graph | |
set size 1, 1 | |
# The graph title | |
set title "Benchmark testing" | |
# Where to place the legend/key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build dependencies for OpenResty. | |
sudo apt-get install build-essential libpcre3-dev libssl-dev libgeoip-dev | |
# Install standard Nginx first so that you get the relevant service scripts installed too | |
sudo apt-get install nginx | |
# If you want to access Postgres via Nginx | |
sudo apt-get install libpq-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat ~/src/foo.bar.com/furoshiki/vagrant/salt/salttest/debian-jessie/Vagrantfile | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "debian-jessie" | |
config.landrush.enabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# my-states is a collection of custom states | |
/my-states | |
/ntp | |
/docker | |
/syslog-ng | |
# Kubernetes formula is a collection of implmeentations specific for kubernetes | |
# The aim is to keep a copy of their implmeentation in the same my-states tree without causing conflicts with | |
# exsiting state implmenetation. | |
# I'm expecting to make some changes to the kube states to ensure requiring by relative path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A yaml format file to pull dependencies into your own salt state | |
dependencies: | |
# local formular namespace will be called ntp | |
ntp: | |
# git repository | |
source: [email protected]:saltstack-formulas/ntp-formula.git | |
# copy sub directory as the root state | |
source_path: ntp | |
# version of the git repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get update | |
$ sudo apt-get install nfs-common | |
$ sudo mount -t nfs4 -o vers=4.1 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).<fs-id>.efs.<region>.amazonaws.com:/ ~/efs-mount-point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew tap osx-cross/avr | |
# take long time to compile | |
brew install avr-libc | |
brew install dfu-programmer | |
# turn hhkb to bootloader mode | |
# LShift + RShift + Fn + p | |
# prepare tmk keymap and download HEX `keymap.hex` file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Command arguments ['role', 'definition', 'update', '--role-definition', '{REMOVE SENSITIVE DATA}', '--name', 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', '--scope', '/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'] | |
Current active cloud 'AzureCloud' | |
{'active_directory': 'https://login.microsoftonline.com', | |
'active_directory_graph_resource_id': 'https://graph.windows.net/', | |
'active_directory_resource_id': 'https://management.core.windows.net/', | |
'batch_resource_id': 'https://batch.core.windows.net/', | |
'gallery': 'https://gallery.azure.com/', | |
'management': 'https://management.core.windows.net/', | |
'resource_manager': 'https://management.azure.com/', | |
'sql_management': 'https://management.core.windows.net:8443/'} |