Skip to content

Instantly share code, notes, and snippets.

View achmadfatoni's full-sized avatar
🏠
Working from home

Achmad Fatoni achmadfatoni

🏠
Working from home
View GitHub Profile
@achmadfatoni
achmadfatoni / Modal.vue
Created September 20, 2016 04:11
Vuejs reusable modal
<template>
<div class="modal-mask" v-show="show" @click="close" transition="modal">
<div class="modal-container" @click.stop>
<slot></slot>
</div>
</div>
</template>
<style>
* {
box-sizing: border-box;
@achmadfatoni
achmadfatoni / ssh.sh
Created October 8, 2016 16:12
Add ssh key to server
cat ~/.ssh/id_rsa.pub | ssh root@[your.ip.address.here] "cat >> ~/.ssh/authorized_keys"
@achmadfatoni
achmadfatoni / appname-queue.conf
Created October 24, 2016 16:54
Supervisord Conf
[program:queue]
commad=php artisan queue:listen --tries=2
directory=/path/to-directory
stdout_logfile=/path/to-log-file/storage/logs/supervisord.log
redirect_stderr=true
docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
@achmadfatoni
achmadfatoni / Laravel PHP7 LEMP and Mysql
Last active September 24, 2019 08:43 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x and Mysql
#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version.
This tutorial is the improvised verision of this [tutorial on Digitalocean](https://www.digitalocean.com/community/tutorials/how-to-install-laravel-with-an-nginx-web-server-on-ubuntu-14-04) based on my experience.
## Install PHP 7 on Ubuntu
Run the following commands in sequence.
```
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
Host :ec2-50-19-219-69.compute-1.amazonaws.com
Database : dbktmep10ovfnu
User :ecvuhdsbxencgx
Port :5432
Password :03ca39670fb83f24c8bdcdc81089dbe50f70bb1148892a4ccbdb3994716e9325
URI
postgres://ecvuhdsbxencgx:03ca39670fb83f24c8bdcdc81089dbe50f70bb1148892a4ccbdb3994716e9325@ec2-50-19-219-69.compute-1.amazonaws.com:5432/dbktmep10ovfnuHeroku CLI
heroku pg:psql postgresql-round-66066 --app achmadfatoni
@achmadfatoni
achmadfatoni / docker-cheat-sheet
Created July 10, 2017 03:19
Docker cheat sheet
`docker images` list all images
`docker rmi image-id` delete docker image
@achmadfatoni
achmadfatoni / letsencrypt_2017.md
Created July 12, 2017 17:20 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@achmadfatoni
achmadfatoni / simple_api_lumen_create
Last active August 18, 2017 12:03
simple_api_lumen_create
$app->post('/posts', 'PostController@store');
@achmadfatoni
achmadfatoni / simple_api_lumen_create_controller
Created August 18, 2017 11:59
simple_api_lumen_create_controller
<?php
namespace App\Http\Controllers;
use App\Models\Post;
use Illuminate\Http\Request;
class PostController extends Controller
{
public function store(Request $request)