#!/bin/bash # tento skript !!nemusi byt nutne!! prenosny, nutno upravit rucne nektere hodnoty !! # parametry predane skriptu a zapiseme /etc/resolv.conf if [ ! -z "$1" ] && [ -z "$3" ] && [ ! -z "$2" ]; then case $1 in -h | --help | -? ) echo "usage:: gimme just two parameters, which is first ip of wanted nameserver and second domainname" exit 1;; * ) # echo "nameserver $1" >>/etc/resolv.conf echo "$1 was written to /etc/resolv.conf such a nameserver!" echo "$2 will be used as domainname in /etc/hosts";; esac; else ## if continous just here !! echo "usage:: gimme just two params, which first is ip of wanted nameserver and second domainame used in /etc/hosts" exit 1 fi # konfigurace rootova shellu. Nahrazeni ksh bashem usermod -s /bin/bash root echo 'export PATH=/usr/sbin:/usr/bin:/opt/sfw/bin:/opt/sfw/sbin:/usr/sfw/bin:/usr/sfw/sbin' >>~/.bash_profile echo 'export MANPATH=/usr/share/man:/opt/sfw/man:/usr/sfw/man' >>~/.bash_profile echo 'export PAGER=less' >> ~/.bash_profile echo 'export PS1="${_t}${_u}$HOSTNAME:\w${_p}# "' >>~/.bash_profile echo 'export LANG=POSIX' >>~/.bash_profile # povoleni pristupu roota pres ssh #mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bckp #cat /etc/ssh/sshd_config.bckp | egrep -v '^#|^$' | sed 's/\(PermitRootLogin\ \)no/\1yes/' >/etc/ssh/sshd_config #svcadm restart ssh # upraveni sitovani #mv /etc/nsswitch.conf /etc/nsswitch.conf.bckp #cat /etc/nsswitch.conf.bckp | egrep -v '^#|^$' | sed '/hosts:/s/files$/files\ dns/' >/etc/nsswitch.conf #mv /etc/inet/hosts /etc/inet/hosts.bckp #cat /etc/inet/hosts.bckp | sed "/$HOSTNAME/s/$HOSTNAME/$HOSTNAME.$2\ $HOSTNAME/" >/etc/inet/hosts #domainname $2 # zapis konfigurace edotoru vim cat << 'EOF' >~/.vimrc " All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just " /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime " you can find below. If you wish to change any of those settings, you should " do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten " everytime an upgrade of the vim packages is performed. It is recommended to " make changes after sourcing debian.vim since it alters the value of the " 'compatible' option. " This line should not be removed as it ensures that various options are " properly set to work with the Vim-related packages available in Debian. runtime! debian.vim " Uncomment the next line to make Vim more Vi-compatible " NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous " options, so any other options should be set AFTER setting 'compatible'. "set compatible " Vim5 and later versions support syntax highlighting. Uncommenting the next " line enables syntax highlighting by default. syntax on " If using a dark background within the editing area and syntax highlighting " turn on this option as well set background=dark " Uncomment the following to have Vim jump to the last position when " reopening a file "if has("autocmd") " au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") " \| exe "normal g'\"" | endif "endif " Uncomment the following to have Vim load indentation rules according to the " detected filetype. Per default Debian Vim only load filetype specific " plugins. "if has("autocmd") " filetype indent on "endif " The following are commented out as they cause vim to behave a lot " differently from regular Vi. They are highly recommended though. set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set ignorecase " Do case insensitive matching set smartcase " Do smart case matching set incsearch " Incremental search set autowrite " Automatically save before commands like :next and :make set hidden " Hide buffers when they are abandoned "set mouse=a " Enable mouse usage (all modes) in terminals " Source a global configuration file if available " XXX Deprecated, please move your changes here in /etc/vim/vimrc if filereadable("/etc/vim/vimrc.local") source /etc/vim/vimrc.local endif set hlsearch nnoremap :tabnext nnoremap :tabprevious set wildmode=list:longest,full set gdefault " spelling let IspellLang = 'british' let PersonalDict = '~/.ispell_' . IspellLang execute 'set dictionary+=' . PersonalDict set dictionary+=/usr/dict/words set complete=.,w,k set infercase execute 'nnoremap \si :w:!ispell -x -d ' . IspellLang . ' %:e' execute 'nnoremap \sl :w ! grep -v "^>" grep -E -v "^[[:alpha:]-]+: " ' . \ ' ispell -l -d ' . IspellLang . ' sort uniq' nnoremap \sh :call HighlightSpellingErrors() nmap \sh nnoremap \sc :if &ft == 'html' sy on \ else :sy clear SpellError endif nmap \sc set title set ls=2 function! HighlightSpellingErrors() " highlights spelling errors in the current window; used for the \sh operation " defined above; " requires the ispell, sort, and uniq commands to be in the path; " requires the global variable IspellLang to be defined above, and to contain " the preferred `Ispell' language; " for mail/news messages, requires the grep command to be in the path; " for HTML documents, saves the file to disk and requires the lynx command to " be in the path " " by Smylers http://www.stripey.com/vim/ " (inspired by Krishna Gadepalli and Neil Schemenauer's vimspell.sh) " " 2000 Jun 1: for `Vim' 5.6 " for HTML files, remove all current syntax highlighting (so that " misspellings show up clearly), and note it's HTML for future reference: if &filetype == 'html' let HTML = 1 syntax clear " for everything else, simply remove any previously-identified spelling " errors (and corrections): else let HTML = 0 if hlexists('SpellError') syntax clear SpellError endif if hlexists('Normal') syntax clear Normal endif endif " form a command that has the text to be checked piping through standard " output; for HTML files this involves saving the current file and processing " it with `Lynx'; for everything else, use all the buffer except quoted text " and mail/news headers: if HTML write let PipeCmd = '! lynx --dump --nolist % |' else let PipeCmd = 'write !' if &filetype == 'mail' let PipeCmd = PipeCmd . ' grep -v "^> " | grep -E -v "^[[:alpha:]-]+:" |' endif endif " execute that command, then generate a unique list of misspelt words and " store it in a temporary file: let ErrorsFile = tempname() execute PipeCmd . ' ispell -l -d '. g:IspellLang . \ ' | sort | uniq > ' . ErrorsFile " open that list of words in another window: execute 'split ' . ErrorsFile " for every word in that list ending with "'s", check if the root form " without the "'s" is in the dictionary, and if so remove the word from the " list: global /'s$/ execute 'read ! echo ' . expand('') . \ ' | ispell -l -d ' . g:IspellLang | delete " (If the root form is in the dictionary, ispell -l will have no output so " nothing will be read in, the cursor will remain in the same place and the " :delete will delete the word from the list. If the root form is not in the " dictionary, then ispell -l will output it and it will be read on to a new " line; the delete command will then remove that misspelt root form, leaving " the original possessive form in the list!) " only do anything if there are some misspellings: if strlen(getline('.')) > 0 " if (previously noted as) HTML, replace each non-alphanum char with a " regexp that matches either that char or a &...; entity: if HTML % substitute /\W/\\(&\\|\&\\(#\\d\\{2,4}\\|\w\\{2,8}\\);\\)/e endif " turn each mistake into a `Vim' command to place it in the SpellError " syntax highlighting group: % substitute /^/syntax match SpellError !\\!/ endif " save and close that file (so switch back to the one being checked): exit " make syntax highlighting case-sensitive, then execute all the match " commands that have just been set up in that temporary file, delete it, and " highlight all those words in red: syntax case match execute 'source ' . ErrorsFile call delete(ErrorsFile) highlight SpellError term=reverse ctermfg=DarkRed guifg=Red " with HTML, don't mark any errors in e-mail addresses or URLs, and ignore " anything marked in a fix-width font (as being computer code): if HTML syntax case ignore syntax match Normal !\<[[:alnum:]._-]\+@[[:alnum:]._-]\+\.\a\+\>! syntax match Normal \ !\<\(ht\|f\)tp://[-[:alnum:].]\+\a\(/[-_.[:alnum:]/#&=,]*\)\=\>! syntax region Normal start=!
! end=!
! syntax region Normal start=!! end=!! syntax region Normal start=!! end=!! endif endfunction " HighlightSpellingErrors() set paste colorscheme desert " tabspaces set tabstop=4 set shiftwidth=4 set expandtab set statusline=%<%f%<%{FileTime()}%<%h%m%r%=%-20.(line=%03l,col=%02c%V,totlin=%L%)\%h%m%r%=%-30(,BfNm=%n%Y%)\%P\*%=%{CurTime()} set rulerformat=%15(%c%V\ %p%%%) "set rulerformat=%<%f%<%{FileTime()}%<%h%m%r%=%-20.(line=%03l,col=%02c%V,totlin=%L%)\%h%m%r%=%-30(,BfNm=%n%Y%)\%P\*%=%{CurTime()} fu! FileTime() let ext=tolower(expand("%:e")) let fname=tolower(expand('%<')) let filename=fname . '.' . ext let msg="" let msg=msg." ".strftime("(Modified %b,%d %y %H:%M:%S)",getftime(filename)) return msg endf fu! CurTime() let ftime="" let ftime=ftime." ".strftime("%b,%d %y %H:%M:%S") return ftime endf set backspace=2 EOF echo "all done!" exit 0