Skip to content

Instantly share code, notes, and snippets.

View freddymu's full-sized avatar

Freddy Munandar freddymu

View GitHub Profile
@freddymu
freddymu / cheatsheet-elasticsearch.md
Created June 22, 2020 04:30 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@freddymu
freddymu / elasticsearch-cheatsheet.txt
Created June 22, 2020 04:29 — forked from stephen-puiszis/elasticsearch-cheatsheet.txt
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# cat paths
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{index}
@freddymu
freddymu / elasticsearch-cheatsheet.md
Last active June 22, 2020 04:29 — forked from seb-martin/elasticsearch-cheatsheet.md
Elasticsearch Cheatsheet
# supervisor
#
# Author: Günter Grodotzki <gunter@grodotzki.co.za>
# Version: 2015-04-25
#
# set param "SUPERVISE=enable" to activate
#
packages:
yum:
python27-setuptools: []
@freddymu
freddymu / README.md
Created September 12, 2019 04:05 — forked from chrisjm/README.md
LetsEncrypt, AWS Certificate Manager, and CloudFront

Using LetsEncrypt SSL certificates with AWS Certificate Manager and CloudFront

This is a document for managing LetsEncrypt certificates on AWS using AWS Certificate Manager and configuring on CloudFront using the AWS CLI.

Setup

Follow the instructions to set up the certbot and aws commands on your local machine:

@freddymu
freddymu / ssh-tunnel.md
Created August 28, 2019 16:20 — forked from todgru/ssh-tunnel.md
How to set-up a SSH tunnel for AWS RDS

SSH Tunnel

Our db is hosted on Amazon. Our web server can connect to the db. Connections to the db are not allowed outside of the web server.

Run ssh tunnel locally:

This creates a tunnel from my local machine to the web server:

ssh -N -L 3307:my-rds-db.us-east-1.rds.amazonaws.com:3306 ec2-my-web-server.compute-1.amazonaws.com
@freddymu
freddymu / gitflow-breakdown.md
Created July 1, 2019 10:26 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@freddymu
freddymu / git patterns.md
Created June 17, 2019 09:47 — forked from wayspurrchen/git patterns.md
Useful Git Techniques

History

Show file at certain commit

git show <hash>:<file>

Show history of a file

git log -p <filename>

@freddymu
freddymu / 0_reuse_code.js
Created June 15, 2014 02:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@freddymu
freddymu / urlencode.php
Created July 23, 2012 07:51
PHP: Encoding a URL before accessing it
/**
* @param $url
* The URL to encode
*
* @return
* A string containing the encoded URL with disallowed
* characters converted to their percentage encodings.
*/
function encode_url($url) {
$reserved = array(