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
//function type declaration | |
typedef <function return type> * (* <function type name>)( <arg type>, ... ); //don't include variable names | |
//instance | |
<function type name> func; | |
//usage | |
func = &<function instance name>; |
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
var http = require('http'); | |
exports.handler = function(event, context) { | |
http.get('http://httpbin.org/get', function(res) { | |
var body = ''; | |
res.on('data', function(chunk) { | |
body += chunk; | |
}); | |
res.on('end', function() { |
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
{ | |
"Parameters" : { | |
"KeyName" : { | |
"Type" : "String", | |
"Description" : "EC2 KeyPair" | |
}, | |
"ClusterName" : { | |
"Type": "String", | |
"Description" : "ECS Cluster name" | |
}, |
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
#!/usr/bin/ruby | |
# chkconfig: 35 99 01 | |
# description: EC2 DNS loadbalancing | |
# processname: ec2hostname | |
require 'aws-sdk' | |
require 'net/http' | |
`touch /var/lock/subsys/ec2hostname` |
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
#!/usr/bin/ruby | |
# chkconfig: 35 99 01 | |
# description: EC2 DNS registration | |
# processname: ec2hostname | |
require 'aws-sdk' | |
require 'net/http' | |
`touch /var/lock/subsys/ec2hostname` |
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
taken from: | |
http://support.stackdriver.com/customer/portal/articles/1491764-installing-the-stackdriver-agent-on-ubuntu-and-debian | |
switch to root and: | |
curl -o /etc/apt/sources.list.d/stackdriver.list http://repo.stackdriver.com/wheezy.list | |
curl --silent https://app.stackdriver.com/RPM-GPG-KEY-stackdriver | apt-key add - | |
apt-get update | |
apt-get install libhiredis0.10 | |
apt-get install stackdriver-agent |
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
"UserData": { | |
"Fn::Base64": { "Fn::Join":["", [ | |
"#!/bin/bash -ex\n", | |
"apt-get update\n", | |
"apt-get -y install python-setuptools\n", | |
"mkdir aws-cfn-bootstrap-latest\n", | |
"curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1\n", | |
"easy_install aws-cfn-bootstrap-latest\n", | |
"/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource WebServer", " --region ", { "Ref": "AWS::Region" }, "\n", | |
"\n", |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title></title> | |
<script src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div> |
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
#!upstart | |
description "<project>" | |
author "<author>" | |
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
respawn | |
start on runlevel [23] | |
script |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] | |
"DefaultUserName"="<username>" | |
"DefaultPassword"="<password>" | |
"AutoAdminLogon"="1" |
NewerOlder