Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# -------------------------------------------------
# set ruby version
RUBYVERSION=1.9.3-p429
# RUBYVERSION=system
CHEFDIR=/var/lib/chef
export PATH=/usr/local/sbin:/usr/local/bin:$PATH
DISTRIBUTION=`lsb_release -si`
@otzoran
otzoran / memo.md
Last active August 29, 2015 13:56
git index, cache, staging area

What is git index?

see explanation

git add -p

-p, --patch
Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives
the user a chance to review the difference before adding modified contents to the index.

The git index goes by many names.
apt-get install build-essential module-assistant
m-a prepare
@otzoran
otzoran / chrome-install.sh
Created August 31, 2014 12:41
Chrome Installation on Ubu - script steps - tested on 14.04
#!/bin/bash
set -ex
[[ $(id -u) == 0 ]] || { echo "Buddy needs to be root to run this"; exit 1; }
[[ $PWD == "/root" ]] || { echo "Run this from /root"; exit 1; }
# 1. Download key
wget -q -O google_signing_key.pub https://dl-ssl.google.com/linux/linux_signing_key.pub
apt-key add google_signing_key.pub
@otzoran
otzoran / truecrypt_fix.bash
Last active August 29, 2015 14:16 — forked from yiufung/truecrypt_fix.bash
Fixes annoying brew doctor messages caused by Truecrypt - tested on Yosemite
#!/usr/bin/env bash
# Author: Ori Tzoran, based on idea and gist by aaronzirbes (see evolution below)
# Tested on Mac OS X 10.10.2 (14C109)
set -e
## verify root runs this
[[ $(id -u) == 0 ]] || { echo need root; exit 1; }
#set -vx
@otzoran
otzoran / check bash interactive.md
Last active August 29, 2015 14:26
Check if bash shell is interactive

The old way

if tty -s; then
  echo "interactive"
fi

Cons

This method does the job, but invloves process invocation (fork/exec) of tty, which is expensive in terms of performance.
But there's a worse side-effect:
If PATH is empty or wrong, calling tty will fail. When sourced for a login shell,

@otzoran
otzoran / env_ec2.sh
Created August 6, 2015 12:11
env file for Mac, brew to work with EC2
# vim: set filetype=sh :
# Purpose
# set environment variables for EC2_URL EC2_HOME JAVA_HOME CLASSPATH
# required by ec2-api-tools, used by other tools (e.g. vagrant)
# Usage:
# source this
# create local env.monsoon in a project's subdir defining:
# export AWS_PROJECT="MOCONS / rmjen"
@otzoran
otzoran / virtualbox_prereq_guest_additions.md
Last active August 29, 2015 14:27
Installing Guest Additions on Debian Ubuntu Mint etc.

Installing Guest Additions on Debian

Follow these steps to install the Guest Additions on your Debian virtual machine:

sudo -i
apt-get update && apt-get upgrade
apt-get install build-essential module-assistant
# Configure your system for building kernel modules by running:
m-a prepare
@otzoran
otzoran / Replace_Unity_by_MATE.md
Created August 9, 2015 22:07
Ubuntu: Replace Unity by MATE

The proc is explained here

@otzoran
otzoran / bashrc
Last active December 25, 2015 11:09
aliases - bash
alias ll='ls -lah --color=tty --time-style=long'
alias grep='grep --color=tty'
alias mydate='date "+%F %H:%M"'
alias olsblk='lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,TYPE '
alias dv='dirs -v'
alias po='popd '
alias pu='pushd '
alias s='git status '
alias xr='xrandr --verbose --output VGA1 --primary --mode 1920x1080'