Skip to content

Instantly share code, notes, and snippets.

View varunyellina's full-sized avatar
🚲
Commute

Varun varunyellina

🚲
Commute
View GitHub Profile
@varunyellina
varunyellina / .zsh_aliases
Created December 12, 2017 15:34
Useful aliases for ZSH
# Changing Directory
alias .~='cd ~'
alias ..='cd ..'
alias .2='cd ../../'
alias .3='cd ../../../'
alias .4='cd ../../../../'
# List size of all folders
alias fsize='du -h -d 1 | sort -n'
@varunyellina
varunyellina / tweet-low-speed.py
Created February 2, 2016 03:08
When connection falls below advertised speeds, tweet to the company.
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@varunyellina
varunyellina / macos_homebrew_setup.sh
Last active April 24, 2024 10:20
Install Xcode Command Line Tools, use Homebrew to install drivers, tools, apps and fonts on macOS
#!/bin/sh
# Scroll to bottom of this file to comment out sections that you don't need.
# This script exits whenever a particular tool / app / driver installation gives an error.
# Do watch out for apps that need you to open the installer from Homebrew's cache i.e Cellar. Ex: Little Snitch
########################
# Script Functions - Will be called later in the script
########################
@varunyellina
varunyellina / localsite
Last active October 7, 2015 17:22
Nginx configuration for dynamic resolution of site path, useful for development couple with dnsmasq.
server {
listen 80;
server_name ~^(?<localsite>\w+)\.dev$;
root /Users/varunyellina/Sites/$localsite;
access_log /usr/local/etc/nginx/logs/default.access.log;
}
@varunyellina
varunyellina / default
Last active October 7, 2015 17:22
Nginx configuration for default site
server {
listen 80;
server_name localhost;
root /Users/varunyellina/Sites/;
access_log /usr/local/etc/nginx/logs/default.access.log;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
worker_processes 1;
error_log /usr/local/etc/nginx/logs/error.log debug;
events {
worker_connections 256;
}
http {
include mime.types;
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@varunyellina
varunyellina / CreateMangaBook
Created November 2, 2014 14:37
Zip all folders in current directory and then change their extension.
#!/bin/sh
# Here i is the variable to which foldernames are assigned. %/ removes the trailing / from the filename when zipping
for i in */; do zip -r "${i%/}.zip" "$i"; done
# Rename the above zip files to have the extension .cbr for use with Comic book readers.
for i in *.zip; do mv "$i" "${i%.zip}.cbr"; done