Created
February 4, 2014 02:04
-
-
Save rkmax/8796241 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # | |
| # ~/.bashrc | |
| # | |
| # If not running interactively, don't do anything | |
| [[ $- != *i* ]] && return | |
| alias ls='ls --color=auto' | |
| alias ll='ls -l' | |
| PS1='[\u@\h \W]\$ ' | |
| # Android | |
| export ANDROID_HOME=$HOME/android-sdks | |
| PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools | |
| # Custom funtions | |
| sf2() { | |
| [[ ! -f app/console ]] && { | |
| echo "Debe estar en la raiz del proyecto"; | |
| } || { | |
| app/console --ansi $@ | |
| } | |
| } | |
| tool-cache() | |
| { | |
| local DIRECTORY=$(readlink -f $1) | |
| local GID=$(id -g $UID) | |
| local OPTIONS="rw,size=500M,nosuid,uid=${UID},gid=${GID},mode=0755" | |
| local GITKEEP_FILE="$DIRECTORY/.gitkeep" | |
| mountpoint -q $DIRECTORY && { | |
| echo "El directorio ya esta montado" | |
| return | |
| } | |
| read -p "Esto va a eliminar todo el contenido del directorio '$DIRECTORY' (s/N)? " -n 1 | |
| echo | |
| if [[ $REPLY =~ ^[YySs]$ ]]; then | |
| echo -n "Convirtiendo $DIRECTORY en RAM cache..."; | |
| # El directorio debe estar vacio | |
| sudo rm -rf $DIRECTORY/* | |
| sudo mount -t tmpfs -o $OPTIONS tmpfs $DIRECTORY | |
| mountpoint -q $DIRECTORY && { | |
| permissions.set $DIRECTORY | |
| touch $GITKEEP_FILE | |
| chmod 755 $GITKEEP_FILE | |
| echo "[ OK ]" | |
| } || { | |
| echo "[FAIL]" | |
| } | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment