Skip to content

Instantly share code, notes, and snippets.

View ejlp12's full-sized avatar

EJLP ejlp12

  • Indonesia
View GitHub Profile

Machine Used for this demo

  • EC2 instance from Amazon Linux 2 AMI

Preparation

@ejlp12
ejlp12 / aws_eks_announcement.md
Last active February 7, 2019 07:57
EKS related Announcement

Taken from here https://aws.amazon.com/containers/new/

2019
January 21    Amazon EKS Achieves ISO and PCI Compliance
January 16    Amazon EKS Announces 99.9% Service Level Agreement
January 09    Amazon EKS Available in Seoul Region

2018
December 19   Amazon EKS Available in Frankfurt, Singapore, Sydney, and Tokyo AWS Regions
@ejlp12
ejlp12 / Dockerfile
Last active February 6, 2019 18:10
Redis cluster with 3 Sentinel, accessible from external host
FROM redis:3.2.10
MAINTAINER Li Yi <denverdino@gmail.com>
EXPOSE 26379
ADD sentinel.conf /etc/redis/sentinel.conf
RUN chown redis:redis /etc/redis/sentinel.conf
ENV SENTINEL_QUORUM 2
ENV SENTINEL_DOWN_AFTER 30000
ENV SENTINEL_FAILOVER 180000
@ejlp12
ejlp12 / private_aws_api_gateway.md
Created February 6, 2019 05:54
Create Private API Gateway using VPC Endpoint (PrivateLink)
@ejlp12
ejlp12 / get_oracle_jdk_linux_x64.sh
Last active January 31, 2019 05:00 — forked from n0ts/get_oracle_jdk_x64.sh
Get latest Oracle JDK package bash shell script
#!/bin/bash
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <jdk_version> <ext>
# jdk_version: 8(default) or 9
# ext: rpm or tar.gz
jdk_version=${1:-8}
ext=${2:-rpm}
@ejlp12
ejlp12 / lambda-js-jenkins-job.txt
Last active February 1, 2019 00:14
Lambda (python 2.7) to start Jenkins job
const http = require('http')
exports.handler = (event, context, callback) => {
var auth = 'Basic ' + Buffer.from('JenkinsUserId:JenkinsAPIToken').toString('base64');
var options = {
host: 'example.com or ip address',
path: '/jenkins/job/MyJenkinsJobName/job/RepoName/job/master/build?delay=0sec',
port: '80',
@ejlp12
ejlp12 / ec2_amazon_linux_create_swap.txt
Last active January 31, 2019 14:44
EC2 linux create swap
## https://aws.amazon.com/premiumsupport/knowledge-center/ec2-memory-swap-file/
### 4GB Swap
sudo dd if=/dev/zero of=/swapfile bs=1G count=4
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
echo "/swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab
@ejlp12
ejlp12 / gist:3921f2c58e8dfb63c636126fe69ec344
Created January 28, 2019 04:52
List all open port in docker instances
docker inspect --format '{{.State.Pid}} {{printf "%.13s" .ID}} {{.Name}}' \
$(docker ps --format '{{.ID}}') | while read dockpid dockid dockname
do
echo $dockid $name
sudo nsenter -t $dockpid -n netstat -pnl
done
@ejlp12
ejlp12 / install_artifactory_jenkins_ec2_amazon_linux.md
Last active September 18, 2019 00:32
Install Artifactory & Jenkins (with aws cli) using docker

Install Docker

sudo yum update -y
sudo amazon-linux-extras install docker
sudo service docker start
sudo systemctl enable docker
sudo usermod -a -G docker ec2-user
docker info
@ejlp12
ejlp12 / lab01.md
Last active December 18, 2018 08:26
Lambda Getting Started.