projects:raspberrypi:sshrc
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung | |||
| projects:raspberrypi:sshrc [2014/02/03 14:20] – benh | projects:raspberrypi:sshrc [2014/02/03 14:28] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== | + | ====== |
| - | //.bashrc// | + | /// |
| <code bash> | <code bash> | ||
| - | # ~/.bashrc: executed by bash(1) for non-login shells. | + | #!/bin/sh |
| - | # Note: PS1 and umask are already set in / | + | ################################## |
| - | # need this unless you want different defaults for root. | + | ## Author: Ben Hartmann |
| - | # PS1=' | + | ## Date: 2010-03-13 |
| - | # umask 022 | + | ## Version: 0.1 ## |
| + | ################################## | ||
| - | # don't put duplicate lines in the history. See bash(1) for more options | + | ## VARIABLES |
| - | # ... or force ignoredups and ignorespace | + | TEMPFILE="/ |
| - | HISTCONTROL=ignoredups: | + | |
| - | # append to the history file, don't overwrite it | + | FQDN=" |
| - | shopt -s histappend | + | DATE=" |
| + | DATE1=" | ||
| - | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | + | USER=" |
| - | HISTSIZE=10000 | + | #DOMAINNAME=" |
| - | HISTFILESIZE=20000 | + | #IPADDRESS=" |
| + | USERINFO=" | ||
| - | # check the window size after each command and, if necessary, | + | MAIL_RECPT=" |
| - | # update the values | + | MAIL_SUBJECT=" |
| - | shopt -s checkwinsize | + | |
| - | # make less more friendly for non-text input files, see lesspipe(1) | + | ## SCRIPT |
| - | [ -x / | + | |
| - | # set variable identifying the chroot you work in (used in the prompt below) | + | echo " |
| - | if [ -z "$debian_chroot" | + | echo "The user <$USER> has logged in at $DATE." |
| - | | + | #echo "The Domainname is: $DOMAINNAME" |
| - | fi | + | echo -e " |
| - | # set a fancy prompt (non-color, unless we know we " | + | cat $TEMPFILE | mail -s"$MAIL_SUBJECT" |
| - | case "$TERM" | + | |
| - | xterm-color) color_prompt=yes;; | + | |
| - | esac | + | |
| - | # uncomment | + | # for X11 forwarding |
| - | # 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 | + | if read proto cookie && |
| - | force_color_prompt=yes | + | if [ `echo $DISPLAY | cut -c1-10` = ' |
| - | + | # X11UseLocalhost=yes | |
| - | if [ -n "$force_color_prompt" ]; then | + | echo add unix:`echo $DISPLAY | |
| - | if [ -x / | + | cut -c11-` $proto $cookie |
| - | # We have color support; assume it's compliant with Ecma-48 | + | |
| - | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such | + | # X11UseLocalhost=no |
| - | | + | echo add $DISPLAY $proto $cookie |
| - | | + | fi | xauth -q - |
| - | else | + | |
| - | | + | |
| - | | + | |
| fi | fi | ||
| + | ###################################################################### | ||
| - | if [ " | + | exit 0 |
| - | if [[ $EUID -eq 0 ]]; then | + | |
| - | PS1=' | + | |
| - | else | + | |
| - | PS1=' | + | |
| - | fi | + | |
| - | else | + | |
| - | PS1=' | + | |
| - | fi | + | |
| - | unset color_prompt force_color_prompt | + | |
| - | + | ||
| - | # If this is an xterm set the title to user@host: | + | |
| - | case " | + | |
| - | xterm*|rxvt*) | + | |
| - | PS1=" | + | |
| - | ;; | + | |
| - | *) | + | |
| - | ;; | + | |
| - | esac | + | |
| - | + | ||
| - | # enable color support of ls and also add handy aliases | + | |
| - | if [ -x / | + | |
| - | test -r ~/ | + | |
| - | alias ls='ls --color=auto' | + | |
| - | #alias dir=' | + | |
| - | #alias vdir=' | + | |
| - | + | ||
| - | alias grep=' | + | |
| - | alias fgrep=' | + | |
| - | alias egrep=' | + | |
| - | fi | + | |
| - | + | ||
| - | # some more ls aliases | + | |
| - | alias ll='ls -alF' | + | |
| - | alias la='ls -A' | + | |
| - | alias l='ls -CF' | + | |
| - | + | ||
| - | alias vi='vi +"set nu"' | + | |
| - | alias vim=' | + | |
| - | alias vin='/ | + | |
| - | alias vless='/ | + | |
| - | + | ||
| - | # Some more alias to avoid making mistakes: | + | |
| - | alias rm='rm --interactive' | + | |
| - | alias mv='mv --interactive' | + | |
| - | alias cp='cp --interactive' | + | |
| - | + | ||
| - | alias clock=' | + | |
| - | + | ||
| - | #git aliases | + | |
| - | alias gs=' | + | |
| - | alias ga=' | + | |
| - | alias gb=' | + | |
| - | alias gc=' | + | |
| - | alias gd=' | + | |
| - | alias go=' | + | |
| - | alias gk=' | + | |
| - | alias gx=' | + | |
| - | + | ||
| - | alias got=' | + | |
| - | alias get=' | + | |
| - | + | ||
| - | #password generator | + | |
| - | passgen() | + | |
| - | { | + | |
| - | if [ " | + | |
| - | echo " | + | |
| - | elif [ " | + | |
| - | echo "too many parameters..." | + | |
| - | else | + | |
| - | cat / | + | |
| - | fi | + | |
| - | } | + | |
| - | + | ||
| - | # dictionary | + | |
| - | function leo() { | + | |
| - | w3m -dump " | + | |
| - | } | + | |
| - | + | ||
| - | # Add an " | + | |
| - | # sleep 10; alert | + | |
| - | alias alert=' | + | |
| - | + | ||
| - | #add to history | + | |
| - | PROMPT_COMMAND=" | + | |
| </ | </ | ||
projects/raspberrypi/sshrc.1391433639.txt.gz · Zuletzt geändert: von benh
