Skip to content

Instantly share code, notes, and snippets.

@otzoran
otzoran / msfonts_wrapper.sh
Created October 10, 2013 17:08
Add Microsoft Fonts (Including Tahoma) on Ubuntu; tested on 12.x, 13.04
#!/bin/bash
# Install Microsoft Fonts (Including Tahoma) on Ubuntu
# Source: http://ubuntuforums.org/archive/index.php/t-1459709.html
# Ubuntu Forums > The Ubuntu Forum Community > Ubuntu Specialised Discussions > Art & Design > [SOLVED] How to Install Tahoma TTF
# by trentscott, April 22nd, 2010, 12:51 AM :: Simplified by me
prog=$(basename $0)
if [ $(id -u) != 0 ]; then
@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'
@otzoran
otzoran / xui
Created October 15, 2013 14:16
from "tweaks..", Ubuntu UI move min/max/close win buttons to the right works for Unity && gnome-fallback/gnome-panel
gconftool-2 --set "/apps/metacity/general/button_layout" --type string ":minimize,maximize,close"
@otzoran
otzoran / vimming
Created October 15, 2013 19:19
vim memo
# copy from vim to XCLIPBOARD, using reg '+' (or '*')
"+yG
@otzoran
otzoran / gist:7214736
Created October 29, 2013 13:35
Mac tricks from HagZag
from iTerm -> clipboard
>> pbcopy < file
@otzoran
otzoran / gist:7439195
Last active December 28, 2015 03:59
sudo nopass
sudo -i
if [[ -d /etc/sudoers.d ]]; then
echo "ori ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/ori
chmod 440 !$
chown root:root !$ #match the owner && perms of README
elif [[ -e /etc/sudoers ]]; then
echo "ori ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
else
echo "Failed to add ori to sudoers"
fi
@otzoran
otzoran / git-memo.md
Last active December 30, 2015 12:59
git memo

uploaded from otxe6530::git-memo

undo commit

git reset --soft HEAD^	    #and move from that commit to staging

git reset --hard HEAD^	    #and wipe changes, files aren't put in staging (reverted)

git reset --hard HEAD^^	    #revert to 2 commits back

Here's a comforting quote from Scott Chacon:

@otzoran
otzoran / prep-vbox-export.md
Last active December 31, 2017 12:57
prepare a vbox VM for export

as root

cat /dev/zero > /EMP000

then

rm /EMP000

@otzoran
otzoran / vagrant-snippet.rb
Last active October 9, 2018 06:55
Vagrant
## Vagrantfile
config.vm.provider :virtualbox do |vb|
# start windowed (default is headless)
vb.gui = true
vb.customize [ "modifyvm", :id, "--memory", "512"]
vb.name = "#{NAME}"
#!/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`