This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Mac Bootstrap Script | |
# (C) 2011 - @codatory | |
# | |
# "It might work for you, too." | |
pretty_echo(){ | |
echo '--------------------------------' | |
echo " $*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration Constants (move to yaml ?) | |
HOST = 'ad01.domain.local' | |
PORT = 636 | |
USER = 'administrator' | |
PASS = 'password' | |
BASE = 'dc=domain, dc=local' | |
DOMAIN = 'domain.local' | |
SCOPE = '(&(objectCategory=person)(objectClass=user))' | |
require 'rubygems' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExifData | |
require 'celluloid' | |
def initialize(file) | |
raise 'Expects Upload!' unless file.is_a?(Upload) | |
@upload = file | |
end | |
def process! | |
# this is fictitional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CURRENT=`pwd` | |
mkdir /tmp/repo_archive | |
cd /tmp/repo_archive | |
git clone --quiet --bare "$CURRENT" repository | |
tar -c repository | pigz --best > "$CURRENT/archive.tar.gz" | |
cd $CURRENT | |
rm -rf /tmp/repo_archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; emacs configuration | |
(push "/usr/local/bin" exec-path) | |
(setq make-backup-files nil) | |
(setq auto-save-default nil) | |
(setq-default tab-width 2) | |
(setq-default indent-tabs-mode nil) | |
(setq inhibit-startup-message t) | |
(setq tramp-default-method "scpx") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# c = CSVBuilder.new ['column 1 name', 'column 2 name', 'column 3 name'] | |
# rowdata.each do |r| | |
# special_column = r.boolean ? 'YES' : 'NO' | |
# c.add_row [special_column, r.name, r.date] | |
# end | |
# c.export('optional_filename.csv') | |
class CSVBuilder | |
def initialize(head) | |
if head.is_a?(Array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
UPDATES=`yum check-update -q | awk '{print $1}'` | |
COUNT=`printf "%s\n" "$UPDATES" | grep -v "^$" | wc -l` | |
YUM=`printf "%s\n" "$UPDATES" | grep -v "^$" | grep yum` | |
echo '--------------------------------------------------------------------------------' | |
echo " Weekly Update Notification for `hostname`" | |
echo " -> $COUNT update(s) available" | |
if [ -n "$YUM" ]; then | |
echo ' -> IMPORTANT: A Yum update is available. Perform this separately and first.' | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get update -qq | |
UPDATES=`apt-get dist-upgrade --simulate | grep Inst | awk '{print $2}'` | |
COUNT=`printf "%s\n" "$UPDATES" | grep -v "^$" | wc -l` | |
echo '--------------------------------------------------------------------------------' | |
echo " Weekly Update Notification for `hostname`" | |
echo " -> $COUNT update(s) available" | |
echo '--------------------------------------------------------------------------------' | |
printf "%s\n" "$UPDATES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
YUM=`which yum 2> /dev/null` | |
APT=`which apt-get 2> /dev/null` | |
YUM_GIST=1926743 | |
APT_GIST=1926909 | |
if [ $YUM ]; then | |
bash < <(curl --location --silent https://raw.github.com/gist/$YUM_GIST) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch me back to ^A, thanks | |
set-option -g prefix C-a | |
unbind-key C-b | |
bind-key a send-prefix | |
# I miss ^A^A and ^ASpace | |
bind-key C-a last-window | |
bind-key Space next-window | |
bind-key C-Space previous-window |