This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ssm:DescribeAssociation", | |
"ssm:GetDeployablePatchSnapshotForInstance", | |
"ssm:GetDocument", | |
"ssm:GetManifest", |
This file contains hidden or 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
amazon-ebs output will be in this color. | |
==> amazon-ebs: Prevalidating AMI Name: ubuntu-18.04-root-encryption-2018-09-29T14-40-02Z | |
amazon-ebs: Found Image ID: ami-0ac019f4fcb7cb7e6 | |
==> amazon-ebs: Creating temporary keypair: packer_5baf8ec2-f229-8c17-afd9-76b501a75f67 | |
==> amazon-ebs: Creating temporary security group for this instance: packer_5baf8ec5-e1ba-73cb-8dca-dfec2c8ccfc2 | |
==> amazon-ebs: Authorizing access to port 22 from 0.0.0.0/0 in the temporary security group... | |
==> amazon-ebs: Launching a source AWS instance... | |
==> amazon-ebs: Adding tags to source instance | |
amazon-ebs: Adding tag: "Name": "Packer Builder" |
This file contains hidden or 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
{ | |
"variables": { | |
"ami-name": "ubuntu-18.04-{{ isotime }}" | |
}, | |
"builders": [ | |
{ | |
"type": "amazon-ebs", | |
"ami_name": "{{ user `ami-name` | clean_ami_name }}", | |
"region": "us-east-1", | |
"source_ami_filter": { |
This file contains hidden or 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
{ | |
"variables": [ | |
], | |
"builders":[ | |
], | |
"provisioners":[ | |
], |
This file contains hidden or 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
wget -O packer.zip https://releases.hashicorp.com/packer/1.3.1/packer_1.3.1_linux_amd64.zip | |
sudo unzip -d /usr/local/bin packer.zip |
This file contains hidden or 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
#include <memory> | |
#include <cstdio> | |
///////////////////////////////////////////////////////////////////////////// | |
typedef std::unique_ptr<std::FILE, int (*)(std::FILE *)> unique_file_ptr; | |
typedef std::shared_ptr<std::FILE> shared_file_ptr; | |
static shared_file_ptr make_shared_file(const char * filename, const char * flags) | |
{ |
This file contains hidden or 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
#include <stdio.h> | |
#include "mp4.h" | |
char *mp4FileName = "\\Storage Card\\TestVectors\\Downloaded\\[Ani]Conan-01.mp4"; | |
int WINAPI WinMain( HINSTANCE hInstance, | |
HINSTANCE hPrevInstance, | |
LPTSTR lpCmdLine, |
This file contains hidden or 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
// Extract base file name at compile time. E.g., "bar.cc" when __FILE__ == "/foo/bar.cc" | |
static constexpr const char* BASE_FILE(const char* dp, const char* p) { | |
return *p == '\0' ? dp : *p == '/' ? BASE_FILE(p + 1, p + 1) : BASE_FILE(dp, p + 1); | |
} | |
static constexpr const char* BASE_FILE(const char* s) { return BASE_FILE(s,s); } |
This file contains hidden or 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
/* Nick Mudge 24 February 2008 */ | |
// http://nickmudge.info/?post=84 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <string.h> | |
#define SIZE 50000 | |
void make_random_strings(unsigned char *strings[]); |
This file contains hidden or 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
// http://stackoverflow.com/a/107657 | |
constexpr unsigned long long int HashStringToInt(const char *str, unsigned long long int hash = 0) | |
{ | |
return (*str == 0) ? hash : 101 * HashStringToInt(str + 1) + *str; | |
} | |
void simple_switch(const std::string &str) | |
{ | |
switch (HashStringToInt(str.c_str())) | |
{ |
NewerOlder