Skip to content

Instantly share code, notes, and snippets.

View preetampvp's full-sized avatar

Preetam Pattanashetty preetampvp

  • Melbourne, Australia
View GitHub Profile
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@preetampvp
preetampvp / puma.conf
Last active December 16, 2016 22:13
Upstart script to start puma - add this to /etc/init
pre-start script
pkill -f puma
end script
post-stop script
pkill -f puma
end script
respawn
respawn limit 15 5
@preetampvp
preetampvp / sidekiq.conf
Created December 16, 2016 21:17
Upstart script for sidekiq - add to /etc/init
respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel [06]
script
su - uid -c "cd <location> && bundle exec sidekiq" >> /var/log/sidekiq.log
end script
@preetampvp
preetampvp / osx-for-hackers.sh
Created December 30, 2016 13:10 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@preetampvp
preetampvp / The Technical Interview Cheat Sheet.md
Created December 30, 2016 13:15 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@preetampvp
preetampvp / linuxcommands.md
Last active February 3, 2017 04:19
Linux commands

ctrl-s - freezes the screen, ctrl-q unfreezes it. Useful to stop output without stopping program

at Do job at certain time

cron Execute script at certain intervals (daily, weekly, etc.).

du -k -s directory Get directory size

find rootdir -name filename Look for filename starting with rootdir.

@preetampvp
preetampvp / .vimrc
Created January 17, 2017 01:26
vimrc
call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-github-dashboard'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'kien/ctrlp.vim'
Plug 'kchmck/vim-coffee-script'
Plug 'bling/vim-airline'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'easymotion/vim-easymotion'
Plug 'marciomazza/vim-brogrammer-theme'
@preetampvp
preetampvp / .tmux.conf
Last active April 21, 2021 00:24
tmux config
set -g default-terminal "screen-256color"
# remap prefix to Control + Space
set -g prefix C-j
unbind C-b
bind C-j send-prefix
# force a reload of the config file
unbind R
bind R source-file ~/.tmux.conf\; display-message "Reloaded!!"
@preetampvp
preetampvp / tmux.md
Last active January 28, 2017 10:10
tmux cheatsheet

Shell

tmux new -s name - start a new session

tmux new -s name - start a new session in background

tmux new -s name -n window name "process to run" - start a new session with the window name set

tmux kill-session -t name - to kill a session

@preetampvp
preetampvp / apt-packages.md
Last active January 30, 2017 10:56
Ubuntu packages

unity-tweak-tool - tweak unity desktop

macfanctld - service to prevent mac from heating

powertop - power usage

tmux - tmux

liferea - rss reader