Skip to content
Browse files

Add some bin scripts, remove some scripts, update some scripts.

  • Loading branch information...
1 parent fc3a3c4 commit a95a5631ab33d2414db81759169edd29d59d3080 @ggamel committed
Showing with 82 additions and 196 deletions.
  1. +39 −0 bin/backup
  2. +0 −111 bin/chromium_updater
  3. +0 −62 bin/cloudapp
  4. +15 −0 bin/dot
  5. +3 −4 bin/e
  6. +25 −19 bin/getlyrics
View
39 bin/backup
@@ -0,0 +1,39 @@
+#!/bin/sh
+IFS=$'\n'
+
+# Copies a few key files to a mounted partition.
+#
+# I use Time Machine for backups, but I also wanted to build out an
+# offsite backup with my critical nonreplaceable data (photos, documents,
+# etc). Since it's mobile, encryption is a plus (which Time Machine
+# doesn't easily do). I create an encrypted sparsebundle on a tiny USB
+# drive and do it to it.
+
+
+# Your sparsebundle. I named mine "fuckplanets" because really, fuck planets.
+sparsebundle="/Volumes/fuckplanets/backup.sparsebundle"
+
+# Your destination. My sparsebundle mounts to "backup".
+backup_location="/Volumes/backup"
+
+# Directories to backup. Recursive, implied home (~) location.
+directories=(
+ Code
+ Documents
+ "Library/Application Support/Adium 2.0"
+ Movies
+ Music
+ Pictures
+)
+
+
+
+hdiutil attach -noverify $sparsebundle
+
+for directory in ${directories[@]}
+ do
+ rsync -avh --progress --delete ~/$directory $backup_location
+done
+
+hdiutil detach $backup_location
+diskutil eject fuckplanets
View
111 bin/chromium_updater
@@ -1,111 +0,0 @@
-#!/bin/bash
-
-if [[ "$1" == "-h" || "$1" == "--help" ]]; then cat <<HELP
-Chromium Updater
-http://benalman.com/
-
-Usage: $(basename "$0") [revision]
-
-Download and install the latest Chromium and dev tools, modifying the binary
-to use those custom dev tools (downloaded into ~/.dotfiles/caches/chromium).
-See ~.dotfiles/conf/update_chromium_etc.sh for sample dev tools customization.
-
-If a revision isn't specified, the latest stable revision will be installed.
-
-Copyright (c) 2011 "Cowboy" Ben Alman
-Licensed under the MIT license.
-http://benalman.com/about/license/
-HELP
-exit; fi
-
-if [[ "$OSTYPE" =~ ^darwin ]]; then
- os="Mac"
- app_file="chrome-mac.zip"
- app_path="/Applications"
-else
- echo "Linux unsupported (for now)."
- exit 1
-fi
-
-url_base="http://commondatastorage.googleapis.com/chromium-browser-continuous/$os"
-dev_file="devtools_frontend.zip"
-
-dev_path=~/.dotfiles/caches/chromium
-current_revision=$(cat "$dev_path/REVISION" 2>/dev/null)
-
-revision=$1
-
-if [[ ! "$revision" ]]; then
- echo -n "Checking latest Chromium version..."
- revision=$(curl -s "$url_base/LAST_CHANGE")
- if [[ "$revision" =~ ^[0-9]+$ ]]; then
- echo "OK"
- else
- echo "ERROR"
- echo "Error loading revision data from $url_base/LAST_CHANGE, aborting update."
- exit 1
- fi
-fi
-
-echo "Attempting to update Chromium to revision $revision."
-
-if [[ "$revision" == "$current_revision" ]]; then
- if [[ "$1" ]]; then
- echo "Revision $revision is already installed!"
- else
- echo "Already up-to-date!"
- fi
- exit
-fi
-
-echo
-
-tmp="$(mktemp -d /tmp/chromiumer.XXXXX)"
-for f in "$app_file" "$dev_file"; do
- echo "Downloading $f."
- curl -fLo "$tmp/$f" --progress-bar "$url_base/$revision/$f"
- if [[ ! -f "$tmp/$f" ]]; then
- echo "Error downloading $f, aborting update."
- rm -rf "$tmp"
- exit 1
- fi
-done
-
-echo -en "\nDeleting existing files..."
-rm -rf "$app_path/Chromium.app" "$dev_path"
-echo "OK"
-
-echo -n "Creating new files..."
-mkdir -p "$dev_path"
-devtools_path="$dev_path/devtools"
-echo "$revision" > "$dev_path/REVISION"
-unzip -qo "$tmp/$dev_file" -d "$devtools_path"
-unzip -qo "$tmp/$app_file" -d "$tmp"
-echo "OK"
-
-mv "$tmp/${app_file%.zip}/Chromium.app" "$app_path/"
-
-echo -n "Modifying Chromium bin file to use --debug-devtools-frontend..."
-bin_path="$app_path/Chromium.app/Contents/MacOS"
-bin_file="$bin_path/Chromium"
-mv "$bin_file" "$bin_path/Chromium-bin"
-
-cat > "$bin_file" <<'BASH'
-#!/bin/bash
-devtools=~/.dotfiles/caches/chromium/devtools
-"$0-bin" --debug-devtools-frontend="$devtools"
-BASH
-chmod +x "$bin_file"
-echo "OK"
-
-echo -n "Cleaning up..."
-rm -rf "$tmp"
-echo "OK"
-
-additional=~/.dotfiles/conf/update_chromium_etc.sh
-if [[ -f "$additional" ]]; then
- echo -e "\nRunning update_chromium_etc.sh..."
- source "$additional"
-fi
-
-echo -e "\nAll done!"
View
62 bin/cloudapp
@@ -1,62 +0,0 @@
-#!/usr/bin/env ruby
-#
-# cloudapp
-# Zach Holman / @holman
-#
-# Uploads a file from the command line to CloudApp, drops it into your
-# clipboard (on a Mac, at least).
-#
-# Example:
-#
-# cloudapp drunk-blake.png
-#
-# This requires Aaron Russell's cloudapp_api gem:
-#
-# gem install cloudapp_api
-#
-# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of:
-#
-# email
-# password
-
-require 'rubygems'
-
-['json', 'cloudapp_api'].each do |gem|
- begin
- require gem
- rescue LoadError
- puts "You need to install #{gem}: gem install #{gem}"
- exit!(1)
- end
-end
-
-config_file = "#{ENV['HOME']}/.cloudapp"
-unless File.exist?(config_file)
- puts "You need to type your email and password (one per line) into "+
- "`~/.cloudapp`"
- exit!(1)
-end
-
-email,password = File.read(config_file).split("\n")
-
-if ARGV[0].nil?
- puts "You need to specify a file to upload."
- exit!(1)
-end
-
-urls = []
-ARGV.each do |x|
- CloudApp.authenticate(email,password)
- puts "==> Attempting to upload #{x}"
- url = CloudApp::Item.create(:upload, {:file => x}).url
-
- # Say it for good measure.
- puts "==> Uploaded #{x} to #{url}"
-
- # Get the embed link.
- url = "#{url}/#{ARGV[0].split('/').last}"
- urls << url
-end
-
-# Copy it to your (Mac's) clipboard.
-`echo '#{urls.join(',')}' | tr -d "\n" | pbcopy`
View
15 bin/dot
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# dot
+#
+# `dot` handles installation, updates, things like that. Run it periodically
+# to make sure you're on the latest and greatest.
+
+# Set OS X defaults
+$ZSH/osx/set-defaults.sh
+
+# Upgrade homebrew
+brew update
+
+# Install homebrew packages
+$ZSH/homebrew/install.sh 2>&1
View
7 bin/e
@@ -14,9 +14,8 @@
# $ e /usr/local
# # => opens the specified directory in your editor
-if test "$1" == ""
-then
- $($EDITOR .)
+if [ "$1" == "" ] ; then
+ exec $EDITOR .
else
- $($EDITOR $1)
+ exec $EDITOR "$1"
fi
View
44 bin/getlyrics
@@ -53,24 +53,30 @@ cache_dir=~/.dotfiles/caches/getlyrics
[[ -e "$cache_dir" ]] || mkdir -p "$cache_dir"
# Let's intro with some ASCII, because why the hell not?
-gltitle="
-#############################################################################
-# * * #
-# * ____ _ _ * _ * #
-# / ____| | | | | (_) * #
-# | | __ ___| |_| | _ _ _ __ _ ___ ___ * #
-# | | |_ |/ _ | __| | | | | | '__| |/ __/ __| #
-# | |__| | __| |_| |___| |_| | | | | (__\__ \ * * #
-# \_____|\___|\__|______\__, |_| |_|\___|___/ #
-# * __/ | * * #
-# * * |___/ * #
-# * * #
-#############################################################################
-"
-echo "$gltitle"
-linebreak="
-#############################################################################
-"
+getlyrics_art () {
+ echo "buttes"
+}
+getlyrics_art
+
+
+# gltitle="
+# #############################################################################
+# # * * #
+# # * ____ _ _ * _ * #
+# # / ____| | | | | (_) * #
+# # | | __ ___| |_| | _ _ _ __ _ ___ ___ * #
+# # | | |_ |/ _ | __| | | | | | '__| |/ __/ __| #
+# # | |__| | __| |_| |___| |_| | | | | (__\__ \ * * #
+# # \_____|\___|\__|______\__, |_| |_|\___|___/ #
+# # * __/ | * * #
+# # * * |___/ * #
+# # * * #
+# #############################################################################
+# "
+# echo "$gltitle"
+# linebreak="
+# #############################################################################
+# "
# Player states
# - iTunes states = 'stopped', 'playing'
@@ -117,7 +123,7 @@ for player in "${players[@]}"; do
# OPTIONAL: Send lyrics to CloudApp and copy url to clipboard
# Comment out to not use. Uncomment to use.
- cloudapp "$file" && echo "$linebreak"
+ cloudapp upload "$file" && echo "$linebreak"
# Let's pause for a moment
sleep 1

0 comments on commit a95a563

Please sign in to comment.
Something went wrong with that request. Please try again.