Skip to content

Instantly share code, notes, and snippets.

View kitwalker12's full-sized avatar

Kunwar Aditya Raghuwanshi kitwalker12

View GitHub Profile
@kitwalker12
kitwalker12 / combine.sh
Created February 17, 2016 23:16
Combile multiple files with separator
awk 'FNR==1{print "// ------------------------------------------------------------------------------------------------"}1' *.md > combined.md
@kitwalker12
kitwalker12 / Dockerfile
Last active January 26, 2016 23:36
Docker Log test
FROM ubuntu:trusty
COPY ./entrypoint.sh /
COPY ./run.sh /
RUN chmod +x /entrypoint.sh
RUN chmod +x /run.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["start"]
@kitwalker12
kitwalker12 / deviseCheck.js
Last active January 26, 2016 18:30 — forked from CodingFu/deviseCheck.js
Simple devise user login check in node.js
var bcrypt = require('bcrypt')
function checkUser(encrypted_password, password) {
bcrypt.compare(password, encrypted_password, function(err, res) {
console.log(err)
console.log(res) //true or false
};
@kitwalker12
kitwalker12 / node-package-list.md
Created January 22, 2016 23:10
Useful node packages (compiled as I use them)
  • concat-stream
  • express
  • body-parser
  • crypto
  • fs
  • path
  • split
  • through2
  • level
  • level-sublevel
@kitwalker12
kitwalker12 / Dockerfile
Last active February 21, 2020 16:14
docker splunk forwarder
FROM ubuntu:trusty
# make the "en_US.UTF-8" locale so splunk will be utf-8 enabled by default
RUN apt-get update && apt-get install -y locales wget \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
#Install Splunk
RUN wget -qO splunkforwarder.deb http://download.splunk.com/releases/6.2.3/universalforwarder/linux/splunkforwarder-6.2.3-264376-linux-2.6-amd64.deb -o splunkforwarder.deb \
&& dpkg -i splunkforwarder.deb \
&& rm splunkforwarder.deb
@kitwalker12
kitwalker12 / UbuntuNameserverGoogle.md
Last active January 7, 2016 19:48
Set up Google Nameservers on Ubuntu
  • in /etc/resolvconf/resolv.conf.d/base nameserver 8.8.8.8

  • in /etc/resolvconf/resolv.conf.d/head nameserver 8.8.4.4

  • then run sudo resolvconf -u

@kitwalker12
kitwalker12 / splunk.sh
Created January 5, 2016 02:25
Splunk use modified time for query + dedup ascending time
eval _time=strptime(some_time_field,"%Y-%m-%dT%H:%M:%S%z")
dedup source sortby +_time
@kitwalker12
kitwalker12 / .0-Rails-Tutum.md
Last active September 14, 2016 17:58
Dockerized Rails on Tutum (Passenger + HAProxy)

How to deploy rails in tutum as a production server behing HAproxy on Passenger

docker build -t 'my_image_name:latest' . && tutum image push my_image_name:latest

@kitwalker12
kitwalker12 / reject_validations.rb
Created October 27, 2015 00:46
Rails reject validations
module Spree
Address.class_eval do
_validators.reject!{ |key, value| key == :phone }
_validate_callbacks.each do |callback|
callback.raw_filter.attributes.reject! { |key| key == :phone } if callback.raw_filter.respond_to?(:attributes)
end
end
end
@kitwalker12
kitwalker12 / deis.yaml
Last active August 29, 2015 14:25 — forked from paulczar/deis.yaml
Heat Template for installing DEIS
heat_template_version: 2013-05-23
description: Deploy a CoreOS cluster that tracks the Stable Channel
parameters:
count:
description: Number of CoreOS machines to deploy
type: number
default: 3
constraints: