Skip to content

Instantly share code, notes, and snippets.

View tuffacton's full-sized avatar
👋

Nic Acton tuffacton

👋
View GitHub Profile
@tuffacton
tuffacton / wordpress.txt
Last active November 8, 2019 15:27
Wordpress Installation
sudo yum update -y
sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
sudo cp -r wordpress/* /var/www/html/
cd /var/www/html/
sudo cp wordpress/wp-config-sample.php wordpress/wp-config.php
@tuffacton
tuffacton / OpenSSL-HTTPD-notes.md
Last active November 1, 2019 03:47
Notes from the Linux Academy Lab "Working with OpenSSL and Httpd"

On your intended webserver, install mod_ssl via yum or whatever your package manager is.

# Change to the /tls/ directory
$ cd /etc/pki/tls/
# Create a new encrypted private key
$ openssl genrsa -aes128 -out private/httpdkey.pem
# Input a password you'll remember as prompted
# Generate a self-signed certificate using the encrypted private key you just made
$ openssl req -new -x509 -key private/httpdkey.pem -out certs/httpdcert.pem -days 365
# Input passphrases as previously prompted
@tuffacton
tuffacton / s3-canonical-id.json
Created September 9, 2019 15:54
A nominal S3 bucket policy based on canonical IDs
{
"Id": "Policy1556720691353",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1556720652492",
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
@tuffacton
tuffacton / docker_busybox.md
Created August 19, 2019 03:51
Linux tooling on any machine with Docker busybox

Universal Linux Tooling with Docker Busybox

First, get the busybox image

$ docker pull busybox:latest

File manipulation

Attach a volume with files you want to manipulate and perform the manipulations. For example, if you wish to gzip a file:

$ docker run -v $(pwd):/ busybox gzip /
@tuffacton
tuffacton / self-signed-certs.md
Created June 25, 2019 19:58
Super quick guide to self-signed certs for HTTPS implementation and testing

Utilizing the openssl library (this should be usable on ELBs and most HTTP Proxy services)

# Generate a new RSA server key
$ openssl genrsa 2048 > server.key
# Change permissions to read-only
$ chmod 400 server.key
# Creating a new server certificate utilizing that server key
$ openssl req -new -x509 -nodes -sha256 -days 365 -key server.key -out server.crt
@tuffacton
tuffacton / arc_playground.ipynb
Created December 7, 2018 03:17
ARC_Playground.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tuffacton
tuffacton / sentiment_bot.ipynb
Created July 10, 2018 19:49
Sentiment_Bot.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tuffacton
tuffacton / ec2-meta.sh
Created June 27, 2018 03:49
Quickly pull all AWS meta-data from within an EC2 instance
#!/bin/bash
for i in $(curl http://169.254.169.254/latest/meta-data/)
do
echo $i: && curl http://169.254.169.254/latest/meta-data/$i
echo ""
done
@tuffacton
tuffacton / apache.sh
Created June 27, 2018 03:29
Example AWS Bash Startup Script for Apache (and copy/deploy HTML from S3)
#!/bin/bash
yum update -y
yum install httpd -y
service httpd start
chkconfig httpd on
cd /var/www/html
aws s3 cp s3://<s3-bucket-name>/index.html /var/www/html
@tuffacton
tuffacton / bash.md
Last active June 26, 2018 23:48
Bash scripting and examples

One liner conda install example:

$ for i in $(ls <directory>); do conda install <directory>/$i; done

Saved shell script example (if named shell.sh then you can use sh shell.sh to activate):

#!/bin/bash
for file in /etc/*
do