Skip to content

Instantly share code, notes, and snippets.

View fizerkhan's full-sized avatar

Fizer Khan (பைசர் கான்) fizerkhan

View GitHub Profile
struct { initialized bool; configHandlers []nsq.configHandler; DialTimeout time.Duration "opt:\"dial_timeout\" default:\"1s\""; ReadTimeout time.Duration "opt:\"read_timeout\" min:\"100ms\" max:\"5m\" default:\"60s\""; WriteTimeout time.Duration "opt:\"write_timeout\" min:\"100ms\" max:\"5m\" default:\"1s\""; LocalAddr net.Addr "opt:\"local_addr\""; LookupdPollInterval time.Duration "opt:\"lookupd_poll_interval\" min:\"5s\" max:\"5m\" default:\"60s\""; LookupdPollJitter float64 "opt:\"lookupd_poll_jitter\" min:\"0\" max:\"1\" default:\"0.3\""; MaxRequeueDelay time.Duration "opt:\"max_requeue_delay\" min:\"0\" max:\"60m\" default:\"15m\""; DefaultRequeueDelay time.Duration "opt:\"default_requeue_delay\" min:\"0\" max:\"60m\" default:\"90s\""; BackoffMultiplier time.Duration "opt:\"backoff_multiplier\" min:\"0\" max:\"60m\" default:\"1s\""; MaxAttempts uint16 "opt:\"max_attempts\" min:\"0\" max:\"65535\" default:\"5\""; LowRdyIdleTimeout time.Duration "opt:\"low_rdy_idle_timeout\" min:\"1s\" max:\"5m\" default:
@fizerkhan
fizerkhan / IAM_Policy.json
Last active August 29, 2015 14:20
What IAM policy do I need for S3 backups?
{
"Version": "2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Action":"s3:*",
"Resource":[
"arn:aws:s3:::BUCKET_NAME",
"arn:aws:s3:::BUCKET_NAME/*"
]
@fizerkhan
fizerkhan / beacon.js
Last active August 29, 2015 14:19 — forked from ruturajv/beacon.js
http = require('http');
url = require('url');
http.createServer(function(req, res){
var requestURL = url.parse(req.url, true)['pathname'];
if (requestURL == '/log.gif') {
var imgHex = '47494638396101000100800000dbdfef00000021f90401000000002c00000000010001000002024401003b';
var imgBinary = new Buffer(imgHex, 'hex');
res.writeHead(200, {'Content-Type': 'image/gif' });
@fizerkhan
fizerkhan / how_nodejs_works.md
Created April 23, 2015 14:08
How NodeJS works?

Node.JS

http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@fizerkhan
fizerkhan / dokku-node-mongo.md
Last active June 26, 2024 09:36
NodeJS and MongoDB app in Dokku with Digital Ocean

Steps:

  1. Create Digital Ocean Droplet with Dokku v0.3.16 on 14.04 image

  2. Login into the droplet and Update local settings.

    sh -c "echo 'LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8' > /etc/default/locale"
    reboot
@fizerkhan
fizerkhan / dokku-mongodb.md
Last active August 29, 2015 14:18
MongoDB auth issue in Dokku

When i run MongoDB dokku plugin, it does not work with my NodeJS app. Also dokku mongodb:list does not work. It throws MongoError: auth failed docker

It can be fixed by setting proper locals:

 sh -c "echo 'LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8' > /etc/default/locale"
@fizerkhan
fizerkhan / hosts
Created April 1, 2015 13:33
Ansible variable procedence
[servers]
127.0.0.1
@fizerkhan
fizerkhan / gist:41f9c525db5b3b16bfcb
Last active March 28, 2023 19:54
RSA Host Key has been changed.

Solution for RSA host key for <ip_address> has changed and you have requested strict checking:

Method 1: Remove keys

ssh-keygen -R <server_name>

(or)

ssh-keygen -R