Skip to content

Instantly share code, notes, and snippets.

View redjoker011's full-sized avatar
🎯
Focusing

Peter John Alvarado redjoker011

🎯
Focusing
  • localhost
  • Philippines
  • 11:40 (UTC +08:00)
View GitHub Profile
@redjoker011
redjoker011 / nginx.conf
Created January 13, 2021 14:34 — forked from cpswan/nginx.conf
Using nginx to proxy to an AWS ELB
daemon off;
worker_processes 1;
events { worker_connections 1024; }
http{
sendfile on;
@redjoker011
redjoker011 / copy-pub-key.sh
Last active November 25, 2020 07:51
Copy Public Key into AWS EC2 Server via AWS CLI ec2-instance-connect
#!/bin/bash
# Copy ~/.ssh/id_rsa.pub into Host Server
# Note: By default it will use `ubuntu` as os user, feel free to change this
#
# Suppyly instance id and availability zone as script argument
# e.g ./copy-pub-key.sh instance-1234 ap-southeast-1
current_dir=pwd
instance_id=$1
@redjoker011
redjoker011 / describe-instances.sh
Created November 25, 2020 07:48
Fetch AWS EC2 Instance Details
#!/bin/bash
# Fetch and Filter Running EC2 Instance by name
# https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html
# Query:
# Name: Instance Name
# DnsName: Public DNS Name
# State: Instance State
# AZ: Availability Zone
# Filter:
# Filter by name
@redjoker011
redjoker011 / bitbucket-pipelines.yml
Last active June 30, 2022 13:59
Bitbucket CI/CD Pipeline Config for Vuejs App
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
# Note variables start with `$` are repository variables added to bitbucket repo.
image: node:12.18.2
pipelines:
branches:
@redjoker011
redjoker011 / graphql_client_base.rb
Created November 3, 2020 12:03
Ruby GraphQL File Uploader
require "graphql/client"
require "graphql/client/http"
class GraphqlClient::Base
# Configure GraphQL endpoint using the basic HTTP network adapter.
endpoint = ENV.fetch("GRAPHQL_ENDPOINT")
HTTP = GraphqlClient::CustomHTTP.new(endpoint)
# Fetch latest schema on init, this will make a network request
@redjoker011
redjoker011 / 1. ELK.install
Created November 3, 2020 02:41 — forked from PavloBezpalov/1. ELK.install
ELK Stack with Rails (Elasticsearch, Logstash, Kibana) on Ubuntu VPS
INSTALL JAVA
$ sudo apt-get update && sudo apt-get install default-jre
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart
$ sudo service elasticsearch status