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
httpClient.DefaultRequestHeaders.Authorization = | |
new AuthenticationHeaderValue( | |
"Basic", | |
Convert.ToBase64String( | |
System.Text.ASCIIEncoding.ASCII.GetBytes( | |
string.Format("{0}:{1}", username, password)))); |
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
Installing Docker on Linux https://www.youtube.com/watch?v=wPmvN7KcOlI | |
Creating your first Dockerfile, image and container https://www.youtube.com/watch?v=hnxI-K10auY |
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
FROM python:3.5 | |
RUN pip install Flask==0.11.1 | |
RUN useradd -ms /bin/bash admin | |
USER admin | |
COPY app /app | |
WORKDIR /app | |
CMD ["python", "app.py"] |
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
<!DOCTYPE html> | |
<html> | |
<meta charset="ISO-8859-1"> | |
<!-- It should have been | |
<meta charset="UTF-8"> --> | |
<!-- there is no code to represent ← in ISO-8859-1 character set | |
for showing the ← character correctly we have to use UTF-8 | |
UTF-8 represents ← with code --> |
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
var fs = require('fs'); | |
fs.readFile('users.json',function(err,data){ | |
var users = JSON.parse(data).results.slice(0,100); | |
console.log("Users "+users.length); | |
users.forEach(function(user,index){ | |
var prefix = index+1; | |
fs.writeFile('users/user_'+prefix+'.json',JSON.stringify(user),function(err){ | |
if(err){ |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Builds a VPC w/ INET Gateway and 3 public subnets. **WARNING** This template creates Amazon EC2 instance(s). You will be billed for the AWS resources used if you create a stack from this template.", | |
"Resources" : { | |
"VPC" : { | |
"Type" : "AWS::EC2::VPC", | |
"Properties" : { |
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
Policy document for basic lambda execution. Create a role and attach this policy, then assign that role to the lambda. | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", |
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
#!/bin/bash -v | |
sudo yum update -y | |
sudo yum install -y tomcat7-webapps tomcat7-docs-webapp tomcat7-admin-webapps | |
sudo service tomcat7 start | |
# Copying a war to /usr/share/tomcat7/webapps directory |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "AWS CloudFormation Sample Template VPC_with_PublicIPs_And_DNS: Sample template that creates a VPC with DNS and public IPs enabled. Note that you are billed for the AWS resources that you use when you create a stack from this template.", | |
"Parameters": { | |
"KeyPair": { | |
"Description": "Name of the keypair to use for SSH access", | |
"Type": "String" | |
} | |
}, |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "AWS CloudFormation Sample Template VPC_with_PublicIPs_And_DNS: Sample template that creates a VPC with DNS and public IPs enabled. Note that you are billed for the AWS resources that you use when you create a stack from this template.", | |
"Parameters": { | |
"KeyPair": { | |
"Description": "Name of the keypair to use for SSH access", | |
"Type": "String" | |
}, | |
"BucketName" : { | |
"Description" : "Name of bucket containing application war", |