Prerequsites:
- GitHub account with admin-level rights to repos, possibly even org-level admin.
- Command Line familiarity
jq
tool
Note: Commands have been written assuming a macOS machine, they may work on other platforms, but I haven't tested those.
flip(inputInt) { | |
return inputInt = 1 - inputInt; | |
} | |
void main() { | |
print(flip(0)); | |
print(flip(1)); | |
} |
Prerequsites:
jq
toolNote: Commands have been written assuming a macOS machine, they may work on other platforms, but I haven't tested those.
Jul 11 10:16:27 wing Installer[99257]: LSExceptions [0x7f857ac0cbb0] loaded | |
Jul 11 10:16:27 wing Installer[99257]: @(#)PROGRAM:Install PROJECT:Install-1000 | |
Jul 11 10:16:27 wing Installer[99257]: @(#)PROGRAM:Installer PROJECT:Installer-852 | |
Jul 11 10:16:27 wing Installer[99257]: Hardware: MacBookAir6,1 @ 1.70 GHz (x 4), 8192 MB RAM | |
Jul 11 10:16:27 wing Installer[99257]: Running OS Build: Mac OS X 10.11 (15A215h) | |
Jul 11 10:16:27 wing Installer[99257]: Env: __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0 | |
Jul 11 10:16:27 wing Installer[99257]: Env: TMPDIR=/var/folders/78/3jyqdny925n348fpr6wh23bc0000gn/T/ | |
Jul 11 10:16:27 wing Installer[99257]: Env: HOME=/Users/miketheman | |
Jul 11 10:16:27 wing Installer[99257]: Env: SHELL=/bin/bash | |
Jul 11 10:16:27 wing Installer[99257]: Env: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.C1W3TcCVzf/Listeners |
from checks import AgentCheck | |
class LinuxEntropyCheck(AgentCheck): | |
def check(self, instance): | |
with open('/proc/sys/kernel/random/entropy_avail', 'r') as procfile: | |
data = procfile.read().strip() | |
self.gauge('system.kernel.entropy_available', int(data)) |
void main() { | |
Duration duration = new Duration(minutes: 1, seconds: 59, milliseconds: 99); | |
print(secondRounder(duration)); | |
} | |
// Rounds Duration to seconds based on milliseconds | |
// This is semi-equivalent to a non-existing `Duration.ceil(milliseconds)` | |
Duration secondRounder(Duration duration) { | |
int roundedDuration; |
# Read more about variables and how to override them here: | |
# https://www.terraform.io/docs/configuration/variables.html | |
variable "aws_region" { | |
type = "string" | |
default = "us-east-1" | |
} | |
variable "shared_secret" { | |
type = "string" | |
default = "SOOPERSEKRET" |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters": { | |
"SharedSecret": { | |
"Default": "SOOPASEKRET", | |
"Description": "Shared Secret, aka External ID", | |
"Type": "String", | |
"NoEcho": "true" | |
} | |
}, |
DD_API_KEY=<REPLACE> sh -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/setup_agent.sh)" | |
sudo mkdir /opt/datadog-agent | |
sudo cp -r ~/.datadog-agent/* /opt/datadog-agent | |
path=$HOME | |
path=${path//\//\\\/} | |
sedcmd="s/$path\/.datadog-agent/\/opt\/datadog-agent/g" | |
for i in /opt/datadog-agent/venv/bin/*; do echo $i; sudo sed -i $sedcmd $i; done |
require 'aws-sdk' | |
require 'fog' | |
require 'pry' | |
# The top-level domain name/hosted zone | |
TOP_DOMAIN = 'example.org' | |
# A simple Change class, repsenting a single change to end up in Route53 | |
class Change | |
attr_accessor :name |
$ sudo yum install yum-utils | |
Loaded plugins: fastestmirror | |
Loading mirror speeds from cached hostfile | |
* base: mirror.ash.fastserv.com | |
* extras: mirror.lug.udel.edu | |
* updates: mirrors.seas.harvard.edu | |
Setting up Install Process | |
Resolving Dependencies | |
--> Running transaction check | |
---> Package yum-utils.noarch 0:1.1.30-17.el6_5 will be installed |