Nxl67002 - AndLinux - Files

From miki
Revision as of 22:26, 19 October 2009 by Mip (talk | contribs) (→‎~/.vimrc: rawfile - removed filelink / fileanchor)
Jump to navigation Jump to search

Windows Host files

settings.txt

Download [{{#file: settings.txt}} this file].

mem=384
root=/dev/cobd0
kernel=vmlinux
cobd0=Drives\base.vdi
cobd1=Drives\swap.vdi
cobd2=Drives\data.reiserfs.10G.dvi
cofs31=.
eth0=slirp
eth1=tuntap,"TAP-Colinux",00:11:22:33:44:55
cofs0=C:\
cofs1=D:\

AndLinux files

/etc/fstab

Download [{{#file: fstab}} this file].

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>      <options>       <dump>  <pass>
proc            /proc           proc        defaults        0       0
/dev/cobd0      /               ext3        defaults        1       1
/dev/cobd1      none            swap        sw              0       0
/dev/cobd2      /mnt/data       reiserfs    noatime,notail  0       0
31              /mnt/and        cofs        defaults        0       0
0               /mnt/winc       cofs        defaults,gid=samba,dmask=0775,fmask=0775        0       0
1               /mnt/wind       cofs        defaults,gid=samba,dmask=0775,fmask=0775        0       0

/usr/local/bin/be

Download [{{#file: be}} this file].
Note that this script would ideally require to add the following line to /etc/sudoers:

ALL ALL=(ALL) NOPASSWD: /bin/loadkeys
#!/bin/bash

sudo loadkeys /usr/share/keymaps/i386/azerty/be2-latin1.kmap.gz

~/.bashrc

Download [{{#file: .bashrc}} this file]. Everything before #### CUSTOMIZATION is the original file.

# ~/.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
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
export 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)

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

# 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

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
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

# 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 [ -x /usr/bin/dircolors ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

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

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

# 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


################################################################################
##### CUSTOMIZATION ############################################################
################################################################################

#### ALIASES & FUNCTIONS
########################

# Read colors from .dircolors.cfg
if [ -x /usr/bin/dircolors -a -a ~/.dircolors.cfg ]; then
	eval `dircolors -b ~/.dircolors.cfg`
	alias ls='ls -F --color=auto --group-directories-first'
else
	alias ls='ls -F --group-directories-first'
fi

alias df='df -h'
alias du='du -h'
alias grep='grep --color'						# show differences in colour
alias egrep='egrep --color'						# show differences in colour
alias fgrep='fgrep --color'						# show differences in colour
alias l='ls -l'									# long list
alias la='ls -A'								# all but . and ..
alias ll='ls -Al'
alias lla="ls -al"
alias ls-l='ls -l'
alias dua="du -sh * .*"
alias dfh="df -h"
alias dir='ls --format=vertical'
alias vdir='ls --format=long'
function sorttag()
{
  TAGS="$*"
  echo $TAGS | sed "s/ /\n/g" | sort | (for i in `cat`; do MYVAR="$MYVAR $i"; done; echo $MYVAR) >/dev/clipboard
  cat /dev/clipboard
}
alias st=sorttag

#### SSH
########################

alias ssha="ssh andlinux"
alias sshn="ssh -t noekeon 'bash --rcfile ~/private/mip.bashrc'"
alias sshg="ssh gryphon"
alias sshnd="ssh -t noekeondirect 'bash --rcfile ~/private/mip.bashrc'"
alias sftpn="sftp daemenj@ftp.noekeon.org"
#alias sshag="ssh-agent bash --rcfile ~/.basshrc"	#Activate a ssh-agent shell

# function scpg - Copy file from/to gryphon
# USAGE: scpg src-local-file-path    @/dest-remote-file-path
#        scpg @/src-remote-file-path  dest-local-file-path
function scpg() {
 SRC=`echo $1|sed 's!@!gryphon:/home/baddreams!'`;
 DST=`echo $2|sed 's!@!gryphon:/home/baddreams!'`;
 scp "$SRC" "$DST";
}

# function scpa - Copy file from/to andlinux
# USAGE: scpa src-local-file-path    @/dest-remote-file-path
#        scpa @/src-remote-file-path  dest-local-file-path
function scpa() {
 SRC=`echo $1|sed 's!@!andlinux:/home/beq06659!'`;
 DST=`echo $2|sed 's!@!andlinux:/home/beq06659!'`;
 scp "$SRC" "$DST";
}

# function scpn - Copy file from/to remote noekeon.org priorweb
# USAGE: scpn src-local-file-path    @/dest-remote-file-path
#        scpn @/src-remote-file-path  dest-local-file-path
function scpn() {
 SRC=`echo $1|sed 's!@!daemenj@noekeon:/opt/www/daemenj/web/private!'`;
 DST=`echo $2|sed 's!@!daemenj@noekeon:/opt/www/daemenj/web/private!'`;
 scp "$SRC" "$DST";
}

# function scpnup - Copy file from/to remote Miki Wiki's upload directory
# USAGE: scpn src-local-file-path    @/dest-remote-file-path
#        scpn @/src-remote-file-path  dest-local-file-path
function scpnup() {
 SRC=`echo $1|sed 's!@!daemenj@noekeon:/opt/www/daemenj/web/kiwi.noekeon.org/miki/upload!'`;
 DST=`echo $2|sed 's!@!daemenj@noekeon:/opt/www/daemenj/web/kiwi.noekeon.org/miki/upload!'`;
 scp "$SRC" "$DST";
}

#### NETWORK
########################

# NXP network settings
#proxy is a synonym but less portable because likely only valid in NXP Leuven
#alias nxp="export http_proxy=http://proxy:8080/; export ftp_proxy=http://proxy:8080/"
alias nxp="cp ~/.ssh/config-nxp ~/.ssh/config; export http_proxy=http://emea.nics.nxp.com:8080/; export ftp_proxy=\$http_proxy"

# HOME network settings
alias home="cp ~/.ssh/config-home ~/.ssh/config"

# TUNNEL network settings
alias tunnel="cp ~/.ssh/config-tunnel ~/.ssh/config"

#### CUSTOMIZATION
########################
# Set a default prompt of: user@host and current_directory
PS1='\[\e]0;\w\a\]\n\[\e[01m\e[34m\]\u@\h \[\e[0m\e[33m\]\w\[\e[0m\]\n\$ '
export PS1

~/.ssh/config-home

Download [{{#file: config-nxp}} this file].

# ~/.ssh/config-home

Host ftp.noekeon.org noekeon
	User		daemenj
	HostName	ftp.noekeon.org

Host noekeonsshtunnel
        User            daemenj
        HostName        ftp.noekeon.org
        ProxyCommand    /usr/local/bin/ssh-tunnel.pl -q -f - - %h %p

Host gryphon gryphon
	User		baddreams
	HostName	gryphon

Host *
	ServerAliveInterval	15

~/.ssh/config-nxp

Download [{{#file: config-nxp}} this file].

# ~/.ssh/config-nxp

Host ftp.noekeon.org noekeon
	User		daemenj
	HostName	ftp.noekeon.org
#TEST-To prevent disconnect if network down...
	TCPKeepAlive	no			
#	ProxyCommand	/usr/local/bin/ssh-tunnel.pl -f - - %h %p
	Proxycommand /bin/bash -c 'exec 3<>/dev/tcp/emea.nics.nxp.com/8080;echo -n -e "CONNECT %h:%p HTTP/1.0\r\n\r\n" >&3; read -n 39 <&3; echo -n -e "SSH-2.0-OpenSSH_5.1\r\n" >&3; head -c 50 <&3; read -n 21; exec /usr/local/bin/multitee 0:3 3:1'
######  EXPERIMENTS:
#	Proxycommand /bin/bash -c 'exec 3<>/dev/tcp/emea.nics.nxp.com/8080;echo -n -e "CONNECT %h:%p HTTP/1.0\r\n\r\n" >&3; read -n 39 <&3; cat ~/.ssh/clbanner.txt >&3; head -c 50 <&3; read -n $(stat -c %%s ~/.ssh/clbanner.txt); exec /usr/local/bin/socat - FD:3'

Host noekeonsshtunnel
        User            daemenj
        HostName        ftp.noekeon.org
        ProxyCommand    /usr/local/bin/ssh-tunnel.pl -q -f - - %h %p

Host andlinux
	User		beq06659
	HostName	andlinux
	ProxyCommand	none

Host gryphon
	User		baddreams
	HostName	gryphon

Host *
#	ProxyCommand /usr/local/bin/ssh-tunnel.pl - - %h %p
	Proxycommand /bin/bash -c 'exec 3<>/dev/tcp/emea.nics.nxp.com/8080;echo -n -e "CONNECT %h:%p HTTP/1.0\r\n\r\n" >&3; read -n 39 <&3; echo -n -e "SSH-2.0-OpenSSH_5.1\r\n" >&3; head -c 50 <&3; read -n 21; exec /usr/local/bin/socat - FD:3'
	ServerAliveInterval     15

~/.ssh/config-tunnel

Download [{{#file: config-nxp}} this file].

# ~/.ssh/config-tunnel

Host ftp.noekeon.org noekeon
	User				daemenj
	HostName			ftp.noekeon.org
	ProxyCommand		/usr/local/bin/ssh-tunnel.pl -q -f - - %h %p

Host noekeonsshtunnel
	User				daemenj
	HostName			ftp.noekeon.org
	ProxyCommand		/usr/local/bin/ssh-tunnel.pl -q -f - - %h %p

Host andlinux
	User				beq06659
	HostName			andlinux
	ProxyCommand		none

Host gryphon gryphon
	User				baddreams
	HostName			gryphon

Host *
	ProxyCommand		/usr/local/bin/ssh-tunnel.pl -q - - %h %p
	ServerAliveInterval	15

~/.ssh/proxy.conf

Download [{{#file: proxy.conf}} this file].

# SSH Tunnel configuration file.

# Section: OPTIONS
[option-section]
debug=0
dry=0
icmp=0
sshping=1
timeout=1

# Section: PROXY
[proxy2-section]

#=== Philips gateway & proxy ========
130.145.67/24   proxy.adc-itcl.ce.philips.com:8080 -C ~/.ssh/clbanner.txt

#=== NXP Proxy - on DELL/WinXP ======================
#proxy is a synonym - but not portable because it might only work at Leuven...
#134.27.180/22	proxy:8080		-C ~/.ssh/clbanner.txt
134.27.180/22	emea.nics.nxp.com:8080	-C ~/.ssh/clbanner.txt

#=== NXP Proxy - on DELL/AndLinux ======================
#proxy is a synonym - but not portable because it might only work at Leuven... 
#10.0.2.2/32		proxy:8080		-C ~/.ssh/clbanner.txt
10.0.2.2/32		emea.nics.nxp.com:8080  -C ~/.ssh/clbanner.txt

~/.vimrc

Download [{{#file: .vimrc}} this file].

syntax enable
set bg=light
set number
set bs=2
nnoremap j h
nnoremap k j
nnoremap l k
nnoremap m l
nnoremap h m
vnoremap j h
vnoremap k j
vnoremap l k
vnoremap m l
vnoremap h m
set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
set autoindent