Skip to content

Instantly share code, notes, and snippets.

@mauromorales
mauromorales / mauro.zsh-theme
Created May 25, 2012 05:12
My personal theme for oh my zsh
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local original='%{$fg_bold[red]%} %{$fg_bold[green]%}%p %{$fg[cyan]%}%c'
local git_branch='%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%}'
local svn_branch='%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
local ruby_version=''
if which rvm-prompt &> /dev/null; then
ruby_version='%{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%}'
rsync --version
# should answer something like
# rsync version 2.6.9 protocol version 29
@mauromorales
mauromorales / FileWave.rb
Created April 14, 2013 20:36
FileWave client installation for package distribution on OS X Mountain Lion.
module InventoryClient
class FileWave
def self.install_pkg(pkg)
`sudo /usr/sbin/installer -pkg #{pkg} -target /`
end
def self.install_fw
fw_pkg = 'fw_5.8.1_osx.pkg'
install_pkg(fw_pkg) if File.exists?(fw_pkg)
end
@mauromorales
mauromorales / clean_open_dictionary-apps.sh
Created May 9, 2013 17:01
Delete repeated apps that show up in AppleScript Editor's Open Dictionary
#source http://manski.net/2013/02/how-to-fix-multiple-items-in-the-open-with-menu-in-os-x/
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user && pkill Finder
# install the command line tools
# http://connect.apple.com
# if this doesn't work, install them from inside Xcode
# install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew doctor
# install git
brew install git
@mauromorales
mauromorales / remove-old-kernels.sh
Created May 25, 2013 11:52
Clean up old linux kernels WARNING: ONLY RUN AFTER UPDATING, UPGRADING AND REBOOTING SUCCESSFULLY taken from: http://askubuntu.com/questions/89710/how-do-i-free-up-more-space-in-boot
# clean up old kernels
# WARNING: ONLY RUN AFTER UPDATING, UPGRADING AND REBOOTING SUCCESSFULLY
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
# space being used by folder
sudo du -sch *
# display files older than 30 days
sudo find . -ctime +30 -print0 | xargs -0 -n1
# remove them
sudo find . -ctime +30 -print0 | xargs -0 rm
# remember to clear .SyncArchive files
@mauromorales
mauromorales / .tmux.conf
Last active December 21, 2015 21:29
Mac Setup for Ruby Development
set-option -g default-shell /bin/zsh
set -g mode-mouse on
@mauromorales
mauromorales / bundle-commit.sh
Last active December 21, 2015 21:48
Commit: The Hacker Way to Build a Habit
bundle install
@mauromorales
mauromorales / add-puppetlabs-repo.sh
Created August 28, 2013 19:51
Install Puppet 3 on Ubuntu 12.04
wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
sudo dpkg -i puppetlabs-release-precise.deb
sudo apt-get update