Skip to content

Instantly share code, notes, and snippets.

View njpatel's full-sized avatar
📞
Were you really going to call me?

Neil Jagdish Patel njpatel

📞
Were you really going to call me?
View GitHub Profile
@njpatel
njpatel / nginx.toml
Last active April 5, 2023 14:01 — forked from yellow1912/nginx.toml
Sample Vector configuration for nginx
# you may want to skip access, you will gets tons of logs
[sources.nginx_access_logs]
type = "file"
include = ["/var/log/sites/*/*/*/*/nginx/access.log"] # supports globbing
ignore_older = 86400 # 1 day
# product json logs
[transforms.nginx_access_logs_json]
type = "json_parser"
inputs = ["nginx_access_logs"]
package webhook
type Webhook struct {
type string `json:"type"`
payload json.RawMessage `json:"payload""`
}
black = '#3b4252';
red = '#bf616a'; // red
green = '#a3be8c'; // green
yellow = '#ebcb8b'; // yellow
blue = '#81a1c1'; // blue
magenta = '#b48ead'; // pink
cyan = '#88c0d0'; // cyan
white = '#e5e9f0'; // light gray
lightBlack = '#4c566a'; // medium gray
lightRed = '#bf616a'; // red
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
@njpatel
njpatel / keybase.md
Created July 14, 2016 09:07
keybase.md

Keybase proof

I hereby claim:

  • I am njpatel on github.
  • I am njpatel (https://keybase.io/njpatel) on keybase.
  • I have a public key whose fingerprint is 4948 C6B3 8568 CA30 47F7 2EEF 6103 E16B B1A7 F8F0

To claim this, I am signing this object:

func (installer BkInstaller) Run() ) (err error) {
installer.log("Start installer bk")
err = installer.createTables()
if err == nil {
err = installer.stateIndex()
if err == nil {
err = installer.stateRelations()
}
}
@njpatel
njpatel / etc-salt-reactor
Created January 24, 2014 19:00
Fun with salt, basically running scripts on master when events are fired via the Reactor system. The names of the files are paths with - replacing /
<contents of normal file>
# Add any additional locations to look for master runners
runner_dirs: [/srv/runners]
# Register a reactor whenever a cloud provider emits 'created'
# the * is the name of the VM, we want any, but you could
# do something like salt/cloud/Webservers-*/created if you only
# wanted your webservers
reactor:
@njpatel
njpatel / tmux.conf
Created January 2, 2014 20:40
tmux.conf
set-option -g prefix C-a
unbind C-b
bind-key C-a send-prefix
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
set-option -g status-utf8 on
@njpatel
njpatel / rps.js
Created October 2, 2013 15:26
RockPaperAaron.js
var options = [ "rock", "paper", "scissors" ];
var results = [ "wins!", "loses!", "draws!" ];
var compare = {
rock: {
rock: 2,
paper: 0,
scissors: 1
},
paper: {