Skip to content

Instantly share code, notes, and snippets.

@jay74jung
jay74jung / README-Template.md
Created October 22, 2019 21:46 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

## How to install mcrypt in php7.2
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
##
#
# Check version php and pecl
#
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php
@jay74jung
jay74jung / vagrant-cheat-sheet.md
Created January 12, 2019 14:31 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
#!/bin/sh
# POSIX
# getopts
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} [-hv] [-f OUTFILE] [FILE]...
Do stuff with FILE and write the result to standard output. With no FILE
#!/bin/sh
# POSIX
# Manual loop
die() {
printf '%s\n' "$1" >&2
exit 1
}
@jay74jung
jay74jung / install-docker.sh
Created August 21, 2018 07:54 — forked from sheikhwaqas/install-docker.sh
Install Docker & Docker-Compose on Ubuntu 16.04 LTS (Xenial). Run this file with sudo.
# Install Pre-requisites
apt update
apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt update
# Install Docker CE
apt install docker-ce -y
@jay74jung
jay74jung / docker-compose.yml
Created August 17, 2018 01:18 — forked from BretFisher/docker-compose.yml
Docker Compose local development with wildcard DNS for multi-domain development
version: '3'
# vcap.me is a wildcard domain that resolves to localhost
# in case you need to pass URL's around from browser to
# containers this could help you get around localhost problem
services:
# use www.vcap.me to access web containter from host
# use api.vcap.me to access api container from host
proxy:
@jay74jung
jay74jung / apache-json-log-format
Created August 3, 2018 01:57 — forked from vmadman/apache-json-log-format
An apache log format that allow access logs (but not error logs) to be output in JSON format. I found this here: http://untergeek.com/2012/10/11/getting-apache-to-output-json-for-logstash/ -- but modified it for my purposes a good bit.
# Access Logs
LogFormat "{ \
\"@vips\":[\"%v\"], \
\"@source\":\"%v%U%q\", \
\"@source_host\": \"%v\", \
\"@source_path\": \"%f\", \
\"@tags\":[\"Apache\",\"Access\"], \
\"@message\": \"%h %l %u %t \\\"%r\\\" %>s %b\", \
\"@fields\": { \
\"timestamp\": \"%{%Y-%m-%dT%H:%M:%S%z}t\", \
@jay74jung
jay74jung / install.md
Created July 3, 2018 08:25 — forked from yugaego/install.md
Mac OS 10.13 High Sierra Install PHP 7.0 Apache MariaDB With Homebrew