Skip to content

Instantly share code, notes, and snippets.

[core]
whitespace = nowarn
pager = less -FRSX
edito = vim
editor = vim
whitespace=fix,-indent-with-non-tab,trailing-space#,cr-at-eol
autocrlf = input
[user]
name = Prashanth
email = Email
@prashanthrajagopal
prashanthrajagopal / aws_lambda_cloudformation_slack.js
Created May 16, 2017 09:54
Lambda script to notify cloudformation events to slack
// Adaptation from https://medium.com/cohealo-engineering/how-set-up-a-slack-channel-to-be-an-aws-sns-subscriber-63b4d57ad3ea
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#aws_playground",
@prashanthrajagopal
prashanthrajagopal / aws_lambda_cloudformation_slack.js
Last active May 16, 2017 09:55
Lambda script to notify cloudformation events to slack through SNS
// Adaptation from https://medium.com/cohealo-engineering/how-set-up-a-slack-channel-to-be-an-aws-sns-subscriber-63b4d57ad3ea
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#aws_playground",
#!/bin/bash
# Argument = -h -v -i groupId:artifactId:version -c classifier -p packaging -r repository -l location -u username -P password
#shopt -o -s xtrace
# Define Nexus Configuration
NEXUS_BASE=http://sonatype.nexus.example.com:8081/nexus
REST_PATH=/service/local
ART_REDIR=/artifact/maven/redirect
@prashanthrajagopal
prashanthrajagopal / Instructions.md
Created May 9, 2016 06:30 — forked from daneden/Instructions.md
Remap Caps Lock to Emoji on Mac

How to remap the caps lock key to the emoji selector on Mac

  1. Go to System Preferences -> Keyboard -> Modifier Keys...
  2. Change “Caps Lock” to “No action”
  3. Install Seil
  4. Change the Caps Lock key in Seil to keyCode 80 (F19)
  5. Install Karabiner
  6. Open Karabiner and go to Misc & Uninstall -> Open private.xml
  7. Copy the contents of this gist's example to the XML file and save
  8. In Karabiner, go to Change Keys -> Reload XML
@prashanthrajagopal
prashanthrajagopal / wordpress-update.sh
Last active September 29, 2015 20:40
wordpress-secure-update
#!/bin/bash
sudo adduser wp-user
cd /var/www/html
sudo chown -R wp-user:wp-user /var/www/html
sudo mkdir -p /home/wp-user/.ssh/
sudo chmod 0640 /home/wp-user/.ssh
sudo su -l wp-user -c "ssh-keygen -f /home/wp-user/.ssh/id_rsa -t rsa -b 4096 -N ''"
sudo chown wp-user:www-data /home/wp-user/.ssh/id_rsa*
sudo chmod 0700 /home/wp-user/.ssh/authorized_keys
@prashanthrajagopal
prashanthrajagopal / capistrano_feature_deploy.rb
Last active August 29, 2015 14:27 — forked from jrochkind/gist:4260448
A cap 'stage' for dynamic deploy of feature branch demos
####
#### Forked from https://gist.github.com/jrochkind/4260448
####
# require 'rvm/capistrano'
require 'fileutils'
# An experiment for a capistrano 'stage' that can actually be used to
# deploy multiple feature branches at once.
# Intended to be installed config/deploy/feature_demo , when using cap
# multi-stage support: add 'feature_demo' to 'stages' in `config/deploy.rb` too.
@prashanthrajagopal
prashanthrajagopal / logstash.conf
Last active August 29, 2015 14:27 — forked from mudge/logstash.conf
A grok pattern for Rails 3.2 logs for use with logstash. Assumes that you have a multiline filter to combine Rails logs into one line and only one worker is logging to a file (c.f. https://gist.github.com/mudge/5063930).
multiline {
tags => ["rails"]
pattern => "^Started"
negate => true
what => "previous"
}
@prashanthrajagopal
prashanthrajagopal / kibana4
Last active August 29, 2015 14:26 — forked from thisismitch/kibana-4.x-default
ELK Kibana4
#!/bin/sh
#
# /etc/init.d/kibana4 -- startup script for kibana4
# bsmith@the408.com 2015-02-20; used elasticsearch init script as template
# https://github.com/akabdog/scripts/edit/master/kibana4_init
#
### BEGIN INIT INFO
# Provides: kibana4
# Required-Start: $network $remote_fs $named
# Required-Stop: $network $remote_fs $named
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" use Vim mode instead of pure Vi, it must be the first instruction
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
filetype off " required
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vundle stuff
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set rtp+=~/.vim/bundle/Vundle.vim " set the runtime path to include Vundle and initialize