Skip to content

Instantly share code, notes, and snippets.

View masasdani's full-sized avatar

Masas Dani masasdani

View GitHub Profile
@masasdani
masasdani / install-nginx-amazon-linux.md
Last active November 2, 2021 15:23
install-nginx-amazon-linux

install nginx

sudo amazon-linux-extras list | grep nginx
sudo amazon-linux-extras enable nginx1
sudo yum clean metadata
sudo yum -y install nginx
nginx -v

start and set default

@masasdani
masasdani / gist:3ba868a24e6c5d97ef095fa8a21689b4
Last active October 18, 2021 03:38
certbot-nginx-amazon-linux-2
sudo amazon-linux-extras install epel
sudo yum install certbot python2-certbot-nginx
# nginx .conf
/etc/nginx/cond.d/yourdomain.conf
server {
server_name yourdomain.com;
@masasdani
masasdani / install-docker.md
Created October 10, 2021 04:15 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
{
"1": ["@yopie", "@Zulfikar_ltf", "@dinandans", "@FarahOktarina"],
"2": ["@masasdani", "@Vincensius", "@wuland_manyun", "@ikenurasih"],
"3": ["@irfanfirdaus", "@deny_ervan", "@nanangarsyad", "@Jumroh"],
"4": ["@timenz", "@Marvinhidajat", "@angga_1927", "@alfinma"],
"5": ["@johjuda", "@ndiyandii", "@Fendy1983", "@GalehWP"],
"6": ["@ShariSherenHuth", "@rosyiandika", "@Fadlan9", "@exza_a"],
"7": ["@Zulfikar_ltf", "@gittamaruhawa", "@RyanArrofiq", "@Fadlan9"],
"8": ["@Vincensius", "@ndiyandii", "@dinandans", "@okutasan"],
"9": ["@deny_ervan", "@yopie", "@wuland_manyun", "@ikenurasih"],
@masasdani
masasdani / letsencrypt-nginx-centos.md
Last active May 26, 2021 13:00
letsencyript SSL nginx proxy centos 7

Install Letsencrypt Nginx Centos 7

install certbot

  sudo yum install epel-release
  sudo yum update
  sudo yum install certbot

install nginx

  sudo yum install nginx

sudo systemctl start nginx

@masasdani
masasdani / logback.xml
Created February 28, 2017 10:55 — forked from kyungw00k/logback.xml
logback & logstash pattern for elasticsearch
<?xml version="1.0" encoding="UTF-8"?>
<!-- For assistance related to logback-translator or configurations -->
<!-- files in general, please contact the logback user mailing list -->
<!-- at http://www.qos.ch/mailman/listinfo/logback-user -->
<!-- -->
<!-- For professional support please see -->
<!-- http://www.qos.ch/shop/products/professionalSupport -->
<!-- -->
<configuration>
//this will remove all collection except system.*
use <name_of_database>
db.getCollectionNames().forEach(function(c) { if (c.indexOf("system.") == -1) db[c].drop(); })
@masasdani
masasdani / launch-daemon-mac
Created November 19, 2015 06:31
macos create auto start app
#location
#/Library/LaunchDaemons
#name
#com.mysql.mysql.plist
#sudo chown root /Library/LaunchDaemons/com.mysql.mysql.plist
#sudo chgrp wheel /Library/LaunchDaemons/com.mysql.mysql.plist
#sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist
#sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
<?xml version="1.0" encoding="UTF-8"?>
@masasdani
masasdani / jboss.sh
Last active August 29, 2015 14:07
Jboss Server
# start jboss stand alone
./standalone.sh -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0 &
# stop jboss
./jboss-cli.sh --connect command=:shutdown