Please bear with us as we work to restore functionality to dotfiles.org.
bash file config - arquivo de configuração do konsole
#######################################################
# ~/.bashrc: executed by bash(1) for non-login shells.
# Sérgio Luiz Araújo Silva .bashrc file
# Last Change: Sex 08 Jun 2007 17:40:42 BRT
# Download: http://sergioaraujo.pbwiki.com/bashrc
# Licence: Licença: Este arquivo é de domínio público
# Runing on ubuntu-GNU/Linux
# Garantia: O autor não se responsabiliza por eventuais danos
# causados pelo uso deste arquivo.
#######################################################
#
# ( O O )
# ====oOO==(_)==OOo=====
#
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(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)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
;;
*)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
;;
esac
# Comment in the above and uncomment this below for a color prompt
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac
# 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 color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'
fi
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
# personalização do xterm
alias xterm="xterm -ls -bg black -fg white -fa 'bistream vera sans mono' -fs 10 -cr white -hc white -rightbar"
# 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 [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
[ -f /usr/bin/vim ] && { export EDITOR=/usr/bin/vim ;} # Editor default
if [ ! -d "${HOME}/tmp" ]; then
mkdir ${HOME}/tmp
chmod 700 ${HOME}/tmp
fi
# Diretório de executáveis de usuário (recomendado)
if ! [ -d ~/bin ]; then
mkdir -p ~/bin
chmod 700 ${HOME}/bin
fi
# Configurando o path
PATH=$PATH:~/bin
#===============================================================================
# Configurações do comportamento do bash
#===============================================================================
# Checa o tamanho da janela entre cada comando e se necessário,
# atualiza o valor das linhas e colunas.
shopt -s checkwinsize
# Evita histórico com linhas duplicadas
export HISTCONTROL=ignoredups
#===============================================
# Aliases
#===============================================
# resource .bashrc
alias rl="source $HOME/.bashrc"
alias rmf='rm -rf' # Removendo arquivos sem perguntas
#alias rm='rm -i'
alias mkdir='mkdir -p'
alias h='history'
alias hist='history | grep $1' #Requires one input
alias ..='cd ..'
alias path='echo -e ${PATH//:/\\n}'
# The 'ls' family (this assumes you use the GNU ls)
alias ll="ls -l"
alias la='ls -Al' # show hidden files
alias ls='ls -hF --color' # add colors for filetype recognition
alias lx='ls -lXB' # sort by extension
alias lk='ls -lSr' # sort by size
alias lc='ls -lcr' # sort by change time
alias lu='ls -lur' # sort by access time
alias lr='ls -lR' # recursive ls
alias lt='ls -ltr' # sort by date
alias lm='ls -al |more' # pipe through 'more'
alias tree='tree -Csu' # nice alternative to 'ls'
alias df='df -h'
alias du='du -hs'
# tailoring 'less'
alias more='less'
export PAGER=less
# Dica retirada do blog do mitre
# http://jfmitre.blogspot.com/2006/05/convertendo-arquivos-utf-8-em-iso-8859.html
alias iso2utf='iconv -f iso-8859-1 -t utf-8'
alias utf2iso='iconv -f utf-8 -t iso-8859-1'
# rede - veja função netinfo mais abaixo
alias wget="wget --limit-rate=10k"
alias rede='sudo pump' # Ativa a rede (sudo ativado)
alias config-data='sudo ntpdate -u -b ntp.usp.br' # ajusta data pela rede
# alias config-data='sudo ntpdate -u -b ntp1.ptb.de' # mirror auxiliar
# alias config-data='ntpdate -u -b bonehed.lcs.mit.edu' # mirror auxiliar
#-------------------------------------------------------------------------------
# alias para scp: permite efetuar as cópias como se fossem uma simples cópia
#-------------------------------------------------------------------------------
uscprhost(){ scp $1 $RUSER@$RHOST:$2 ;}
dscprhost(){ scp $RUSER@$RHOST:$1 $2 ;}
alias ssh='ssh -C' # Ativando a compactação do SSH
alias tom='ssh 192.168.2.102 -l root'
alias scp='scp -r' # SCP rescursivo
# Função para exibir data e hora
# adicionei cores!
hora (){
clear
echo "$(date +%Hhs%Mm)"
}
myip (){
seuip=$(ifconfig eth0 | awk '/inet end.:/ {print $3}')
clear
echo "$seuip"
}