Skip to content

Instantly share code, notes, and snippets.

View loujaybee's full-sized avatar
🖥️
Codin'

Lou Bichard loujaybee

🖥️
Codin'
View GitHub Profile
---
hosts: all
tasks:
- copy: ~
dest: "."
name: "copy Dockerfile into remote machine"
src: Dockerfile
- copy: .
src: webapp.war
dest: "."
--- 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`);
name: Pull Request
on:
pull_request:
branches:
- master
jobs:
tf_fmt:
@loujaybee
loujaybee / ec2instance.tf
Created April 21, 2020 06:42
AWS EC2 Instance Resource Block
resource "aws_instance" "myInstance" {
ami = "ami-06ce3edf0cff21f07"
instance_type = "t2.micro"
}
@loujaybee
loujaybee / outputBlock.tf
Created April 21, 2020 06:39
Terraform Output Block
output "DNS" {
value = aws_instance.myInstance.public_dns
}
@loujaybee
loujaybee / createApacheUserData.sh
Created April 20, 2020 07:06
Basic Apache Web Server For Use In AWS User Data Script
#!/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
@loujaybee
loujaybee / simpleApacheServerTerraform.tf
Created April 20, 2020 06:49
A Simple Apache Terraform Instance AWS
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
@loujaybee
loujaybee / start_apache.sh
Last active April 19, 2020 18:30
Super small script to start apache
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
@loujaybee
loujaybee / microservice.component.test.js
Last active December 11, 2019 07:36
An example set of component tests
/* ----- Your Microservice ----- */
// An imaginary database
const DATABASE = [{ id: 2, name: "Lou" }]
// library.js
function databaseLibrary() {
return {
findByID: (searched_id) => DATABASE.find(id => searched_id)
}
@loujaybee
loujaybee / upload.js
Last active November 16, 2019 16:42
A crude but working upload example
import React, { Component } from "react";
import axios from "axios";
export default class extends Component {
constructor(props) {
super(props);
this.state = {
upload_file: null
};
}