Permalink
Browse files

backup & stuff

  • Loading branch information...
1 parent 60858a8 commit b4d8f8c4f9063a517e087a2c6bae418cee1a9186 @vytautasgimbutas committed May 7, 2012
Showing with 29 additions and 4 deletions.
  1. +17 −0 .custom
  2. +8 −4 bin/backup
  3. +4 −0 osx
View
@@ -65,3 +65,20 @@ alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && k
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
+
+# VirtualEnv cd
+workon_virtualenv() {
+ if [ -e .git ]; then
+ current_dir="${PWD##*/}"
+ if [ -e ~/virtualenvs/$current_dir ]; then
+ deactivate >/dev/null 2>&1
+ source ~/virtualenvs/$current_dir/bin/activate
+ fi
+ fi
+}
+
+virtualenv_cd() {
+ cd "$@" && workon_virtualenv
+}
+
+alias cd="virtualenv_cd"
View
@@ -1,6 +1,10 @@
#!/bin/sh
-DATE=$(date +"%m-%d-%y")
+DATE=$(date +"%y-%m-%d")
-tar -czPf /Users/vytautasgimbutas/projects.tar /Users/vytautasgimbutas/Projects
-rsync -az /Users/vytautasgimbutas/projects.tar /Users/vytautasgimbutas/Dropbox/backup/$DATE/
-rm /Users/vytautasgimbutas/projects.tar
+# Backup projects directory
+tar -czPf $HOME/projects.tar $HOME/Projects
+rsync -az $HOME/projects.tar $HOME/Dropbox/backup/$DATE/
+rm $HOME/projects.tar
+
+# Delete old ones (after 30 days)
+find $HOME/Dropbox/backup/* -type d -mtime +30 -exec rm -rf {} \;
View
@@ -184,4 +184,8 @@ file=/Applications/Dropbox.app/Contents/Resources/check.icns
[ -e "$file" ] && mv -f "$file" "$file.bak"
unset file
+# Interesting stuff
+sudo nvram boot-args="-v"
+
# You still need to restart
+

0 comments on commit b4d8f8c

Please sign in to comment.