Skip to content

Instantly share code, notes, and snippets.

View tehmaspc's full-sized avatar
💭
I may be slow to respond.

Tehmasp Chaudhri tehmaspc

💭
I may be slow to respond.
View GitHub Profile
@tehmaspc
tehmaspc / rachel.zsh-theme
Created March 15, 2019 19:05
rachel.zsh-theme
setopt nocorrect
ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%}?%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
@tehmaspc
tehmaspc / gist:cb2b49ec99678c443775
Created August 8, 2015 14:13
Stylebot CSS - GMail Font
URL: mail.google.com, www.google.com/calendar
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd {
font-family: San Francisco Display;
}
### Keybase proof
I hereby claim:
* I am tehmaspc on github.
* I am tehmasp (https://keybase.io/tehmasp) on keybase.
* I have a public key whose fingerprint is 1F1C 83D6 9EA1 43FA 7935 9864 65B4 03D8 6E33 611D
To claim this, I am signing this object:
@tehmaspc
tehmaspc / userstyle.css
Last active August 29, 2015 14:16 — forked from roustem/userstyle.css
Flowdock userstyle.css
/* install as '~/Library/Application Support/Flowdock/userstyle.css' */
@media screen {
* {
font-family: "San Francisco Display";
}
#chat li[class*="message"] {
font-family: "San Francisco Display";
font-size: 9pt;
#!/usr/bin/env sh
# Download lists, unpack and filter, write to gzipped file
curl -s https://www.iblocklist.com/lists.php \
| grep -A 2 Bluetack \
| sed -n "s/.*value='\(http:.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#' \
| gzip - > bt_blocklist.gz
@tehmaspc
tehmaspc / openconnect_macosx.md
Last active December 31, 2015 18:39
Using OpenConnect CLI On MacOS X For Cisco VPN Devices

I use OpenConnect on Linux to connect to Cisco VPN devices for work, but on MacOS X I usually have to use the crappy Cisco AnyConnect GUI application. The following is how to set up the same thing on MacOS X and avoid having to use the AnyConnect application:

  1. Install OpenConnect via homebrew (install homebrew first if you don't have it already - which you should because it's awesome!):

     brew update  
     brew install openconnect
    
  2. Install the necessary MacOS X TUN/TAP driver.

  3. Give the 'openconnect' binary SUDO privileges:

@tehmaspc
tehmaspc / elasticsearch_realloc_unassign_shards.sh
Last active December 31, 2015 04:59
Reallocating ElasticSearch Unassigned Shards
#!/bin/bash
set -f
IFS='
'
# NOTE1: file 'list_of_unassigned_shards.txt' should be present
# NOTE2: list of unassigned shards in file should be in '<SHARD> <INDEX>' format (per line).
MASTER_NODE='anDcaGBJRY2WXJe_rOjdMQ' # master node in cluster
MASTER_NODE_IP='10.199.242.111' # ip address of master node in cluster
@tehmaspc
tehmaspc / hosts_setup.sh
Last active March 15, 2019 17:07
Create Multi-VM Vagrant Setup w/ Multi-Provisioners (shell, puppet). The following example shows 5 VMs being created via a single Vagrantfile. Each VM has as unique configuration and uses both a shell provisioner and a Puppet provisioner. The 'default' VM exists for serverspec testing.
#!/bin/bash
# these hostname values should match the Vagrantfile box configurations
STAGE='/etc/first_stage'
if [ ! -e $STAGE ]; then
echo '10.0.1.100 gfs-s1' >> /etc/hosts
echo '10.0.1.101 gfs-s2' >> /etc/hosts
This statement grants permissions to any user to perform any S3 action on objects in the specified bucket. However, the request must originate from the range of IP addresses specified in the condition. The condition in this statement identifies 192.168.143.* range of allowed IP addresses with one exception, 192.168.143.188.
Note that the IPAddress and NotIpAddress values specified in the condition uses CIDR notation described in RFC 2632. For more information, go to http://www.rfc-editor.org/rfc/rfc4632.txt.
@tehmaspc
tehmaspc / .tmux.conf
Created May 21, 2012 00:55 — forked from wridgers/.tmux.conf
tmux config file
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
# Reload key
bind r source-file ~/.tmux.conf
set -g history-limit 1000