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
--- | |
hosts: all | |
tasks: | |
- copy: ~ | |
dest: "." | |
name: "copy Dockerfile into remote machine" | |
src: Dockerfile | |
- copy: . | |
src: webapp.war | |
dest: "." |
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
--- node convert-key.js | |
var fs = require("fs"); | |
var stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0 | |
const key = stdinBuffer.toString() | |
const start = "-----BEGIN RSA PRIVATE KEY----- "; | |
const end = "-----END RSA PRIVATE KEY-----"; | |
const rawKey = key.replace(start, '').replace(end, '').replaceAll(' ', '\n').slice(0,-2).concat(end).replace (/^/, `${start}\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
name: Pull Request | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
tf_fmt: |
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
resource "aws_instance" "myInstance" { | |
ami = "ami-06ce3edf0cff21f07" | |
instance_type = "t2.micro" | |
} |
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
output "DNS" { | |
value = aws_instance.myInstance.public_dns | |
} |
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
#!/bin/bash | |
sudo su | |
yum -y install httpd | |
echo "<p> My Instance! </p>" >> /var/www/html/index.html | |
sudo systemctl enable httpd | |
sudo systemctl start httpd |
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
resource "aws_instance" "myInstance" { | |
ami = "ami-06ce3edf0cff21f07" | |
instance_type = "t2.micro" | |
user_data = <<-EOF | |
#!/bin/bash | |
sudo su | |
yum -y install httpd | |
echo "<p> My Instance! </p>" >> /var/www/html/index.html | |
sudo systemctl enable httpd | |
sudo systemctl start httpd |
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
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
echo "Started User Data" | |
sudo su | |
yum install httpd | |
echo "<p> Instance 2! </p>" >> /var/www/html/index.html | |
sudo systemctl enable httpd | |
sudo systemctl start httpd |
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
/* ----- Your Microservice ----- */ | |
// An imaginary database | |
const DATABASE = [{ id: 2, name: "Lou" }] | |
// library.js | |
function databaseLibrary() { | |
return { | |
findByID: (searched_id) => DATABASE.find(id => searched_id) | |
} |
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
import React, { Component } from "react"; | |
import axios from "axios"; | |
export default class extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
upload_file: null | |
}; | |
} |
NewerOlder