Skip to content

Instantly share code, notes, and snippets.

View jmilagroso's full-sized avatar
⌨️
ps aux | grep stress | awk '{print $2}' | xargs kill -9

jmilagroso jmilagroso

⌨️
ps aux | grep stress | awk '{print $2}' | xargs kill -9
  • PH
View GitHub Profile
@jmilagroso
jmilagroso / nginx.conf
Created September 9, 2016 04:41 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
Route::get('redis', array('as' => 'cache', 'do' => function()
{
$redis = Redis::connection();
//STRING
$redis->set('name', 'Taylor');
$name = $redis->get('name');
// LIST
// A list is a series of ordered values. Some of the important commands for interacting with lists are RPUSH, LPUSH, LLEN, LRANGE, LPOP, and RPOP.
@jmilagroso
jmilagroso / EventDate
Created March 18, 2015 06:27
EventDate class helper.
<?php
/**
* EventDate class helper.
*
* @author Jay Milagroso<j.milagroso@gmail.com>
*/
class EventDate {
// Today
@jmilagroso
jmilagroso / public_access_policy
Created January 27, 2015 07:33
AWS S3 Bucket Public Access Policy
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::example-bucket/*"
]
}
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@jmilagroso
jmilagroso / .gitignore
Last active August 29, 2015 14:02 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@jmilagroso
jmilagroso / MySQLToCSV
Created June 18, 2014 05:05
Export data as CSV
SELECT * INTO OUTFILE 'C:/export/users.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM users;
@jmilagroso
jmilagroso / Velocity
Created June 18, 2014 05:01
Mach to KpH
1 Mach = 340.29 m / s
1 m/s = 3.6 km/h
1.5 Mach = 510.435 m/s
((510.435 m/s)x(3.6 km/h))/(1m/s) = 1837.566 km/h
FA-50 Velocity is 1837.566 km/h
@jmilagroso
jmilagroso / SQLiteUpperCase
Created June 18, 2014 04:59
Update first letter in a given column data.
UPDATE tb_Company
SET CompanyIndustry = CONCAT(UCASE(LEFT(CompanyIndustry, 1)),
SUBSTRING(CompanyIndustry, 2));
@jmilagroso
jmilagroso / mysqltrigger
Last active August 29, 2015 14:02
MySQL Trigger On Delete
DELIMITER $$
CREATE TRIGGER after_delete_on_table_a AFTER DELETE ON table_a
FOR EACH ROW
BEGIN
DELETE FROM table_b WHERE table_b.foreign_id = old.id;
END