Skip to content

Instantly share code, notes, and snippets.

Prashanth Rajagopal prashanthrajagopal

Block or report user

Report or block prashanthrajagopal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7724951553659467599704574dbb85c5
[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
Lambda script to notify cloudformation events to slack
View aws_lambda_cloudformation_slack.js
// 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
Lambda script to notify cloudformation events to slack through SNS
View aws_lambda_cloudformation_slack.js
// 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",
View nxfetch.sh
#!/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 — forked from daneden/Instructions.md
Remap Caps Lock to Emoji on Mac
View Instructions.md

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 Sep 29, 2015
wordpress-secure-update
View wordpress-update.sh
#!/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 Aug 29, 2015 — forked from jrochkind/gist:4260448
A cap 'stage' for dynamic deploy of feature branch demos
View capistrano_feature_deploy.rb
####
#### 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 Aug 29, 2015 — 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).
View logstash.conf
multiline {
tags => ["rails"]
pattern => "^Started"
negate => true
what => "previous"
}
View 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
View vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 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
You can’t perform that action at this time.