Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
got ci/cd? want some? get in touch

Chetan Sarva chetan

🤖
got ci/cd? want some? get in touch
View GitHub Profile
View gmailAutoarchive.js
// Original author fwed (contact@fwed.fr)
// Modified from
// https://gist.github.com/0x4a/e410aa72fca06fcfafce9f00ff47d82c
// https://gist.github.com/anonymous/2cca33d376f7f924fdaa67891ad098cc
// https://medium.com/@fw3d/auto-archive-emails-in-gmail-after-2-days-1ebf0e076b1c
var OP_ARCHIVE = 1;
var OP_READ = 2;
var OP_DELETE = 4;
@chetan
chetan / db.rake
Last active Dec 19, 2017 — forked from e12e/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
View db.rake
# lib/tasks/db.rake
# Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90
# Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6
#
# This is the code from the comment:
# https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90#gistcomment-2275324
# Made into a fork/separate gist for easier download, with redundant shell-script removed.
#
#
# Usage:
View update-route53.sh
#!/bin/bash
# Copied from http://willwarren.com/2014/07/03/roll-dynamic-dns-service-using-amazon-route53/
# Externalizing the zone ID and CNAME
if [ -z "$1" ]
then
echo "The first argument needs to be the Hosted Zone ID, i.e. BJBK35SKMM9OE"
exit 1
fi
@chetan
chetan / WDTVLive.xml
Last active Apr 17, 2017 — forked from darth-veitcher/WDTVLive.xml
plex media server dlna profile for wdtv live
View WDTVLive.xml
<Client name="WD TV Live HD Media Player">
<!-- Author: Plex Inc. -->
<!-- http://www.wdc.com/w...4779-705035.pdf -->
<!-- Model number tested: WDBAAN0000NBK -->
<!-- TODO - a few more limitations around codec profiles, which are high enough that they're probably not worth listing at present -->
<Identification>
<Header name="User-Agent" substring="alphanetworks" />
<Header name="User-Agent" substring="ALPHA Networks" />
</Identification>
<Settings>
@chetan
chetan / tomcat.initd.sh
Last active Apr 12, 2019 — forked from valotas/tomcat.sh
tomcat init.d script
View tomcat.initd.sh
#!/bin/bash
#
# tomcat This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
View gist:7515779
def apps = [ "app1":
[ "repos": ["foo", "bar"],
"name": "app1",
"version": 1
],
"app2":
[ "repos": ["foo"],
"name": "app2",
"version": 3
@chetan
chetan / new_bashrc.sh
Created Aug 31, 2012 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
View new_bashrc.sh
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
@chetan
chetan / latency.txt
Created May 31, 2012 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.txt
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns 3 µs
Send 2K bytes over 1 Gbps network 20,000 ns 20 µs
Read 1 MB sequentially from memory 250,000 ns 250 µs
Round trip within same datacenter 500,000 ns 0.5 ms
Disk seek 10,000,000 ns 10 ms
@chetan
chetan / ideal ops.md
Created May 30, 2012 — forked from bhenerey/ideal ops.md
ideal ops checklist
View ideal ops.md

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

@chetan
chetan / gist:1189452
Created Sep 2, 2011 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
View gist:1189452
Day job: Sr. Developer @ Evidon
Favorite Python project: boto
Favorite Conference: DEFCON
Python Experience Level: intermediate
You can’t perform that action at this time.