Skip to content

Instantly share code, notes, and snippets.

@nkabir
nkabir / sh_env_var_opts.sh
Created April 13, 2016 18:47 — forked from KylePDavis/sh_env_var_opts.sh
Simple bash shell script templates. There are two versions: 1) simple env var based options, and 2) with added command line argument parsing and error handling.
#!/bin/bash -e
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE
# USAGE:
# DESCRIPTION OF ENV VARS HERE
###############################################################################
set -e # exit on command errors (so you MUST handle exit codes properly!)
set -o pipefail # capture fail exit codes in piped commands
#set -x # execution tracing debug messages
# Get command info
@nkabir
nkabir / bookmarks.md
Created November 1, 2015 18:55 — forked from boneskull/bookmarks.md
How to use Mercurial bookmarks

How to Use Mercurial Bookmarks

Note: This document is specific to the FocusVision development environment, however it's mostly applicable elsewhere.

by Christopher Hiller

Mercurial branches are not "cheap". Unlike Git, to create or destroy a branch, you actually have to commit a changeset to the repository. Branches are great for…something…but whatever that is, we're not doing it.

Enter Bookmarks.

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName elasticsearch.domain.tld
ServerAlias kibana.domain.tld
DocumentRoot /path/to/kibana/docroot
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /path/to/kibana/docroot>
var adv = {};
adv.Adv = function (data) {
this.symList = m.prop([]);
this.barSize = m.prop(10);
this.days = m.prop(5);
this.pb = pb.init();
this.path = this.pb.url + 'adv/';
this.message = 'AverageDailyVolume';
this.request = this.pb.ts[this.message + 'Request'];
this.response = this.pb.ts[this.message + 'Response'];
<!DOCTYPE html>
<script type="text/javascript" src="http:cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/highstock/1.3.7/highstock.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/samples/data/usdeur.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.18/mithril.min.js"></script>
<script type="text/javascript">
var app = {};
app.App = function(data){
this.plotCfg = {
chart: {

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

Keybase proof

I hereby claim:

  • I am nkabir on github.
  • I am nkabir (https://keybase.io/nkabir) on keybase.
  • I have a public key whose fingerprint is 9CFE 064B 9FF8 DD6E DC38 674F EF67 1299 10BC 09F6

To claim this, I am signing this object:

@nkabir
nkabir / flaky.sh
Last active August 29, 2015 14:05
#!/usr/bin/env bash
if [ -z "${1}" ]; then
echo "usage: ${0} {site uri eg http://google.com}"
exit 1
fi
curl "${1}" > /dev/null 2>&1
@nkabir
nkabir / Packages
Last active August 29, 2015 14:05
Debian Packages file
Package: bbmint
Version: 3.2.0-1
Maintainer: RocketKnowledge Research
Architecture: amd64
Priority: 1
Section: main
Filename: pool/main/b/bbmint/bbmint_3.2.0-1_amd64.deb
Size: 37296
SHA256: 5ec6a1d044695905b797a435c5deea595dcc248e9f5421b0a30660bc4b53ab3b
SHA1: f843443348fb73d57b28e64f8bf0879680f76f23
@nkabir
nkabir / docker
Last active August 29, 2015 14:04
docker-apache-config
<VirtualHost *:443>
ServerName europa04
ServerAdmin [email protected]
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/docker-cert.pem
SSLCertificateKeyFile /etc/apache2/ssl/docker-key.pem
SSLCACertificateFile /etc//ssl/certs/fimero-ca.pem
ProxyRequests off