Skip to content

Instantly share code, notes, and snippets.

remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
@pearofducks
pearofducks / rbenv-install.sh
Last active December 16, 2015 18:59
Rbenv local install and ruby 2.0-p0 on deb/ubuntu
#!/bin/bash
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential
sudo apt-get -y install git-core
sudo apt-get -y install libssl1.0.0 libssl-dev
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
source ~/.bash_profile
@pearofducks
pearofducks / rbenv-zsh-install-p1.sh
Last active February 23, 2023 22:38
rbenv installer for zsh (on debian and mac)
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential git-core libssl1.0.0 libssl-dev libreadline-dev zlib1g-dev
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo '
====================================
You should add this stuff to your zshrc now,
then reload shell and run p2!
@pearofducks
pearofducks / gist:6103053
Created July 29, 2013 08:54
useful ruby snippets
# get both ouput and result from a shellout
output=`ls no_existing_file` ; result=$?.success?
@pearofducks
pearofducks / macos-ansible-install.txt
Last active December 20, 2015 11:19
MacOS - Ansible homebrew install
brew install python
pip install PyYAML jinja2
sudo pip install ansible
# paramiko isn't needed, MacOS has new enough ssh
# sudo is needed for the ansible install because it wants to put resources in /usr/share
# an alternative to using sudo is to checkout ansible from
https://github.com/ansible/ansible
# then run in the root of the git checkout
@pearofducks
pearofducks / gist:6132471
Created August 1, 2013 15:30
random command line snippets
find . -type f -exec sed -i "" "s#/usr/share/#/usr/local/share/#g" '{}' \;
@pearofducks
pearofducks / gist:6875751
Created October 7, 2013 22:06
make mavericks boot disk
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
@pearofducks
pearofducks / etc_init.d_eye
Created January 18, 2014 17:01
Eye files for Debian
#!/bin/bash
#
# eye Startup script for Eye monitoring tool.
#
# chkconfig: - 85 15
# description: eye monitors your system
#
CONF_DIR=/etc/eye/eye.conf
PID=/var/run/eye.pid
@pearofducks
pearofducks / ruby_setup.sh
Last active August 29, 2015 14:04
Ruby setup for debian/ubuntu
#!/bin/bash
apt-get update -y
apt-get install -y build-essential
wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
tar -xzvf ruby-install-0.5.0.tar.gz
cd ruby-install-0.5.0/
make install
@pearofducks
pearofducks / gist:db187b132cdf5d568de0
Created August 25, 2014 11:31
Python fix UTF-8 encoding
import sys
reload(sys) # Reload does the trick!
sys.setdefaultencoding('UTF8')