Skip to content

Instantly share code, notes, and snippets.

View devilankur18's full-sized avatar
💭
Building Copilots Stacks at SugarAI

Ankur Agarwal devilankur18

💭
Building Copilots Stacks at SugarAI
View GitHub Profile
/*
* See http://mathiasbynens.be/notes/async-analytics-snippet#comment-14
*/
<script>
var clicky = (function f(){return {log:f, goal:f};})(),
clicky_site_id = XXXXXX;
(function(d, t) {
var c = d.createElement(t),
s = d.getElementsByTagName(t)[0];
@devilankur18
devilankur18 / install-syntastic.sh
Created May 4, 2012 03:52 — forked from coolaj86/install-syntastic.sh
vim? JavaScript? syntastic!
# This is how you install syntax checking for JavaScript in vim
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -so ~/.vim/autoload/pathogen.vim \
https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim
npm install -g jshint
cd ~/.vim/bundle
git clone https://github.com/scrooloose/syntastic.git
@devilankur18
devilankur18 / Ubuntu12-04
Created June 4, 2012 15:01
Graylog Setup in ubuntu 12.04
*Elastic Search*
Grab the deb packages for Elasticsearch from http://www.elasticsearch.org/download/ and both the Graylog2 server and web interface from http://graylog2.org/download.
#install the elastic search from debian
dpkg -i elasticsearch-0.19.3.deb
@devilankur18
devilankur18 / gist:3451287
Created August 24, 2012 14:31 — forked from JosephPecoraro/shell-execution.rb
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@devilankur18
devilankur18 / gist:3633312
Created September 5, 2012 08:30
Install Mongrel2 on Ubuntu 12.04 64 bit

Install ZeroMQ

wget https://github.com/zeromq/zeromq2-x/zipball/v2.1.7
unzip v2.1.7
cd zeromq-zeromq2-x-f05ff4d

Install dependencies

sudo apt-get install uuid-dev
@devilankur18
devilankur18 / .gitignore
Created September 13, 2012 16:49 — forked from karmi/.gitignore
Bootstrap, install and configure ElasticSearch with Chef Solo: Ubuntu 12.04 64 Bit
.DS_Store
node.json
tmp/
@devilankur18
devilankur18 / gist:3876495
Created October 12, 2012 00:00
Routing Mapping issue with elasticsearch 19.9
$ curl -PUT http://localhost:9200/xyz/message/_mapping?pretty=true -d '{"message" : {"_routing": { "path": "_org"} }}'
Output
{
"ok" : true,
"acknowledged" : true
}
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
#~/.local/share/applications/mimeapps.list
[Added Associations]
#...
x-scheme-handler/subl=subl-urlhandler.desktop