Skip to content

Instantly share code, notes, and snippets.

View HarshadRanganathan's full-sized avatar
💭
Buy me a coffee (https://ko-fi.com/harshadranganathan)

Harshad Ranganathan HarshadRanganathan

💭
Buy me a coffee (https://ko-fi.com/harshadranganathan)
View GitHub Profile
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
@HarshadRanganathan
HarshadRanganathan / ec2startup.sh
Last active May 20, 2019 07:54
Install Nginx, Node JS, NPM & GIT in AWS Linux AMI
#!/bin/bash
# Install updates
sudo yum update -y
# Add the CentOS 7 EPEL repository if required
sudo yum install epel-release -y
# Install nginx
sudo yum install nginx -y
@HarshadRanganathan
HarshadRanganathan / virtual.conf
Last active May 20, 2019 07:54
HTTPS Reverse Proxy Configuration in Nginx
upstream backend-server {
server backend.com:443;
}
server {
root /home/ec2-user/app/public;
index index.html;
server_name app.com;
location /app-proxy/ {
@HarshadRanganathan
HarshadRanganathan / letsencrypt
Last active March 18, 2021 06:28
Let's Encrypt SSL for Nginx in Amazon Linux AMI instance
# Install wget
yum install wget -y
# Install certbot-auto
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
# Obtain SSL certificate with Nginx plugin for the domain
sudo ./certbot-auto --nginx -d app.com --debug
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "Oozie co-ordinators have been scheduled",
"sections": [{
"activityTitle": "Oozie co-ordinators have been scheduled",
"activitySubtitle": "",
"activityImage": "https://cwiki.apache.org/confluence/download/attachments/30737784/oozie_47x200.png?version=1&modificationDate=1349284899000&api=v29",
"facts": [{
post {
success {
script {
def payload = """
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "Oozie co-ordinators have been scheduled",
"sections": [{
@HarshadRanganathan
HarshadRanganathan / ecs_elasticsearch_task_definition.json
Last active November 5, 2019 17:34
AWS ECS ElasticSearch Task Definition Template
{
"ipcMode": null,
"executionRoleArn": null,
"containerDefinitions": [
{
"dnsSearchDomains": null,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/aws/ecs",
@HarshadRanganathan
HarshadRanganathan / emr_socks_proxy_switchy_omega.bak
Created February 13, 2019 11:58
AWS EMR Socks Proxy SwitchyOmega Options File
{"+AWS EMR":{"bypassList":[],"color":"#99ccee","fallbackProxy":{"host":"localhost","port":8157,"scheme":"socks5"},"name":"AWS EMR","profileType":"FixedProfile","revision":"15f16ab0a96"},"+__ruleListOf_auto switch":{"color":"#99dd99","defaultProfileName":"direct","format":"Switchy","matchProfileName":"direct","name":"__ruleListOf_auto switch","profileType":"RuleListProfile","revision":"15f16ac2ad3","ruleList":""},"+auto switch":{"color":"#99dd99","defaultProfileName":"direct","name":"auto switch","profileType":"SwitchProfile","revision":"15f16b225ed","rules":[{"condition":{"conditionType":"HostWildcardCondition","pattern":"internal.example.com"},"profileName":"direct"},{"condition":{"conditionType":"HostWildcardCondition","pattern":"*ec2*.amazonaws.com*"},"profileName":"AWS EMR"},{"condition":{"conditionType":"HostWildcardCondition","pattern":"*ec2*.compute"},"profileName":"AWS EMR"},{"condition":{"conditionType":"HostWildcardCondition","pattern":"http://10.*"},"profileName":"AWS EMR"},{"condition":{"condition
@HarshadRanganathan
HarshadRanganathan / .gitconfig
Created March 20, 2019 15:27
.gitconfig aliases
[alias]
##
# One letter alias for our most frequent commands.
#
# Guidelines: these aliases do not use options, because we want
# these aliases to be easy to compose and use in many ways.
##
a = add
Chapter: Creating and Destroying Objects
[1] Consider static factory methods instead of constructors
[2] Consider a builder when faced with many constructor parameters
[3] Enforce the singleton property with a private constructor or an enum type
[4] Enforce non-instantiability with a private constructor