Skip to content

Instantly share code, notes, and snippets.

View philihp's full-sized avatar
👨‍💻
Turning caffeine into code

‮Philihp Busby philihp

👨‍💻
Turning caffeine into code
View GitHub Profile
@philihp
philihp / nginx.conf
Last active December 5, 2017 23:28 — forked from sumardi/nginx.default.conf
Install PHP-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php56-fpm
# Install PHP extensions
sudo yum install -y php56-devel php56-mysql php56-pdo \
php56-pear php56-mbstring php56-cli php56-odbc \
@philihp
philihp / Node_AWS_Linux.md
Created February 8, 2017 00:24 — forked from nrollr/Node_AWS_Linux.md
Install Node.js on Amazon Linux (EC2)

##Installing Node.js on Amazon Linux AMI

The following will guide you through the process of installing Node.js on an AWS EC2 instance running Amazon Linux AMI 2016.09 - Release Notes

For this process I'll be using a t2.micro EC2 instance running Amazon Linux AMI (ami-d41d58a7). Once the EC2 instance is up-and-running, connect to your server via ssh

machine:
environment:
JAVA_TOOL_OPTIONS: '-Dfile.encoding=UTF8 -Duser.timezone=UTC'
_JAVA_OPTIONS: '-Xms512m -Xmx1024m -Xss2m'
java:
version: oraclejdk8
python:
version: 2.7.6
services:
- docker
Verifying that "philihp.id" is my Blockstack ID. https://onename.com/philihp
@philihp
philihp / 2016-11-06-pgp-transition-statement.txt
Created November 7, 2016 10:06
PGP Key Transition Statement
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1,SHA512
2016-11-06 05:25:00 +0000
I am replacing my old DSA-1024 key with a stronger RSA-4096 key. The primary
motivation is to store my key on a Yubikey Nano which doesn't support DSA,
however there is a possibility that the old key has been compromised. Although
I don't have any evidence to suspect this, I certainly haven't been as careful
over the years as I could have.
@philihp
philihp / gist:8023422
Last active December 31, 2015 17:59
query for aaron
select c.name, m.serialnumber,
first_value(l.username) over (order by l.timestamp desc) as username
from machines m
inner join computersmachine cm on (m.id=cm.machineid)
inner join computers c on (cm.computerid=c.id)
left join logins l on (l.machineid=m.id)
libname frc 'u:\public\frc';
data frc.records(keep=team_id opponent_id result);
set frc.results;
array red(1:3) red1-red3;
array blue(1:3) blue1-blue3;
select;
when(redScore > blueScore) result = 2;
when(redScore < blueScore) result = 0;
when(redScore = blueScore) result = 1;
end;
package sos;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map.Entry;
import java.util.Set;
/***
Calculating the odds of the 3-strike game on The Price Is Right
***/
data trials(keep=outcome j strikes);
outcome = 0;
do i=1 to 10000000;
bag = 8;
strikes = 3;
@philihp
philihp / Authenticate.java
Created April 5, 2012 18:33
Facebook OAuth with Scribe in Struts 1
import org.apache.struts.action.*;
import com.google.gson.*;
import org.scribe.builder.*;
import org.scribe.builder.api.*;
import org.scribe.model.*;
import org.scribe.oauth.*;
public class Authenticate extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,