Skip to content

Instantly share code, notes, and snippets.

@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 / piix4_smbus.md
Last active January 29, 2023 16:45
VirtualBox piix4_smbus Error during VM boot

Problem

During VM boot we see an error from piix4_smbus and in dmesg something like:

piix4_smbus 0000:00:07.3: Host SMBus controller not enabled!

This error is caused by VM having no smbus but Ubuntu always trying to load the module. It doesn’t affect anything but is a bit annoying. Originally this error was reported on VirtualBox and Ubuntu 10.10, but I still see it in Ubuntu 13.10. It also exist on VMware Fusion.

apt-get install build-essential module-assistant
m-a prepare
@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.
#!/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 / 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}"
@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 / 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 / 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 / gist:7214736
Created October 29, 2013 13:35
Mac tricks from HagZag
from iTerm -> clipboard
>> pbcopy < file