Skip to content

Instantly share code, notes, and snippets.

View aa6my's full-sized avatar
😈
curiosity

aa6mys aa6my

😈
curiosity
View GitHub Profile
@aa6my
aa6my / nginx.conf
Created June 6, 2017 04:11 — forked from khanhicetea/nginx.conf
NginX https redirect ( Cloudflare's flexible ssl )
server {
listen 80;
server_name example.com www.example.com;
if ($http_x_forwarded_proto = "http") {
return 301 https://$server_name$request_uri;
}
... directives to generate a response
}
FYI, I'm successfully packaged watchman with fpm (it's awesome):
gem install fpm
git clone https://github.com/facebook/watchman.git
cd watchman
git checkout v4.1.0
sudo apt-get install python-dev
./autogen.sh
./configure --prefix=/usr
make

Tutorial Nginx aa6my

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-zip
@aa6my
aa6my / regex.js
Created March 1, 2018 03:49
REGEX
$('#testing').keydown(function(e) {
if (e.keyCode === 190) {
e.preventDefault();
}
});
$('#testing').on('input propertychange paste', function (e) {
var reg = /^[1-9]+/gi;
if (this.value.match(reg)) {
this.value = this.value.replace(reg, '');
@aa6my
aa6my / deploy.prototxt
Created November 1, 2018 17:32 — forked from bogger/deploy.prototxt
GoogLeNet_cars
name: "GoogleNet"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 224
input_dim: 224
# hierarchy 1
# conv -> relu -> pool -> lrn
@aa6my
aa6my / user-data.sh
Created January 25, 2019 10:34 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@aa6my
aa6my / shellnote.txt
Created February 28, 2019 10:06
command NOTE
/**
* Perl
* ucfirst codeigniter
*/
perl -e 's/\.[^\.]*$/rename $_, ucfirst($`) . $&/e for glob "*.php"'
@aa6my
aa6my / cloudwatch-php-fpm-status.sh
Created May 6, 2019 04:47 — forked from ysasaki/cloudwatch-php-fpm-status.sh
php-fpm status to AWS CloudWatch
#!/bin/bash
AWS_DEFAULT_REGION="ap-northeast-1"
AWS_ACCESS_KEY_ID="YOUR ACCESS KEY HERE"
AWS_SECRET_ACCESS_KEY="YOUR SECRET ACCESS KEY HERE"
INSTANCE_ID_URL="http://169.254.169.254/latest/meta-data/instance-id"
INSTANCE_ID=$(curl -s ${INSTANCE_ID_URL})
SERVER_STATUS_URL="http://localhost/php-fpm-status"
?full&json%27