Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosronaldo committed Dec 2, 2015
0 parents commit 2228c58
Show file tree
Hide file tree
Showing 8 changed files with 381 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.swp
.vim/
172 changes: 172 additions & 0 deletions config/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi

parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[\033[0;31m\]$(parse_git_branch)\[\033[0;33m\]\$\[\033[00m\] '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\[\033[0;31m\]$(parse_git_branch)\[\033[0;33m\]\$\[\033[00m\] '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias la='ls -la'
alias ~='cd ~'
alias cd..='cd ..'
alias ..='cd ..'
alias .2='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd ../../../../..'
alias path='echo -e ${PATH//:/\\n}'
alias sudoe='sudo -E'
alias svi='sudoe vim'
alias edit='vim'
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
alias rm='rm -i'

alias histg="history | grep"

alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'

alias update='sudo apt-get update'

fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi

function extract {
if [ -z "$1" ]; then
# display usage if no parameters given
echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
else
if [ -f $1 ] ; then
# NAME=${1%.*}
# mkdir $NAME && cd $NAME
case $1 in
*.tar.bz2) tar xvjf ../$1 ;;
*.tar.gz) tar xvzf ../$1 ;;
*.tar.xz) tar xvJf ../$1 ;;
*.lzma) unlzma ../$1 ;;
*.bz2) bunzip2 ../$1 ;;
*.rar) unrar x -ad ../$1 ;;
*.gz) gunzip ../$1 ;;
*.tar) tar xvf ../$1 ;;
*.tbz2) tar xvjf ../$1 ;;
*.tgz) tar xvzf ../$1 ;;
*.zip) unzip ../$1 ;;
*.Z) uncompress ../$1 ;;
*.7z) 7z x ../$1 ;;
*.xz) unxz ../$1 ;;
*.exe) cabextract ../$1 ;;
*) echo "extract: '$1' - unknown archive method" ;;
esac
else
echo "$1 - file does not exist"
fi
fi
}

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
source $HOME/.rvm/scripts/rvm

19 changes: 19 additions & 0 deletions config/.gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[user]
name = Marcos Ronaldo
email = [email protected]
[alias]
le = log --oneline --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
co = checkout
ec = config --global -e
up = !git pull --rebase --prune
cob = checkout -b
cm = !git add -A && git commit
save = !git add -A && git commit -m 'SAVEPOINT'
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
#bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
#bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
1 change: 1 addition & 0 deletions config/.tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set-option -g prefix C-a
117 changes: 117 additions & 0 deletions config/.vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
" put this line first in ~/.vimrc
set nocompatible | filetype indent plugin on | syn on

fun! SetupVAM()
let c = get(g:, 'vim_addon_manager', {})
let g:vim_addon_manager = c
let c.plugin_root_dir = expand('$HOME', 1) . '/.vim/vim-addons'

" Force your ~/.vim/after directory to be last in &rtp always:
" let g:vim_addon_manager.rtp_list_hook = 'vam#ForceUsersAfterDirectoriesToBeLast'

" most used options you may want to use:
" let c.log_to_buf = 1
" let c.auto_install = 0
let &rtp.=(empty(&rtp)?'':',').c.plugin_root_dir.'/vim-addon-manager'
if !isdirectory(c.plugin_root_dir.'/vim-addon-manager/autoload')
execute '!git clone --depth=1 https://github.com/MarcWeber/vim-addon-manager '
\ shellescape(c.plugin_root_dir.'/vim-addon-manager', 1)
endif

" This provides the VAMActivate command, you could be passing plugin names, too
call vam#ActivateAddons(["ctrlp", "The_NERD_tree", "Syntastic"], {})
endfun
call SetupVAM()

set nu
set paste
set tabstop=2
set expandtab
set softtabstop=2
set shiftwidth=2
set autoindent
set cindent

set ignorecase

set noswapfile
set nobackup
set nowritebackup

autocmd BufWritePre * :%s/\s\+$//e

" NERDTree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
map <C-n> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
let g:NERDTreeIgnore = ['\.pyc$']

" CtrlP config
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'ra'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc " MacOSX/Linux
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'


set shellcmdflag=-ic

set laststatus=2

set hlsearch

function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction

nnoremap <silent> <F5> :call <SID>StripTrailingWhitespaces()<CR>
autocmd BufWritePre *.py,*.js :call <SID>StripTrailingWhitespaces()

let g:tex_flavor = "latex"

let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall
let g:user_emmet_mode='a' "enable all function in all mode.

autocmd QuickFixCmdPost *grep* cwindow

" The following items are available options, but do not need to be
" included in your .vimrc as they are currently set to their defaults.
set backspace=indent,eol,start
set encoding=UTF-8

set laststatus=2
set linespace=0
"let g:airline_theme = 'badwolf'
let g:airline_theme = 'wombat'
let g:airline_powerline_fonts = 1
let g:airline#extensions#hunks#enabled = 0
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#tabline#enabled = 1

let g:gitgutter_override_sign_column_highlight = 0
set modelines=1

" Make tab in v mode work like I think it should (keep highlighting):
vmap <tab> >gv
vmap <s-tab> <gv
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

let g:syntastic_python_checkers = ['python', 'flake8']
17 changes: 17 additions & 0 deletions config/setup_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
GIT_DIR=`pwd`

echo "Link .vimrc, .tmux.conf and .gitconfig from $GIT_DIR to ~/"
echo "Copy .bashrc from $GIT_DIR to ~/"

cp .bashrc ~
source ~/.bashrc

cd ~/
rm -rf .vimrc
rm -rf .tmux.conf
rm -rf .gitconfig

ln -s $GIT_DIR/.vimrc
ln -s $GIT_DIR/.tmux.conf
ln -s $GIT_DIR/.gitconfig

31 changes: 31 additions & 0 deletions noosfero_environment/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.define "wheezy" do |wheezy|
wheezy.vm.hostname = "wheezy"
wheezy.vm.box = "wheezy"
wheezy.vm.network :forwarded_port, host: 3000, guest: 3000

wheezy.vm.provision :shell do |shell|
shell.inline = 'su vagrant -c /vagrant/start'
shell.inline = 'echo So begins a new age of knowledge'
end

end
end

config.vm.define "jessie" do |jessie|
jessie.vm.hostname = "jessie"
jessie.vm.box = ENV.fetch('VAGRANT_BOX', "debian/jessie64")
jessie.vm.network :forwarded_port, host: 4000, guest: 4000

jessie.vm.provision :shell do |shell|
shell.inline = 'su vagrant -c /vagrant/start'
shell.inline = 'echo So begins a new age of knowledge'
end
end

end
22 changes: 22 additions & 0 deletions noosfero_environment/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

set -e
sudo apt-get install netcat-traditional

# apt-cacher-ng running on the host
# 10.0.2.2 = host ip on virtualbox/qemu
# 192.168..122.1 = host ip on default libvirt bridge
for ip in 10.0.2.2 192.168.122.1; do
if nc -z -w 1 $ip 3142; then
echo "Acquire::http::Proxy \"http://$ip:3142\";" | sudo tee /etc/apt/apt.conf.d/01proxy
fi
done

sudo DEBIAN_FRONTEND=noninteractive apt-get install -qy postfix
sudo postconf virtual_alias_maps=hash:/etc/postfix/virtual
sudo tee /etc/postfix/virtual <<EOF
@localhost.localdomain vagrant
EOF
sudo postmap /etc/postfix/virtual
sudo service postfix reload

0 comments on commit 2228c58

Please sign in to comment.