This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Note: ensure credentials file is at /opt/splunkclouduf.spl first | |
# download latest Splunk forwarder | |
wget http://download.splunk.com/products/splunk/releases/6.2.1/universalforwarder/linux/splunkforwarder-6.2.1-245427-Linux-x86_64.tgz | |
# untar | |
tar -zxvf splunkforwarder-6.2.1-245427-Linux-x86_64.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
box: wercker/nodejs | |
# Build definition | |
build: | |
# The steps that will be executed on build | |
steps: | |
# A step that executes `npm install` command | |
- npm-install | |
# A step that executes `npm test` command | |
- npm-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Api::UploadsController < ApiController | |
def create | |
@upload = Upload.new(upload_params) | |
ensure | |
clean_tempfile | |
end | |
private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 4 | |
timeout 20 | |
preload_app true | |
listen ENV['PORT'].to_i, backlog: 10 | |
before_fork do |server, worker| | |
Signal.trap 'TERM' do | |
puts 'Unicorn master intercepting TERM and sending myself QUIT instead' | |
Process.kill 'QUIT', Process.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Splunk Storm | |
$ wget [ Download Splunk url ] | |
$ gunzip -c splunkforwarder-5.0-140868-Linux-x86_64.tgz | tar -xvpf - | |
$ ./splunkforwarder/bin/splunk start | |
$ ./splunkforwarder/bin/splunk install app stormforwarder_3de50bc823a711e2b4a81231390e9c34.spl -auth admin:changeme | |
$ ./splunkforwarder/bin/splunk login -auth admin:changeme | |
$ ./splunkforwarder/bin/splunk edit user admin -password whatever_you_want | |
$ ./splunkforwarder/bin/splunk add forward-server forwarder.splunkstorm.com:9997 | |
$ ./splunkforwarder/bin/splunk add monitor /var/www/monologapp/log/fideloper.log # Starts sending data | |
$ ./splunkforwarder/bin/splunk add monitor /var/log/apache2/error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.editor = new wysihtml5.Editor("textarea"); | |
this.editor.observe("load", function () { | |
var $iframe = $(this.composer.iframe); | |
var $body = $(this.composer.element); | |
$body | |
.css({ | |
'min-height': 0, | |
'line-height': '20px', | |
'overflow': 'hidden', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var current_scroll = 0; | |
var last_mouse_y = null; | |
$(document) | |
.scroll(function() { | |
current_scroll = $(this).scrollTop(); | |
}) | |
.mousemove(function(e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_repeating(array) | |
0.upto(array.size - 1) do |i| | |
flag = array[array[i].abs] | |
flag = 1 if flag.nil? | |
if flag >= 0 | |
array[array[i].abs] = -flag | |
else |