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
# Shortcut usage: | |
# curl -L http://bit.ly/feijo_tweaks | sh | |
echo Bash Aliases | |
wget https://gist.githubusercontent.com/afeijo/0c8c16c1726a27d4d1f4476c1f7cf53d/raw/118a33d210ec5d1d1ee1edad49679a83154e8343/.bash_aliases | |
echo ps1 colors | |
wget https://gist.github.com/afeijo/8601619/raw/a13d121b0abe2e4d0603612b744238c77b7d59ad/.ps1_color | |
curl -L https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > ~/.bash_git |
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
alias ..='cd ..' | |
alias ...='..;..' | |
alias ....='...;..' | |
alias .....='...;...' | |
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' | |
alias df='df -h' | |
alias du='du -h' | |
alias egrep='egrep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias grep='grep --color=auto' |
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
# this works for debian, ubuntu and similar | |
sudo fallocate -l 2G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo cp /etc/fstab /etc/fstab.bak | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab |
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
if [[ $# -eq 0 ]] ; then | |
echo 'you forgot the new site name' | |
exit 0 | |
fi | |
echo 'Creating site $1' | |
time drush dl --destination=/www --drupal-project-rename=$1 | |
cd $1 | |
mysql -e 'create database $1' | |
time drush si --account-name=admin --account-pass=102030 [email protected] --site-name="$1" --db-url=mysqli://root:1234@localhost/$1 -y |
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
# download me or copy & paste into your root folder, name it .ps1_color | |
# add the line below into your ~/.profile or ~/.bashrc | |
# source ~/.ps1_color | |
# ANSI color codes | |
RS="\[\033[0m\]" # reset | |
HC="\[\033[0;1m\]" # hicolor | |
UL="\[\033[4m\]" # underline | |
INV="\[\033[7m\]" # inverse background and foreground | |
FBLK="\[\033[30m\]" # foreground black |
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
set expandtab | |
set tabstop=2 | |
set shiftwidth=2 | |
set autoindent | |
set smartindent | |
if has("autocmd") | |
" Drupal *.module and *.install files. | |
augroup module | |
autocmd BufRead,BufNewFile *.module set filetype=php |
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 | |
# usage: download the script, place it in the modules folder, and execute with your new module name as the parameter. | |
# bash new_module.sh CustomModule | |
mkdir $1 | |
cd $1 | |
## .info file | |
echo "name = $1" > $1.info |
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 | |
# crontab example: | |
# 2 */12 * * * /bin/sh /home/user/scripts/sites.sh | |
# Local directory for dump files | |
LOCALDIR=$HOME/backups/sites | |
# | |
##################################### | |
### Edit Below If Necessary ######### | |
##################################### |
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 | |
########################################################################## | |
# | |
# mysql_backups.sh: A shell script to back up all MySQL databases in | |
# one shot, nightly, and keep a rolling 3 weeks of | |
# backups hot, online in the backup archive. | |
# | |
# Written by David A. Desrosiers | |
# Contact [email protected] | |
# Last updated Jun 27 2012 by Alessandro Feijó @afeijo |
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
startup_message off | |
vbell off | |
autodetach on | |
#escape / | |
defscrollback 5000 | |
#caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= %c" | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}%{C}Screen: %{c}%{= kG}[%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{C} %d-%m %{W}%c %{g}]' |
NewerOlder