Skip to content

Instantly share code, notes, and snippets.

@AndrewRussellHayes
AndrewRussellHayes / boot_10_10.sh
Last active August 29, 2015 14:09
This will create an OSX 10.10 bootable drive. NOTE: name the drive volume 'Untitled' From http://www.macworld.com/article/2367748/how-to-make-a-bootable-os-x-10-10-yosemite-install-drive.html
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
@AndrewRussellHayes
AndrewRussellHayes / fix_git_vi.sh
Created November 10, 2014 09:34
fixes git bug: "error: There was a problem with the editor 'vi'." probably an error with the vimrc but who cares this fixes it. this happens when vi/vim exits with a 'non 0' exit code. From http://tooky.co.uk/there-was-a-problem-with-the-editor-vi-git-on-mac-os-x/
$ git config --global core.editor /usr/bin/vim
@AndrewRussellHayes
AndrewRussellHayes / git_rm_confilict.sh
Last active August 29, 2015 14:09
for error in git: fatal: Reference has invalid format: 'refs/heads/master...' From http://stackoverflow.com/questions/12773488/git-fatal-reference-has-invalid-format-refs-heads-master
find . -type f -name "* conflicted copy*" -exec rm -f {} \;
@AndrewRussellHayes
AndrewRussellHayes / Docker_shortcuts.sh
Created November 4, 2014 20:00
list of lines in my bashrc to make docker use much more simple
#docker stuff.. move into own file
#Docker alias's
alias dpsa="docker ps -a"
alias dps="docker ps"
#docker envs
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=/Users/andrew/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1
echo ".bashrc boot2docker command results: (Should see 3 lines:)"
(boot2docker shellinit)
@AndrewRussellHayes
AndrewRussellHayes / boot2dockerSSH.sh
Created November 3, 2014 05:38
ssh into boot2docker vm
SSH into VM
$ boot2docker ssh
Boot2Docker auto logs in using the generated SSH key, but if you want to SSH into the machine manually (or you're not using a boot2docker managed VM), the credentials are:
user: docker
pass: tcuser
@AndrewRussellHayes
AndrewRussellHayes / build.sh
Last active October 21, 2015 18:09
building an image called andrewrussellhayes/dev with tag of 0.1
docker build -t andrewrussellhayes/dev:0.1 ./.
@AndrewRussellHayes
AndrewRussellHayes / start_docker_centos_detached_Bash.sh
Last active August 29, 2015 14:08
start a docker centos image detached with stdin and a pseudo-tty to keep it running like a vm until bash is killed
docker run -t -i -d centos /bin/bash
@AndrewRussellHayes
AndrewRussellHayes / Boot2Docker_Rebuild.sh
Last active August 29, 2015 14:08
boot2docker vm rebuild. this gets rid of images that wont delet
b2d(){
boot2docker $1;
}
b2d poweroff
b2d delete
b2d init
b2d up
@AndrewRussellHayes
AndrewRussellHayes / perl numeric hash key sort.pl
Created September 22, 2014 19:17
perl sort hash keys numeric
foreach my $distance (sort {$a <=> $b} keys %planets) {
say $distance;
}
@AndrewRussellHayes
AndrewRussellHayes / sort hash keys.pl
Last active August 29, 2015 14:06
for each keys in sort hash alphabetic sort
foreach my $name (sort keys %planets) {
printf "%-8s %s\n", $name, $planets{$name};
}