Skip to content

Instantly share code, notes, and snippets.

View sawantuday's full-sized avatar

Uday R Sawant sawantuday

  • J.P. Morgan Chase & Co
  • India
View GitHub Profile

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@sawantuday
sawantuday / iptables_rules.sh
Created December 5, 2016 09:58 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@sawantuday
sawantuday / udplb.py
Created November 16, 2016 15:24 — forked from obormot/udplb.py
Simple UDP load balancer
#!/usr/bin/env python
#------------------------------------------------------------------------------
# UDP Load Balancer featuring simple round robin with session affinity.
#------------------------------------------------------------------------------
import sys
import signal
import logging
from socket import *
@sawantuday
sawantuday / amazon.rb
Created November 4, 2016 14:55 — forked from upvalue/amazon.rb
Amazon affiliate filters for jekyll.
# amazon.rb - amazon affiliate links for jekyll
# assumes that you have a configuration variable called 'amazon_associate_id' with your associate id
# usage: {{ asin | amazon_product_href }}
# returns url of a product
# usage: {{ asin | amazon_image_href: 'M' }}
# returns image of the product, size argument can be S, M, or L, default M
# usage: {{ asin | amazon_product: 'A Product' }}
@sawantuday
sawantuday / Syslog.php
Created September 22, 2016 12:58 — forked from coderofsalvation/Syslog.php
static php class for syslog-style logging to local syslogdaemon (native php), remote syslog server, or papertrailapp
/*
* PLEASE DO NOT USE THIS CODE, BUT GO TO: https://github.com/coderofsalvation/syslog-flexible
*/
// local, remote and papertrail compatible syslogclass
class Syslog{
public static $hostname = false;
public static $port = 514;
public static $program = "[]";
@sawantuday
sawantuday / send_remote_syslog.php
Created September 22, 2016 12:40 — forked from troy/send_remote_syslog.php
Send UDP remote syslog message from PHP (RFC 3164)
# replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT
# see http://help.papertrailapp.com/ for additional PHP syslog options
function send_remote_syslog($message, $component = "web", $program = "next_big_thing") {
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
foreach(explode("\n", $message) as $line) {
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line;
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT);
}
socket_close($sock);
@sawantuday
sawantuday / phantomjsGoogleSearch
Created July 13, 2016 14:57 — forked from ndhu/phantomjsGoogleSearch
phantomjs. example on how to search google, collect links of search result and scrape multiple pages of the search result
/**
* Created by andy hulstkamp
*/
var webpage = require("webpage"),
fs = require("fs");
var debug = false,
pageIndex = 0,
allLinks = [],
@sawantuday
sawantuday / uri.js
Created June 23, 2016 10:25 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@sawantuday
sawantuday / headless.md
Created June 17, 2016 09:18 — forked from addyosmani/headless.md
So, you want to run Chrome headless.

#If you're on Ubuntu or working with a Linux VM...

Step 1: Install the Ubuntu dependencies needed:

SSH into your server as a root or do sudo -i.

Then install necessary software:

apt-get update
@sawantuday
sawantuday / gist:a795fdd6fac97b51b7f6b6a1adf2218f
Created May 29, 2016 12:50 — forked from smoser/gist:4756561
boot a cloud image in kvm
## Install a necessary packages
$ sudo apt-get install kvm cloud-utils genisoimage
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
$ img_url="${img_url}/ubuntu-12.04-server-cloudimg-amd64-disk1.img"
## download the image
$ wget $img_url -O disk.img.dist
## Create a file with some user-data in it