bash скрипты

This commit is contained in:
Kolan Sh 2011-04-09 19:06:44 +04:00
parent ac03ce0328
commit de6d752b16
56 changed files with 3980 additions and 0 deletions

103
bash/backup/backup.sh Executable file
View File

@ -0,0 +1,103 @@
#!/bin/bash
# -------------------- НАСТРОЙКИ --------------------
#ARC_DIR="/home/bkp" # хранилище резервных копий
ARC_DIR="./bkp_dir" # хранилище резервных копий
#ARC_SYNC_DIR="/mnt/smb.backbone/bkp" # зеркало хранилища
ARC_SYNC_DIR="./remote_dir" # зеркало хранилища
#USR_DIRS="/home/kolan /home/tanya /home/ftp" # пользовательские директории для резервирования
USR_DIRS="./usr_data" # пользовательские директории для резервирования
USR_EXCL="" # исключения
#SYS_DIRS="/bin /boot /etc /lib32 /lib64 /opt /root /sbin /usr /var" # системные директории для резервирования
SYS_DIRS="./sys_data" # системные директории для резервирования
SYS_EXCL="/var/tmp" # исключения
FULL_NUM=2 # кол-во хранимых полных копий
#INCR_NUM=8 # кол-во инкр. копий между полными копиями
INCR_NUM=4 # кол-во инкр. копий между полными копиями
TAR="nice -n 19 ionice -c2 -n7 tar czp --one-file-system -f" # команда архивирования
EXT="tgz"
# -------------------- ПЕРЕМЕННЫЕ --------------------
NOW=`date +%Y%m%d\ %H:%M:%S`
HOSTNAME=`hostname`
ARC_DIR_HOST="$ARC_DIR/$HOSTNAME"
ARC_SYNC_DIR_HOST="$ARC_SYNC_DIR/$HOSTNAME"
DIRS="$SYS_DIRS $USR_DIRS"
EXCL="$SYS_EXCL $USR_EXCL"
# -------------------- ФУНКЦИИ --------------------
# Удаление "сломанных" инкрементальных копий,
# для которых не найдена полная копия
function rm_brok_incr
{
for dir in `ls $ARC_DIR_HOST`; do
full_arc_dirname=`cat $ARC_DIR_HOST/$dir/full-arc-dirname 2>/dev/null`
if [[ ( "$?" != "0" || ! -d $ARC_DIR_HOST/$full_arc_dirname ) && "`echo $dir|grep full`" == "" ]]; then
rm -rf $ARC_DIR_HOST/$dir
fi
done
}
# -------------------- MAIN --------------------
# создаём необходимые каталоги
mkdir -p $ARC_DIR_HOST $ARC_SYNC_DIR_HOST
# удаляем мусор
rm_brok_incr
# дата последней полной копии
LAST_FULL_DIR=`ls $ARC_DIR_HOST|grep full|tail -n1`
LAST_FULL_TIME=`echo $LAST_FULL_DIR|sed 's/-full//;s/\.//g;s/_/ /'`
# кол-во сделанных инкр. копий
INCR_COUNT=0
for dir in `ls $ARC_DIR_HOST`; do
if [[ "`echo $dir|grep full`" != "" ]]; then
INCR_COUNT=0
else
INCR_COUNT=$(($INCR_COUNT+1))
fi
done
# если кол-во инкр. копий превысило INCR_NUM,
# то необходимо делать новую полную резервную копию
if [[ $INCR_COUNT -ge $INCR_NUM ]]; then
LAST_FULL_DIR=""
LAST_FULL_TIME=""
fi
# выбор копии - полная или инкр.
BKP_DIRNAME=`date -d "$NOW" +%Y.%m.%d_%H:%M:%S`
if [[ "$LAST_FULL_DIR" == "" ]]; then # ----- полная копия
BKP_DIRNAME=$BKP_DIRNAME-full
mkdir -p $ARC_DIR_HOST/$BKP_DIRNAME
# создаём полную резервную копию
for dir in $DIRS; do
dir_compatible_name="`echo $dir|sed 's/^\.//; s/^\///; s/\//^/g'`"
$TAR $ARC_DIR_HOST/$BKP_DIRNAME/$dir_compatible_name.$EXT $dir --exclude "$EXCL"
done
else # ----- инкрем. копия
mkdir -p $ARC_DIR_HOST/$BKP_DIRNAME
echo $LAST_FULL_DIR > $ARC_DIR_HOST/$BKP_DIRNAME/full-arc-dirname
NEWER=`date -d "$LAST_FULL_TIME" +%Y-%m-%d\ %H:%M:%S`
# создаём резервную копию
for dir in $DIRS; do
dir_compatible_name="`echo $dir|sed 's/^\.//; s/^\///; s/\//^/g'`"
$TAR $ARC_DIR_HOST/$BKP_DIRNAME/$dir_compatible_name.$EXT $dir --newer "$NEWER" --exclude "$EXCL"
done
fi
# удаление старых резервных копий
for dir in `ls $ARC_DIR_HOST|grep full|head -n -$FULL_NUM`; do
rm -rf $ARC_DIR_HOST/$dir
done
# удаляем мусор
rm_brok_incr
# синхронизируем с зеркалом
rsync -rt --delete $ARC_DIR_HOST/ $ARC_SYNC_DIR_HOST
rsync -rt --delete $ARC_SYNC_DIR/ $ARC_DIR

50
bash/delunpack/1.txt Normal file
View File

@ -0,0 +1,50 @@
apt
apt-utils
apt
apt-utils
bash-completion
bsd-mailx
debian-archive-keyring
dhcp3-client
dhcp3-common
diffutils
exim4
exim4-base
exim4-config
exim4-daemon-light
gcc-4.2-base
gnupg
gpgv
gs-common
gzip
libaudit0
libc6-i686
libcap2
libcwidget3
libdb4.6
libdevmapper1.02.1
libesd-alsa0
libffi5
liblockfile1
libnewt0.52
libpci3
libpopt0
libsdl1.2debian-alsa
libslang2
libxapian15
make
nano
ncurses-base
ncurses-term
netcat-traditional
nvclock
pciutils
python-central
python-reportbug
reportbug
rsyslog
tar
vim-common
vim-tiny
whiptail
zeroinstall-injector

View File

939
bash/delunpack/allpacks.txt Normal file
View File

@ -0,0 +1,939 @@
app-install-data
apt
apt-utils
arj
audacious
audacious-plugins
audacious-plugins-extra
avahi-daemon
avahi-utils
axel
base-files
base-passwd
bash
bind9-host
binutils
bsdmainutils
bsdutils
build-essential
busybox
bzip2
ca-certificates
cabextract
capplets-data
cdrdao
checkinstall
compiz
compiz-core
compiz-fusion-plugins-extra
compiz-fusion-plugins-main
compiz-gnome
compiz-gtk
compiz-plugins
compizconfig-settings-manager
console-common
console-cyrillic
console-data
console-terminus
console-tools
coreutils
cpio
cpp
cpp-4.3
cpufreqd
cpufrequtils
cron
csmash
csmash-data
cups
cups-client
cups-common
cupsddk
cupsddk-drivers
curl
d4x
dbus
dbus-x11
debconf
debconf-i18n
debfoster
debian-archive-keyring
debian-multimedia-keyring
debianutils
defoma
desktop-file-utils
devhelp
devhelp-common
dictionaries-common
diff
djvulibre-desktop
dmidecode
dnsutils
doc-base
docbook-xml
dosbox
dosfstools
dpkg
dpkg-dev
dvd+rw-tools
e2fslibs
e2fsprogs
eject
eog
esound-common
evince
evolution-data-server-common
exiv2
exuberant-ctags
fakeroot
file
file-roller
findutils
finger
fontconfig
fontconfig-config
foomatic-db
foomatic-db-engine
foomatic-filters
fp-compiler
fp-docs
fp-units-rtl
freeglut3
freeglut3-dev
fuse-utils
fuseiso
fusesmb
g++
g++-4.3
gamin
gawk
gcc
gcc-4.3
gcc-4.3-base
gcolor2
gconf-editor
gconf2
gconf2-common
gdm
gedit
gedit-common
gedit-plugins
genisoimage
gettext
gettext-base
gftp
gftp-common
gftp-gtk
gftp-text
ghex
ghostscript
ghostscript-x
gimp
gimp-data
gksu
gnome-about
gnome-applets
gnome-applets-data
gnome-commander
gnome-control-center
gnome-desktop-data
gnome-doc-utils
gnome-icon-theme
gnome-keyring
gnome-media
gnome-media-common
gnome-menus
gnome-mime-data
gnome-mount
gnome-nettool
gnome-panel
gnome-panel-data
gnome-power-manager
gnome-screensaver
gnome-session
gnome-settings-daemon
gnome-system-monitor
gnome-terminal
gnome-terminal-data
gnome-utils
gnome-volume-manager
gnomebaker
gnupg
gpgv
grep
groff-base
grub
grub-common
gs-common
gsfonts
gstreamer0.10-alsa
gstreamer0.10-ffmpeg
gstreamer0.10-plugins-base
gstreamer0.10-plugins-good
gstreamer0.10-plugins-ugly
gstreamer0.10-x
gtk2-engines-murrine
gtk2-engines-nodoka
gtk2-engines-pixbuf
gtk2-engines-qtcurve
gucharmap
gzip
hal
hal-info
hdparm
hicolor-icon-theme
hostname
hpijs
hplip
hplip-data
hplip-gui
icedax
icedove
icedove-l10n-ru
icedove-locale-ru
icedove-traybiff
iceweasel
iceweasel-l10n-ru
ifupdown
imagemagick
initramfs-tools
initscripts
intltool-debian
iptables
iputils-ping
irussian
iso-codes
ispell
kdelibs-data
kdelibs4c2a
kernel-package
klibc-utils
klogd
konwert
konwert-filters
ladcca2
language-env
laptop-detect
less
liba52-0.7.4
libaa1
libacl1
libakode2
libalut0
libamrnb3
libamrwb3
libao2
libapm1
libart-2.0-2
libarts1-akode
libarts1c2a
libartsc0
libasound2
libaspell15
libasyncns0
libatk1.0-0
libatk1.0-doc
libattr1
libaudclient1
libaudid3tag1
libaudio2
libaudiofile0
libavahi-client3
libavahi-common-data
libavahi-common3
libavahi-compat-libdnssd1
libavahi-core5
libavahi-glib1
libavahi-qt3-1
libavc1394-0
libavcodec51
libavformat52
libavutil49
libbeecrypt6
libbind9-40
libbinio1ldbl
libblas3gf
libblkid1
libbonobo2-0
libbonobo2-common
libbonoboui2-0
libbonoboui2-common
libbz2-1.0
libc6
libc6-dev
libcaca0
libcairo2
libcairomm-1.0-1
libcamel1.2-11
libcap1
libcap2
libcddb2
libcdio-cdda0
libcdio7
libcdparanoia0
libcomerr2
libcompizconfig0
libcompress-raw-zlib-perl
libcompress-zlib-perl
libconfuse0
libconsole
libcpufreq0
libcroco3
libcucul0
libcups2
libcupsimage2
libcurl3
libcurl3-gnutls
libdaemon0
libdatrie0
libdb4.5
libdb4.6
libdbus-1-3
libdbus-glib-1-2
libdecoration0
libdevhelp-1-0
libdevmapper1.02
libdevmapper1.02.1
libdirac0
libdirectfb-1.0-0
libdjvulibre21
libdmx1
libdns45
libdrm2
libdv4
libdvdnav4
libdvdread3
libebook1.2-9
libecal1.2-7
libedataserver1.2-9
libedataserverui1.2-8
libedit2
libeel2-2.20
libeel2-data
libenchant1c2a
libesd-alsa0
libexempi3
libexif12
libexiv2-4
libexpat1
libfaac0
libfaad0
libffi5
libflac8
libfluidsynth1
libfontconfig1
libfontenc1
libfreebob0
libfreetype6
libfreezethaw-perl
libfribidi0
libfs6
libfuse2
libgail-common
libgail18
libgamin0
libgc1c2
libgcc1
libgconf2-4
libgcrypt11
libgd2-noxpm
libgdbm3
libgeoip1
libgfortran3
libggi-target-x
libggi2
libgif4
libgii1
libgii1-target-x
libgimp2.0
libgksu2-0
libgl1-mesa-dev
libgl1-mesa-glx
libglade2-0
libglew1.5
libglib2.0-0
libglib2.0-doc
libglibmm-2.4-1c2a
libglu1-mesa
libglu1-mesa-dev
libglut3-dev
libgmp3c2
libgnome-desktop-2
libgnome-keyring0
libgnome-media0
libgnome-menu2
libgnome-window-settings1
libgnome2-0
libgnome2-common
libgnomecanvas2-0
libgnomecanvas2-common
libgnomecups1.0-1
libgnomekbd-common
libgnomekbd2
libgnomekbdui2
libgnomeprint2.2-0
libgnomeprint2.2-data
libgnomeprintui2.2-0
libgnomeprintui2.2-common
libgnomeui-0
libgnomeui-common
libgnomevfs2-0
libgnomevfs2-common
libgnomevfs2-extra
libgnutls13
libgnutls26
libgomp1
libgpg-error0
libgphoto2-2
libgphoto2-port0
libgpm2
libgraphviz4
libgs8
libgsf-1-114
libgsf-1-common
libgsm1
libgstreamer-plugins-base0.10-0
libgstreamer0.10-0
libgtk2.0-0
libgtk2.0-bin
libgtk2.0-common
libgtk2.0-doc
libgtkhex0
libgtkhtml2-0
libgtkmm-2.4-1c2a
libgtksourceview-common
libgtksourceview1.0-0
libgtksourceview2.0-0
libgtksourceview2.0-common
libgtkspell0
libgtop2-7
libgtop2-common
libgucharmap6
libgweather-common
libgweather1
libhal-storage1
libhal1
libhtml-parser-perl
libhtml-tagset-perl
libhtml-tree-perl
libhttrack1
libhunspell-1.2-0
libhyphen0
libice-dev
libice6
libicu38
libid3tag0
libidl0
libidn11
libiec61883-0
libieee1284-3
libilmbase6
libimlib2
libio-compress-base-perl
libio-compress-zlib-perl
libisc45
libisccc40
libisccfg40
libjack0
libjasper1
libjpeg62
libkeyutils1
libklibc
libkpathsea4
libkrb53
liblapack3gf
liblcms1
libldap-2.4-2
libldap2
liblircclient0
liblocale-gettext-perl
libltdl3
liblua50
liblualib50
liblwres40
liblzo1
liblzo2-2
libmad0
libmagic1
libmagick10
libmailtools-perl
libmalaga7
libmcs1
libmetacity0
libmikmod2
libmldbm-perl
libmms0
libmng1
libmowgli1
libmozjs1d
libmp3lame0
libmpcdec3
libmpeg2-4
libmpfr1ldbl
libmtp7
libmysqlclient15off
libnautilus-burn4
libnautilus-extension1
libncurses5
libncurses5-dev
libncursesw5
libneon27
libneon27-gnutls
libnet-dbus-perl
libnewt0.52
libnotify1
libnspr4-0d
libnss-mdns
libnss3-1d
libntfs-3g31
libntfs10
libogg0
liboil0.3
liboobs-1-4
libopenal0a
libopenal1
libopencdk8
libopenexr6
liborbit2
libpam-gnome-keyring
libpam-modules
libpam-runtime
libpam0g
libpanel-applet2-0
libpango1.0-0
libpango1.0-common
libpango1.0-doc
libpaper1
libpcap0.8
libpci3
libpcre3
libperl5.10
libpixman-1-0
libpng12-0
libpoppler-glib3
libpoppler3
libpopt0
libpostproc51
libpthread-stubs0
libpthread-stubs0-dev
libpulse0
libqt3-mt
libqt4-assistant
libqt4-dbus
libqt4-designer
libqt4-help
libqt4-network
libqt4-qt3support
libqt4-script
libqt4-sql
libqt4-sql-mysql
libqt4-svg
libqt4-test
libqt4-webkit
libqt4-xml
libqt4-xmlpatterns
libqtcore4
libqtgui4
librarian0
libraw1394-8
libreadline5
libresid-builder0c2a
librpm4.4
librsvg2-2
librsvg2-common
libsamplerate0
libsane
libsane-extras
libsasl2-2
libsasl2-modules
libschroedinger-1.0-0
libscrollkeeper0
libsdl-image1.2
libsdl-mixer1.2
libsdl-net1.2
libsdl-sound1.2
libsdl-ttf2.0-0
libsdl1.2debian
libsdl1.2debian-alsa
libselinux1
libsensors3
libsepol1
libsexy2
libshout3
libsidplay1
libsidplay2
libsigc++-2.0-0c2a
libslab0
libslang2
libslp1
libsm-dev
libsm6
libsmbclient
libsmbios2
libsmpeg0
libsndfile1
libsnmp-base
libsnmp15
libsoup2.4-1
libspectre1
libspeex1
libsqlite3-0
libss2
libssh2-1
libssl0.9.8
libstartup-notification0
libstdc++5
libstdc++6
libstdc++6-4.3-dev
libstlport4.6ldbl
libsuitesparse-3.1.0
libsvga1
libsysfs2
libtag1c2a
libtalloc1
libtasn1-3
libtext-charwidth-perl
libtext-iconv-perl
libtext-wrapi18n-perl
libthai-data
libthai0
libtheora0
libtie-ixhash-perl
libtiff4
libtimedate-perl
libtorrent10
libtotem-plparser10
libtrackerclient0
libts-0.0-0
libuniconf4.4
liburi-perl
libusb-0.1-4
libuuid-perl
libuuid1
libvisual-0.4-0
libvisual-0.4-plugins
libvoikko1
libvolume-id0
libvorbis0a
libvorbisenc2
libvorbisfile3
libvte-common
libvte9
libwavpack1
libwbclient0
libwmf0.2-7
libwnck-common
libwnck22
libwpd8c2a
libwpg-0.1-1
libwps-0.1-1
libwrap0
libwvstreams4.4-base
libwvstreams4.4-extras
libwww-perl
libwxbase2.8-0
libwxgtk2.8-0
libx11-6
libx11-data
libx11-dev
libx264-65
libx86-1
libxau-dev
libxau6
libxaw7
libxcb-render-util0
libxcb-render0
libxcb-xlib0
libxcb-xlib0-dev
libxcb1
libxcb1-dev
libxcomposite1
libxcursor1
libxdamage1
libxdmcp-dev
libxdmcp6
libxext-dev
libxext6
libxfixes3
libxfont1
libxft2
libxi6
libxinerama1
libxkbfile1
libxklavier12
libxml-parser-perl
libxml-twig-perl
libxml2
libxml2-utils
libxmlrpc-c3
libxmu6
libxmuu1
libxplc0.3.13
libxpm4
libxrandr2
libxrender1
libxres1
libxslt1.1
libxss1
libxt-dev
libxt6
libxtrap6
libxtst6
libxv1
libxvidcore4
libxvmc1
libxxf86dga1
libxxf86misc1
libxxf86vm1
linux-image-2.6.28.10
linux-image-2.6.29.2
linux-image-2.6.30
linux-image-2.6.30-rc6
linux-libc-dev
linux-sound-base
localepurge
locales
login
logrotate
lp-solve
lsb-base
lsof
lynx
lynx-cur
lzma
lzop
make
makedev
man-db
manpages
manpages-ru
mawk
mc
meld
menu
menu-xdg
mesa-common-dev
mesa-utils
metacity
metacity-common
mime-support
miscfiles
mktemp
module-init-tools
mount
mozilla-traybiff-common
mplayer
mplayer-skin-blue
msttcorefonts
multiget
murrine-themes
music-applet
myspell-en-us
myspell-ru
mysql-common
nautilus
nautilus-actions
nautilus-cd-burner
nautilus-data
nautilus-filename-repairer
nautilus-image-converter
nautilus-open-terminal
nautilus-sendto
nautilus-share
ncompress
ncurses-base
ncurses-bin
net-tools
netbase
netcat
netcat-traditional
neverball
neverball-common
neverball-data
nexuiz
nexuiz-data
nexuiz-music
notification-daemon
ntfs-3g
openoffice.org-base-core
openoffice.org-calc
openoffice.org-common
openoffice.org-core
openoffice.org-draw
openoffice.org-help-ru
openoffice.org-impress
openoffice.org-l10n-ru
openoffice.org-math
openoffice.org-style-andromeda
openoffice.org-writer
openssh-blacklist
openssh-client
openssh-server
openssl
openssl-blacklist
oss-compat
p7zip
passwd
patch
pciutils
perl
perl-base
perl-modules
pidgin
pkg-config
pm-utils
po-debconf
poppler-utils
powermgmt-base
ppp
procps
psfontmgr
psmisc
python
python-cairo
python-central
python-compizconfig
python-dbus
python-elementtree
python-glade2
python-gmenu
python-gnome2
python-gnome2-desktop
python-gobject
python-gtk2
python-gtksourceview2
python-imaging
python-libxml2
python-minimal
python-numeric
python-pyorbit
python-qt3
python-qt4
python-qt4-common
python-reportlab
python-sexy
python-sip4
python-support
python-vte
python2.5
python2.5-minimal
qstat
qt4-qtconfig
radeontool
re
readline-common
rhythmbox-applet
rpm
rss-glx
rtorrent
samba
samba-common
sane-utils
screem
scrollkeeper
sed
sgml-base
sgml-data
shared-mime-info
smbclient
ssh
ssl-cert
stardict
stardict-common
stardict-gtk
sudo
synaptic
sysklogd
system-tools-backends
sysv-rc
sysvinit
sysvinit-utils
t1-cyrillic
t1-teams
tar
tcl8.4
tcpd
testdisk
tilda
tk8.4
toshset
traceroute
ttf-bitstream-vera
ttf-dejavu
ttf-dejavu-core
ttf-dejavu-extra
ttf-dustin
ttf-liberation
ttf-mscorefonts-installer
ttf-opensymbol
ttf-thryomanes
tzdata
ucf
udev
unace
unzip
update-inetd
usbutils
util-linux
vbetool
webhttrack
wget
whiptail
whois
wine
wodim
wvdial
x-ttcidfont-conf
x11-common
x11-session-utils
x11-utils
x11-xfs-utils
x11-xkb-utils
x11-xserver-utils
x11proto-core-dev
x11proto-input-dev
x11proto-kb-dev
x11proto-xext-dev
xauth
xfonts-100dpi
xfonts-75dpi
xfonts-base
xfonts-bolkhov-75dpi
xfonts-bolkhov-cp1251-75dpi
xfonts-bolkhov-cp1251-misc
xfonts-bolkhov-koi8r-75dpi
xfonts-bolkhov-koi8r-misc
xfonts-bolkhov-koi8u-75dpi
xfonts-bolkhov-koi8u-misc
xfonts-bolkhov-misc
xfonts-cronyx-100dpi
xfonts-cronyx-cp1251-100dpi
xfonts-cronyx-isocyr-100dpi
xfonts-cronyx-isocyr-75dpi
xfonts-cronyx-isocyr-misc
xfonts-cronyx-koi8r-100dpi
xfonts-cronyx-koi8u-100dpi
xfonts-cronyx-misc
xfonts-cyrillic
xfonts-encodings
xfonts-intl-european
xfonts-scalable
xfonts-utils
xkb-data
xml-core
xqf
xserver-xorg
xserver-xorg-core
xserver-xorg-input-kbd
xserver-xorg-input-mouse
xserver-xorg-video-voodoo
xsltproc
xtrans-dev
xulrunner-1.9
xulrunner-1.9-gnome-support
xutils
xutils-dev
yelp
zenity
zip
zlib1g

View File

@ -0,0 +1,79 @@
#!/bin/bash
# Очистка системы от ненужных пакетов.
# Список нужных пакетов должен быть представлен в файле exclude_hand.lst
# !!! Файл exclude_base.lst можно получить во время базовой установки, используя mkbaselist.sh !!!
exclbase=exclude_base.lst
exclhand=exclude_hand.lst
if [ `whoami` != "root" ]; then
echo "Внимание! Для запуска программы требуются права root."
echo "Используйте \$su -c './`basename $0`'"
echo "Или \$sudo `basename $0`"
echo "После чего введите пароль администратора"
exit 1
fi
debout=margin_out.lst
debout2=margin_out2.lst
tmpfile=tmp-delunpack.sh-`date +%s`
touch $debout2
while true ; do
# Получаем список всех ненужных файлов в $debout
./margin.sh >$tmpfile
{
while true ; do
read a
#a=${a#[^ ]*\ }
if [ "$a" == "" ]; then break ; fi
grep -E "\<$a\>" $exclbase &>/dev/null || grep -E "\<$a\>" $exclhand &>/dev/null
if [[ $? == 0 ]]; then continue; fi
echo $a
done
} <$tmpfile >$debout
rm -f $tmpfile
# Проверяем - остались ли ненужные пакеты
# read a <$debout
# if [ "$a" == "" ]; then break ; fi # выходим, если больше удалять нечего
cmp $debout $debout2 &>/dev/null
if [[ $? == 0 ]]; then break; fi # выходим, если больше удалять нечего
cp $debout $debout2
# Удаляем все пакеты, представленные в $debout
keep=`cat exclude_base.lst; cat exclude_hand.lst`
{
while true ; do
read a
if [ "$a" == "" ]; then break; fi
# Проверяем - не найден ли пакет, удаляемый по зависимостям
# в списках пакетах, нужных пользователю
contin=false
for a in `apt-get -s -y remove --purge $a|grep Remv|cut -d ' ' -f2`; do
if [[ `echo $keep|grep -E "\<$a\>"` ]]; then contin=true; fi
done
if [[ $contin == true ]]; then echo "Пакет, удаляемый по зависимостям...contcontcont" ; continue; fi
echo ">>> Удаляем пакет $a <<<"
apt-get -y remove --purge $a
if [ $? != 0 ]; then
echo "Невозможно удалить пакет."
exit 1
fi
done
} <$debout
done
rm -f $debout
rm -f $debout2
echo "Удаление пакетов завершено."
echo "Список оставшихся пакетов можно посмотреть, выполнив команду \$./margin.sh"
exit 0

View File

@ -0,0 +1,23 @@
#!/bin/bash
# Упрощённый вариант программы по удалению
keep=`cat exclude_base.lst;cat exclude_hand.lst;cat /var/lib/debfoster/keepers`
for p in `dpkg -l| grep "ii "|cut -d ' ' -f3`; do
echo "Рассматривается пакет $p"
can_remove=true
for p2r in `apt-get -s -y remove $p| grep Remv|cut -d ' ' -f2` ; do
echo "Проверяется возможность удаления пакета $p2r"
echo $keep|grep -E "\<$p2r\>" >/dev/null
if [[ $? == 0 ]]; then
echo "$p2r нужен пользователю";
can_remove=false
break;
fi
done
if [[ $can_remove == true ]]; then
echo "delunpack2.sh: Удаляем пакет $p"
apt-get -y remove --purge $p
fi
dpkg --configure -a
done

View File

@ -0,0 +1,37 @@
#!/bin/bash
# Упрощённый вариант программы по удалению
# keep=`(cat exclude_base.lst;cat /var/lib/debfoster/keepers)|sort|uniq`
keep=`(cat exclude_base2.lst;cat /var/lib/debfoster/keepers)|sort|uniq`
for p in `dpkg -l| grep "ii "|cut -d ' ' -f3`; do
echo "Рассматривается пакет $p"
echo "$keep"|grep "$p" >/dev/null
if [[ "$?" == "0" ]]; then
echo "$p нужен пользователю";
continue
fi
can_remove=true
for p2r in `apt-get -s -y remove "$p"| grep Remv|cut -d ' ' -f2` ; do
echo "Проверяется возможность удаления пакета $p2r"
echo "$keep"|grep -E "\<$p2r\>" >/dev/null
if [[ "$?" == "0" ]]; then
echo "$p2r нужен пользователю";
can_remove=false
break;
fi
done
if [[ "$can_remove" == "true" ]]; then
if [[ "`dpkg-query -W -f='${Priority}\n' $p`" == "optional" ]]; then
echo "$p нужен пользователю"
else
echo "delunpack3.sh: Удаляем пакет $p"
echo "$p" >>1.txt #
#apt-get -y remove --purge $p
fi
fi
dpkg --configure -a
done

View File

@ -0,0 +1,149 @@
acpi
acpid
adduser
apt
apt-utils
aptitude
base-files
base-passwd
bash
bsdmainutils
bsdutils
busybox
console-common
console-cyrillic
console-data
console-terminus
console-tools
coreutils
cpio
cpufreq
cpufreqd
cron
debconf
debconf-i18n
debian-archive-keyring
debianutils
dictionaries-common
diff
dmidecode
dpkg
e2fslibs
e2fsprogs
eject
findutils
gcc-4.1-base
gnupg
gpgv
grep
groff-base
grub
gzip
hostname
ifupdown
initramfs-tools
initscripts
iptables
iputils-ping
irussian
ispell
klibc-utils
klogd
konwert
konwert-filters
language-env
laptop-detect
less
libacl1
libattr1
libblkid1
libbz2-1.0
libc6
libc6-i686
libcap1
libcomerr2
libconsole
libdb4.2
libdb4.3
libdb4.4
libdevmapper1.02
libgcc1
libgcrypt11
libgdbm3
libglib2.0-0
libgnutls13
libgpg-error0
libklibc
libldap2
liblocale-gettext-perl
liblzo1
libncurses5
libncursesw5
libnewt0.52
libopencdk8
libpam-modules
libpam-runtime
libpam0g
libpopt0
libreadline5
libsasl2-2
libselinux1
libsepol1
libsigc++-2.0-0c2a
libslang2
libss2
libssl0.9.8
libstdc++6
libtasn1-3
libtext-charwidth-perl
libtext-iconv-perl
libtext-wrapi18n-perl
libusb-0.1-4
libuuid1
libvolume-id0
libwrap0
locales
login
logrotate
lsb-base
makedev
man-db
manpages
manpages-ru
mawk
mc
mktemp
module-init-tools
mount
myspell-ru
ncurses-base
ncurses-bin
net-tools
netbase
netcat
openbsd-inetd
passwd
perl
perl-base
perl-modules
procps
re
readline-common
sed
sysklogd
sysv-rc
sysvinit
sysvinit-utils
tar
tasksel
tasksel-data
tcpd
traceroute
tzdata
udev
update-inetd
usbutils
util-linux
wget
whiptail
zlib1g

View File

@ -0,0 +1,39 @@
bash
bsdmainutils
bsdutils
cron
dash
debian-multimedia-keyring
e2fslibs
e2fsprogs
grep
groff-base
hostname
ifupdown
install-info
iproute
iptables
iputils-ping
klogd
libacl1
libattr1
libbz2-1.0
libdb4.7
libgdbm3
liblocale-gettext-perl
libss2
libstdc++6
libtext-charwidth-perl
libtext-iconv-perl
libtext-wrapi18n-perl
login
logrotate
lsof
man-db
net-tools
perl-modules
sysklogd
sysvinit
tcpd
traceroute
wget

View File

@ -0,0 +1,124 @@
----- Базовая система -----
sudo
gdm
gsynaptics
xf86-video-ati
acpi
acpi-support
cpufreqd
cpufrequtils
laptop-mode-tools
---- Администрирование ----
synaptic
localepurge
debfoster
------- Утилиты -----------
bzip2
-------- Сервер -----------
iptables
samba
smbfs
ssh
-------- Ключи проп. ------
debian-backports-keyring
debian-multimedia-keyring
------ Рабочий стол -------
xserver-xorg
xserver-xorg-input-kbd
xserver-xorg-input-mouse
metacity
gnome-power-manager
xscreensaver
xscreensaver-gl
gnome-applets
gnome-bin
gnome-system-monitor
gnome-menus
gnome-themes
nautilus-open-terminal
yelp
gedit
gnome-session
eog
gnome-commander
gnome-panel
gnome-terminal
nautilus
gnome-volume-manager
gnome-nettool
file-roller
------ Библиотеки ---------
-- mplayer
-- gedit
------ Разработка ---------
checkinstall
fp-compiler
gcc
make
g++
------ Сборка ядра --------
fakeroot
kernel-package
libncurses5-dev
libc6-dev
------- Приложения --------
d4x
evince
iceweasel-l10n-ru
tilda
gnomeicu
wine
beep-media-player
meld
wvdial
openoffice.org-help-ru
stardict
wget
---------- Игры -----------
nexuiz
csmash
-------- Шрифты -----------
console-data
console-terminus
console-tools
defoma
fontconfig
fontconfig-config
gsfonts
gucharmap
libconsole
libfontconfig1
libfontenc1
libfreetype6
libt1-5
libxfont1
libxft2
t1-cyrillic
t1-teams
ttf-dejavu
ttf-opensymbol
ttf-thryomanes
xfonts-100dpi
xfonts-75dpi
xfonts-base
xfonts-bolkhov-75dpi
xfonts-bolkhov-cp1251-75dpi
xfonts-bolkhov-cp1251-misc
xfonts-bolkhov-koi8r-75dpi
xfonts-bolkhov-koi8r-misc
xfonts-bolkhov-koi8u-75dpi
xfonts-bolkhov-koi8u-misc
xfonts-bolkhov-misc
xfonts-cronyx-100dpi
xfonts-cronyx-cp1251-100dpi
xfonts-cronyx-isocyr-100dpi
xfonts-cronyx-isocyr-75dpi
xfonts-cronyx-isocyr-misc
xfonts-cronyx-koi8r-100dpi
xfonts-cronyx-koi8u-100dpi
xfonts-encodings
xfonts-intl-european
xfonts-scalable
xfonts-utils

View File

@ -0,0 +1,21 @@
----- Базовая система -----
linux-image-2.6.20.21
sudo
gdm
---- Администрирование ----
synaptic
------ Рабочий стол -------
gnome-panel
gnome-terminal
nautilus
gnome-volume-manager
--- Средства разработки ---
gcc
make
------ Сборка ядра --------
fakeroot
kernel-package
libncurses5-dev
libc6-dev
---------- Игры -----------
nexuiz

View File

@ -0,0 +1,4 @@
#!/bin/bash
# Поиск файлов, которые существуют независимо от пакетов
find /etc -exec dpkg-query -S '{}' \;|grep "dpkg:"

43
bash/delunpack/gnome.txt Normal file
View File

@ -0,0 +1,43 @@
gnome-about
gnome-applets
gnome-applets-data
gnome-bin
gnome-cards-data
gnome-commander
gnome-control-center
gnome-core
gnome-desktop-data
gnome-doc-utils
gnome-games
gnome-games-data
gnome-icon-theme
gnome-iconedit
gnome-keyring
gnome-libs-data
gnome-media
gnome-media-common
gnome-menus
gnome-mime-data
gnome-netstatus-applet
gnome-nettool
gnome-panel
gnome-panel-data
gnome-power-manager
gnome-screensaver
gnome-session
gnome-system-monitor
gnome-system-tools
gnome-terminal
gnome-terminal-data
gnome-themes
gnome-themes-extras
gnome-user-guide
gnome-utils
gnome-volume-manager
iceweasel-gnome-support
libgnome-desktop-2
libgnome-keyring0
libgnome-media0
libgnome-menu2
libgnome-pilot2
libgnome-window-settings1

View File

@ -0,0 +1,164 @@
acpi
acpid
adduser
apt
apt-utils
aptitude
base-files
base-passwd
bash
bsdmainutils
bsdutils
busybox
console-common
console-cyrillic
console-data
console-terminus
console-tools
coreutils
cpio
cron
debconf
debconf-i18n
debian-archive-keyring
debianutils
dhcp3-client
dhcp3-common
dictd
dictionaries-common
dictzip
diff
dmidecode
dpkg
dselect
e2fslibs
e2fsprogs
ed
eject
findutils
gcc-4.1-base
gnupg
gpgv
grep
groff-base
grub
gzip
hostname
ifupdown
info
initramfs-tools
initscripts
installation-report
iptables
iputils-ping
irussian
ispell
kernel-image-2.6-amd64-k8
klibc-utils
klogd
konwert
konwert-filters
language-env
laptop-detect
libacl1
libattr1
libblkid1
libbz2-1.0
libc6
libc6-i686
libcap1
libcomerr2
libconsole
libdb4.2
libdb4.3
libdb4.4
libdevmapper1.02
libgcc1
libgcrypt11
libgdbm3
libglib2.0-0
libgnutls13
libgpg-error0
libgpmg1
libklibc
libldap2
liblocale-gettext-perl
liblzo1
libncurses5
libncursesw5
libnewt0.52
libopencdk8
libpam-modules
libpam-runtime
libpam0g
libpopt0
libreadline5
libsasl2
libsasl2-2
libselinux1
libsepol1
libsigc++-2.0-0c2a
libslang2
libss2
libssl0.9.8
libstdc++6
libtasn1-3
libtext-charwidth-perl
libtext-iconv-perl
libtext-wrapi18n-perl
libusb-0.1-4
libuuid1
libvolume-id0
libwrap0
linux-image-2.6-amd64
linux-image-2.6.18-5-amd64
linux-image-2.6.20.21
locales
login
logrotate
lsb-base
makedev
man-db
manpages
manpages-ru
mawk
mc
mktemp
module-init-tools
mount
mueller7-dict
myspell-ru
nano
ncurses-base
ncurses-bin
net-tools
netbase
netcat
openbsd-inetd
passwd
perl
perl-base
perl-modules
procps
re
readline-common
sed
sysklogd
sysv-rc
sysvinit
sysvinit-utils
tar
tasksel
tasksel-data
tcpd
traceroute
tzdata
udev
update-inetd
usbutils
util-linux
vim-common
vim-tiny
wget
whiptail
zlib1g

52
bash/delunpack/margin.sh Normal file
View File

@ -0,0 +1,52 @@
#!/bin/bash
# Вывод всех файлов, от которых не зависят другие файлы (не завистя жёстко).
#deborphan --all-packages --nice-mode --no-show-section
#exit 0
# Список всех установленных пакетов в allpacks
dpkg -l | grep ".i " | cut -d ' ' -f3 | tail -n +8 > allpacks.txt 2>/dev/null
allpacks=`dpkg -l | grep ".i " | cut -d ' ' -f3 | tail -n +8 2>/dev/null`
# Весь список зависимостей. Чтение идёт из allpacks
{
while true; do # для всех пакетов
# Считываем имя пакета
read p
if [ "$p" == "" ]; then break ;fi
# Добавляем в список зависимостей те за-ти, кт. не входят в рекоммендуемые
dep=`dpkg-query -W -f='${Depends}\n' $p`
tmp=", "`dpkg-query -W -f='${Pre-Depends}\n' $a`
if [[ "$tmp" != ", " ]]; then dep=$dep", "$tmp; fi
rec=`dpkg-query -W -f='${Recommends}\n' $p`
while true; do
if [ "$dep" == "" ]; then break; fi
a=${dep##*\ }
dep2=${dep%\ *}
if [ "$dep2" == "$dep" ]; then dep=""; else dep="$dep2"; fi
a=${a%\,};a=${a#\,};a=${a%\|};a=${a#\|}
echo $allpacks| grep -E "\<$a\>" &>/dev/null && echo $rec | grep -v -E "\<$a\>" &>/dev/null
if [ $? == 0 ];then echo $a; fi
done
done
}<allpacks.txt|sort| uniq > alldeps.txt 2>/dev/null
#exit 0
alldeps=`cat alldeps.txt`
# Вывод всех крайних файлов, от которых не зависят другие.
{
while true; do
read a
if [ "$a" == "" ]; then break; fi
echo $alldeps | grep -E "\<$a\>" &>/dev/null
if [ $? == 0 ]; then continue; fi
dpkg-query -W -f='${Priority}' $a| grep -i "important" &>/dev/null
if [ $? == 0 ]; then continue; fi
echo $a
done
} <allpacks.txt
rm -f allpacks.txt
rm -f alldeps.txt

View File

View File

@ -0,0 +1,33 @@
#!/bin/bash
# Данный скрипт необходим для закрепления в системе всех имеющихся на данный момент пакетов.
# Рекоммендуется использовать 1 раз для установки базовой конфигурации.
#
# Например, установил я систему Debian Niaga, удалил ненужный мне софт и поставил всё необходимое.
# После этого запускаем данный скрипт и получаем файл exclude_minimal.lst, наличие которого
# не позволит снести из системы базовые пакеты.
#
# Все остальные пакеты должны быть добавлены вручную в файл exclude_hand.lst,
fname=exclude_base.lst
if [ -e $fname ]; then
echo "Базовая установка была сделана ранее!"
echo "Файл $fname переписан не будет."
exit 1
fi
{
echo "!!! WARNING !!!"
echo " /"
echo " /_"
echo " /"
echo " V"
echo 'DO NOT EDIT MANUALY ! USE mkbaselist.sh'
echo
./margin.sh
} >$fname
echo "Файл $fname создан успешно."
echo "=) OK ! =)"
exit 0

View File

@ -0,0 +1,34 @@
#!/bin/bash
# Данный скрипт необходим для закрепления в системе всех имеющихся на данный момент пакетов.
# Рекоммендуется использовать 1 раз для установки базовой конфигурации.
#
# Например, установил я систему Debian Niaga, удалил ненужный мне софт и поставил всё необходимое.
# После этого запускаем данный скрипт и получаем файл exclude_minimal.lst, наличие которого
# не позволит снести из системы базовые пакеты.
#
# Все остальные пакеты должны быть добавлены вручную в файл exclude_hand.lst,
fname=exclude_base.lst
if [ -e $fname ]; then
echo "Базовая установка была сделана ранее!"
echo "Файл $fname переписан не будет."
exit 1
fi
{
echo "!!! WARNING !!!"
echo " /"
echo " /_"
echo " /"
echo " V"
echo 'DO NOT EDIT MANUALY ! USE mkbaselist.sh'
echo
dpkg -l|grep ii |cut -d ' ' -f3
} >$fname
echo "Файл $fname создан успешно."
echo "=) OK ! =)"
exit 0

16
bash/find/find_bash_function.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
function myFunction() {
echo some command on file $1
}
#~ myFunction aAA
export -f myFunction
find ~/tmp/ -exec bash -c 'myFunction {}' \;
#~ find ~/tmp/ -exec sh -c \
#~ "function MyFunction() { \
#~ echo some command on file \$1; \
#~ }; \
#~ MyFunction {}" \;

View File

@ -0,0 +1,262 @@
/*
* Copyright 1993-2007 NVIDIA Corporation. All rights reserved.
*
* NOTICE TO USER:
*
* This source code is subject to NVIDIA ownership rights under U.S. and
* international Copyright laws. Users and possessors of this source code
* are hereby granted a nonexclusive, royalty-free license to use this code
* in individual and commercial software.
*
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOURCE CODE.
*
* U.S. Government End Users. This source code is a "commercial item" as
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
* "commercial computer software" and "commercial computer software
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
* and is provided to the U.S. Government only as a commercial end item.
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
* source code with only those rights set forth herein.
*
* Any use of this source code in individual and commercial software must
* include, in the user documentation and internal comments to the code,
* the above Disclaimer and U.S. Government End Users Notice.
*/
#include <stdio.h>
#include <stdlib.h>
#include "fluidsGL_kernels.h"
// Texture reference for reading velocity field
texture<float2, 2> texref;
static cudaArray *array = NULL;
void setupTexture(int x, int y) {
// Wrap mode appears to be the new default
texref.filterMode = cudaFilterModeLinear;
cudaChannelFormatDesc desc = cudaCreateChannelDesc<float2>();
cudaMallocArray(&array, &desc, y, x);
cutilCheckMsg("cudaMalloc failed");
}
void bindTexture(void) {
cudaBindTextureToArray(texref, array);
cutilCheckMsg("cudaBindTexture failed");
}
void unbindTexture(void) {
cudaUnbindTexture(texref);
cutilCheckMsg("cudaUnbindTexture failed");
}
void updateTexture(cData *data, size_t wib, size_t h, size_t pitch) {
cudaMemcpy2DToArray(array, 0, 0, data, pitch, wib, h, cudaMemcpyDeviceToDevice);
cutilCheckMsg("cudaMemcpy failed");
}
void deleteTexture(void) {
cudaFreeArray(array);
cutilCheckMsg("cudaFreeArray failed");
}
// Note that these kernels are designed to work with arbitrary
// domain sizes, not just domains that are multiples of the tile
// size. Therefore, we have extra code that checks to make sure
// a given thread location falls within the domain boundaries in
// both X and Y. Also, the domain is covered by looping over
// multiple elements in the Y direction, while there is a one-to-one
// mapping between threads in X and the tile size in X.
// Nolan Goodnight 9/22/06
// This method adds constant force vectors to the velocity field
// stored in 'v' according to v(x,t+1) = v(x,t) + dt * f.
__global__ void
addForces_k(cData *v, int dx, int dy, int spx, int spy, float fx, float fy, int r, size_t pitch) {
int tx = threadIdx.x;
int ty = threadIdx.y;
cData *fj = (cData*)((char*)v + (ty + spy) * pitch) + tx + spx;
cData vterm = *fj;
tx -= r; ty -= r;
float s = 1.f / (1.f + tx*tx*tx*tx + ty*ty*ty*ty);
vterm.x += s * fx;
vterm.y += s * fy;
*fj = vterm;
}
// This method performs the velocity advection step, where we
// trace velocity vectors back in time to update each grid cell.
// That is, v(x,t+1) = v(p(x,-dt),t). Here we perform bilinear
// interpolation in the velocity space.
__global__ void
advectVelocity_k(cData *v, float *vx, float *vy,
int dx, int pdx, int dy, float dt, int lb) {
int gtidx = blockIdx.x * blockDim.x + threadIdx.x;
int gtidy = blockIdx.y * (lb * blockDim.y) + threadIdx.y * lb;
int p;
cData vterm, ploc;
float vxterm, vyterm;
// gtidx is the domain location in x for this thread
if (gtidx < dx) {
for (p = 0; p < lb; p++) {
// fi is the domain location in y for this thread
int fi = gtidy + p;
if (fi < dy) {
int fj = fi * pdx + gtidx;
vterm = tex2D(texref, (float)gtidx, (float)fi);
ploc.x = (gtidx + 0.5f) - (dt * vterm.x * dx);
ploc.y = (fi + 0.5f) - (dt * vterm.y * dy);
vterm = tex2D(texref, ploc.x, ploc.y);
vxterm = vterm.x; vyterm = vterm.y;
vx[fj] = vxterm;
vy[fj] = vyterm;
}
}
}
}
// This method performs velocity diffusion and forces mass conservation
// in the frequency domain. The inputs 'vx' and 'vy' are complex-valued
// arrays holding the Fourier coefficients of the velocity field in
// X and Y. Diffusion in this space takes a simple form described as:
// v(k,t) = v(k,t) / (1 + visc * dt * k^2), where visc is the viscosity,
// and k is the wavenumber. The projection step forces the Fourier
// velocity vectors to be orthogonal to the vectors for each
// wavenumber: v(k,t) = v(k,t) - ((k dot v(k,t) * k) / k^2.
__global__ void
diffuseProject_k(cData *vx, cData *vy, int dx, int dy, float dt,
float visc, int lb) {
int gtidx = blockIdx.x * blockDim.x + threadIdx.x;
int gtidy = blockIdx.y * (lb * blockDim.y) + threadIdx.y * lb;
int p;
cData xterm, yterm;
// gtidx is the domain location in x for this thread
if (gtidx < dx) {
for (p = 0; p < lb; p++) {
// fi is the domain location in y for this thread
int fi = gtidy + p;
if (fi < dy) {
int fj = fi * dx + gtidx;
xterm = vx[fj];
yterm = vy[fj];
// Compute the index of the wavenumber based on the
// data order produced by a standard NN FFT.
int iix = gtidx;
int iiy = (fi>dy/2)?(fi-(dy)):fi;
// Velocity diffusion
float kk = (float)(iix * iix + iiy * iiy); // k^2
float diff = 1.f / (1.f + visc * dt * kk);
xterm.x *= diff; xterm.y *= diff;
yterm.x *= diff; yterm.y *= diff;
// Velocity projection
if (kk > 0.f) {
float rkk = 1.f / kk;
// Real portion of velocity projection
float rkp = (iix * xterm.x + iiy * yterm.x);
// Imaginary portion of velocity projection
float ikp = (iix * xterm.y + iiy * yterm.y);
xterm.x -= rkk * rkp * iix;
xterm.y -= rkk * ikp * iix;
yterm.x -= rkk * rkp * iiy;
yterm.y -= rkk * ikp * iiy;
}
vx[fj] = xterm;
vy[fj] = yterm;
}
}
}
}
// This method updates the velocity field 'v' using the two complex
// arrays from the previous step: 'vx' and 'vy'. Here we scale the
// real components by 1/(dx*dy) to account for an unnormalized FFT.
__global__ void
updateVelocity_k(cData *v, float *vx, float *vy,
int dx, int pdx, int dy, int lb, size_t pitch) {
int gtidx = blockIdx.x * blockDim.x + threadIdx.x;
int gtidy = blockIdx.y * (lb * blockDim.y) + threadIdx.y * lb;
int p;
float vxterm, vyterm;
cData nvterm;
// gtidx is the domain location in x for this thread
if (gtidx < dx) {
for (p = 0; p < lb; p++) {
// fi is the domain location in y for this thread
int fi = gtidy + p;
if (fi < dy) {
int fjr = fi * pdx + gtidx;
vxterm = vx[fjr];
vyterm = vy[fjr];
// Normalize the result of the inverse FFT
float scale = 1.f / (dx * dy);
nvterm.x = vxterm * scale;
nvterm.y = vyterm * scale;
cData *fj = (cData*)((char*)v + fi * pitch) + gtidx;
*fj = nvterm;
}
} // If this thread is inside the domain in Y
} // If this thread is inside the domain in X
}
// This method updates the particles by moving particle positions
// according to the velocity field and time step. That is, for each
// particle: p(t+1) = p(t) + dt * v(p(t)).
__global__ void
advectParticles_k(cData *part, cData *v, int dx, int dy,
float dt, int lb, size_t pitch) {
int gtidx = blockIdx.x * blockDim.x + threadIdx.x;
int gtidy = blockIdx.y * (lb * blockDim.y) + threadIdx.y * lb;
int p;
// gtidx is the domain location in x for this thread
cData pterm, vterm;
if (gtidx < dx) {
for (p = 0; p < lb; p++) {
// fi is the domain location in y for this thread
int fi = gtidy + p;
if (fi < dy) {
int fj = fi * dx + gtidx;
pterm = part[fj];
int xvi = ((int)(pterm.x * dx));
int yvi = ((int)(pterm.y * dy));
vterm = *((cData*)((char*)v + yvi * pitch) + xvi);
pterm.x += dt * vterm.x;
pterm.x = pterm.x - (int)pterm.x;
pterm.x += 1.f;
pterm.x = pterm.x - (int)pterm.x;
pterm.y += dt * vterm.y;
pterm.y = pterm.y - (int)pterm.y;
pterm.y += 1.f;
pterm.y = pterm.y - (int)pterm.y;
part[fj] = pterm;
}
} // If this thread is inside the domain in Y
} // If this thread is inside the domain in X
}

View File

@ -0,0 +1,87 @@
/*
* Copyright 1993-2007 NVIDIA Corporation. All rights reserved.
*
* NOTICE TO USER:
*
* This source code is subject to NVIDIA ownership rights under U.S. and
* international Copyright laws. Users and possessors of this source code
* are hereby granted a nonexclusive, royalty-free license to use this code
* in individual and commercial software.
*
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOURCE CODE.
*
* U.S. Government End Users. This source code is a "commercial item" as
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
* "commercial computer software" and "commercial computer software
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
* and is provided to the U.S. Government only as a commercial end item.
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
* source code with only those rights set forth herein.
*
* Any use of this source code in individual and commercial software must
* include, in the user documentation and internal comments to the code,
* the above Disclaimer and U.S. Government End Users Notice.
*/
#ifndef __STABLEFLUIDS_KERNELS_H_
#define __STABLEFLUIDS_KERNELS_H_
// Vector data type used to velocity and force fields
typedef float2 cData;
void setupTexture(int x, int y);
void bindTexture(void);
void unbindTexture(void);
void updateTexture(cData *data, size_t w, size_t h, size_t pitch);
void deleteTexture(void);
// This method adds constant force vectors to the velocity field
// stored in 'v' according to v(x,t+1) = v(x,t) + dt * f.
__global__ void
addForces_k(cData *v, int dx, int dy, int spx, int spy, float fx, float fy, int r, size_t pitch);
// This method performs the velocity advection step, where we
// trace velocity vectors back in time to update each grid cell.
// That is, v(x,t+1) = v(p(x,-dt),t). Here we perform bilinear
// interpolation in the velocity space.
__global__ void
advectVelocity_k(cData *v, float *vx, float *vy,
int dx, int pdx, int dy, float dt, int lb);
// This method performs velocity diffusion and forces mass conservation
// in the frequency domain. The inputs 'vx' and 'vy' are complex-valued
// arrays holding the Fourier coefficients of the velocity field in
// X and Y. Diffusion in this space takes a simple form described as:
// v(k,t) = v(k,t) / (1 + visc * dt * k^2), where visc is the viscosity,
// and k is the wavenumber. The projection step forces the Fourier
// velocity vectors to be orthogonal to the wave wave vectors for each
// wavenumber: v(k,t) = v(k,t) - ((k dot v(k,t) * k) / k^2.
__global__ void
diffuseProject_k(cData *vx, cData *vy, int dx, int dy, float dt,
float visc, int lb);
// This method updates the velocity field 'v' using the two complex
// arrays from the previous step: 'vx' and 'vy'. Here we scale the
// real components by 1/(dx*dy) to account for an unnormalized FFT.
__global__ void
updateVelocity_k(cData *v, float *vx, float *vy,
int dx, int pdx, int dy, int lb, size_t pitch);
// This method updates the particles by moving particle positions
// according to the velocity field and time step. That is, for each
// particle: p(t+1) = p(t) + dt * v(p(t)).
__global__ void
advectParticles_k(cData *part, cData *v, int dx, int dy,
float dt, int lb, size_t pitch);
#endif

96
bash/gedit/geditmkrun.sh Normal file
View File

@ -0,0 +1,96 @@
#!/bin/bash
# build source code and run
RelSrcName=${1##[^ ]*/}
# C++ make and run
if [ "`expr match "$1" ".*\(.[Cc][Pp][Pp]$\)"`" != "" ]; then
RelProgName=${RelSrcName%.[Cc][Pp][Pp]}
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Cc][Pp][Pp]}
cd "$DirName"
fi
rm -f "$RelProgName"
g++ "$RelSrcName" -o "$RelProgName" -lglut
echo ---------------- C++ -------------------------
"./$RelProgName"
echo ----------------------------------------------
rm -f "$RelProgName"
# C make and run
elif [ "`expr match "$1" ".*\(.[Cc]$\)"`" != "" ]; then
RelProgName=${RelSrcName%.[Cc]}
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Cc]}
cd "$DirName"
fi
rm -f "$RelProgName"
gcc "$RelSrcName" -o "$RelProgName" -lglut
echo ------------------ C -------------------------
"./$RelProgName"
echo ----------------------------------------------
rm -f "$RelProgName"
# Java make and run
elif [ "`expr match "$1" ".*\(.[Jj][Aa][Vv][Aa]$\)"`" != "" ]; then
RelProgName=${RelSrcName%.[Jj][Aa][Vv][Aa]}
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Jj][Aa][Vv][Aa]}
cd "$DirName"
fi
rm -f "$RelProgName"
javac "$RelSrcName" >/dev/null
echo ---------------- Java ------------------------
java "$RelProgName"
echo ----------------------------------------------
rm -f "$RelProgName"
# Free Pascal make and run
elif [ "`expr match "$1" ".*\(.[Pp][Aa][Ss]$\)"`" != "" ]; then
RelProgName=${RelSrcName%.[Pp][Aa][Ss]}
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Pp][Aa][Ss]}
cd "$DirName"
fi
rm -f "$RelProgName"
fpc "$RelSrcName"
echo ------------ Free Pascal ---------------------
"./$RelProgName"
echo ----------------------------------------------
rm -f "$RelProgName.o"
rm -f "$RelProgName"
# Python
elif [ "`expr match "$1" ".*\(.[Pp][Yy]$\)"`" != "" ];
then
echo --------------- Python -----------------------
/usr/bin/python "$1"
echo ----------------------------------------------
# Perl
elif [ "`expr match "$1" '.*\(.[Pp][Ll]$\)'`" != "" ];
then
echo ---------------- Perl ------------------------
/usr/bin/perl "$1"
echo ----------------------------------------------
# Simple Bash script
elif [ "`expr match "$1" '.*\(.sh$\)'`" != "" ];
then
echo --------------- Bash Script ------------------
/bin/bash "$1"
echo ----------------------------------------------
# CUDA/CUBLAS project
else
echo --------- CUDA/CUBLAS project ----------------
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Cc][Uu]}
cd "$DirName"
fi
make
# RelProgName=${RelSrcName%.cu}
RelProgName=`grep EXECUTABLE Makefile | cut -f2 | cut -d " " -f2`
~/NVIDIA_CUDA_SDK/bin/linux/release/"$RelProgName"
echo ----------------------------------------------
fi

99
bash/gedit/geditxmkrun.sh Normal file
View File

@ -0,0 +1,99 @@
#!/bin/bash
# build source code and run
Term=urxvt
RelSrcName=${1##[^ ]*/}
# C++ make and run
if [ "`expr match "$1" ".*\(.[Cc][Pp][Pp]$\)"`" != "" ]; then
RelProgName=${RelSrcName%.[Cc][Pp][Pp]}
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Cc][Pp][Pp]}
cd "$DirName"
fi
rm -f "$RelProgName"
g++ "$RelSrcName" -o "$RelProgName" -lglut
echo ---------------- C++ -------------------------
#"./$RelProgName"
$Term -e sh -c "./$RelProgName;read"
echo ----------------------------------------------
rm -f "$RelProgName"
# C make and run
elif [ "`expr match "$1" ".*\(.[Cc]$\)"`" != "" ]; then
RelProgName=${RelSrcName%.[Cc]}
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Cc]}
cd "$DirName"
fi
rm -f "$RelProgName"
gcc "$RelSrcName" -o "$RelProgName" -lglut
echo ------------------ C -------------------------
$Term -e sh -c "./$RelProgName;read"
echo ----------------------------------------------
rm -f "$RelProgName"
# Java make and run
elif [ "`expr match "$1" ".*\(.[Jj][Aa][Vv][Aa]$\)"`" != "" ]; then
RelProgName=${RelSrcName%.[Jj][Aa][Vv][Aa]}
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Jj][Aa][Vv][Aa]}
cd "$DirName"
fi
rm -f "$RelProgName"
javac "$RelSrcName" >/dev/null
echo ---------------- Java ------------------------
$Term -e sh -c "java ./$RelProgName;read"
echo ----------------------------------------------
rm -f "$RelProgName"
# Free Pascal make and run
elif [ "`expr match "$1" ".*\(.[Pp][Aa][Ss]$\)"`" != "" ]; then
RelProgName=${RelSrcName%.[Pp][Aa][Ss]}
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Pp][Aa][Ss]}
cd "$DirName"
fi
rm -f "$RelProgName"
fpc "$RelSrcName"
echo ------------ Free Pascal ---------------------
$Term -e sh -c "./$RelProgName;read"
echo ----------------------------------------------
rm -f "$RelProgName.o"
rm -f "$RelProgName"
# Python
elif [ "`expr match "$1" ".*\(.[Pp][Yy]$\)"`" != "" ];
then
echo --------------- Python -----------------------
/usr/bin/python "$1"
echo ----------------------------------------------
# Perl
elif [ "`expr match "$1" '.*\(.[Pp][Ll]$\)'`" != "" ];
then
echo ---------------- Perl ------------------------
$Term -e sh -c "perl "$1";read"
echo ----------------------------------------------
# Simple Bash script
elif [ "`expr match "$1" '.*\(.sh$\)'`" != "" ];
then
echo --------------- Bash Script ------------------
$Term -e sh -c "bash "$1";read"
echo ----------------------------------------------
# CUDA/CUBLAS project
else
echo --------- CUDA/CUBLAS project ----------------
if [ "`echo $1| grep /`" != "" ]; then
DirName=${1%/*.[Cc][Uu]}
cd "$DirName"
fi
make
# RelProgName=${RelSrcName%.cu}
RelProgName=`grep EXECUTABLE Makefile | cut -f2 | cut -d " " -f2`
$Term -e sh -c "~/NVIDIA_CUDA_SDK/bin/linux/release/$RelProgName"
echo ----------------------------------------------
fi

7
bash/gedit/hello.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
int main(int argc, char * argv[]) {
printf("Hello, C-coder!\n");
return 0;
}

BIN
bash/gedit/hello.class Normal file

Binary file not shown.

6
bash/gedit/hello.java Normal file
View File

@ -0,0 +1,6 @@
import java.util.*;
public class hello {
public static void main(String[] args) {
System.out.print("Hello, world!");
}
}

4
bash/gedit/hello.pas Normal file
View File

@ -0,0 +1,4 @@
begin
WriteLn('Hello, Free Pascal!');
end.

3
bash/gedit/hello.pl Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/perl
print "Hello, Perl \n"

4
bash/gedit/hello.py Normal file
View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
print 10*'=', " Hello, Python! ", 10*'='

3
bash/gedit/hello.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "Hello, Bash!"

152
bash/gedit/molecule.cpp Normal file
View File

@ -0,0 +1,152 @@
#include <stdlib.h>
/* подключаем библиотеку GLUT */
#include <GL/glut.h>
/* начальная ширина и высота окна */
GLint Width = 512, Height = 512;
/* размер куба */
const int CubeSize = 200;
/* эта функция управляет всем выводом на экран */
void Display(void)
{
int left, right, top, bottom;
left = (Width - CubeSize) / 2;
right = left + CubeSize;
bottom = (Height - CubeSize) / 2;
top = bottom + CubeSize;
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
glColor3ub(255,0,0);
glBegin(GL_QUADS);
glVertex2f(left,bottom);
glVertex2f(left,top);
glVertex2f(right,top);
glVertex2f(right,bottom);
glEnd();
glFinish();
}
/* Функция вызывается при изменении размеров окна */
void Reshape(GLint w, GLint h)
{
Width = w;
Height = h;
/* устанавливаем размеры области отображения */
glViewport(0, 0, w, h);
/* ортографическая проекция */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, w, 0, h, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
/* Функция обрабатывает сообщения от клавиатуры */
void
Keyboard( unsigned char key, int x, int y )
{
#define ESCAPE '\033'
if( key == ESCAPE )
exit(0);
}
/* Главный цикл приложения */
main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB);
glutInitWindowSize(Width, Height);
glutCreateWindow("Red square example");
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Keyboard);
glutMainLoop();
}

8
bash/gprs/3Gconnect.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# Запуск автоматического переподключения
killall reconnect.sh
sleep .2
(/home/kolan/bin/reconnect.sh "$1" >/dev/null 2>&1)&
exit 0 # По идее, здесь интерпретатор оказаться не должен

10
bash/gprs/3Gdisconnect.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Разъединение reconnect и wvdial
killall reconnect.sh
killall wvdial
sleep .5
killall -9 reconnect.sh
killall -9 wvdial
exit 0

91
bash/gprs/3Gmake_bug.sh Normal file
View File

@ -0,0 +1,91 @@
#!/bin/sh
# Автоматическое переподключение GPRS в случае обрыва
#killall reconnect.sh
MaxRetryNumber=500000 # Максимальное число переподключений подряд (5-10-нормально)
RingTime=15 # Время(сек), необходимое для дозвона до провайдера
PingDeadLine=0 # Время ожидания пакета при пинге сервера
PingInterval=0 # Интервал между посылкой пакетов при пинге сервера
PingCount=5 # Число пакетов, кт. требуется посылать при пинге
# расположение скрипта для wvdial
wvscript="$1"
if [[ "$wvscript" == "" ]]; then
wvscript=/home/kolan/etc/mobile1;
fi
if [ ! -e "$wvscript" ]; then
echo "Не найден файл $wvscript с правилами дозвона !"
exit 1
fi
modem=/home/kolan/.mobile_modem
NumberOfServers=1 # Число серверов, которые будем пинговать
ping_server[1]=beeline.ru
ping_server[2]=83.149.19.126 # Megafon DNS server 1
ping_server[3]=83.149.22.14 # Megafon DNS server 2
ping_server[4]=ya.ru
let retryNumber=$MaxRetryNumber # В пассивном режиме сбрасывается ограничение на частоту переподключений
# Функция создаёт новый процесс связи wvdial, если таковых в системе не обнаружено
function RedialIfNoWvdial {
let nOfWvdialProcs=`ps aux|grep wvdial|wc -l` # определяем - есть ли подключения (0-нет/1-есть одно)
while [[ "$nOfWvdialProcs" == "0" && $retryNumber > 0 ]]; do # пока соединения нет и не достигнуто макс. число переподключений подряд
echo "Подключения GPRS не обнаружены. Выполняем подключение. Осталось попыток: $retryNumber"
# Определяем номер устройства /dev/ttyUSB* и создаём ссылку на него
rm -f $modem;sleep 0.1;ln -s `ls /dev/ttyUSB*` $modem
(wvdial --config=$wvscript >/dev/null 2>&1)& # создаём процесс с новым подключением
echo "Ждём $RingTime секунд пока выполняется подключение"
sleep $RingTime
ps aux|grep wvdial
let nOfWvdialProcs=`ps aux|grep wvdial|wc -l` # проверяем - есть ли подключение заново
let retryNumber--
done
if [[ "$nOfWvdialProcs" != "0" ]]; then
echo "Соединение успешно установлено"
else
echo "Все попытки дозвониться до провайдера оказались тщетными !"
echo "Возможными причинами могут быть: неисправность соединения,"
echo "выключенный телефон, перегруженный провайдер,"
echo "ошибка в скрипте wvdial: $wvscript"
echo "Попробуйте исправить ошибки или подождать некоторое время,"
echo "после чего перезапустите скрипт снова... Выходим !"
exit 0
fi
}
while true; do # Выполняем пока не случилось страшного чего-нибудь
RedialIfNoWvdial # Выполнение соединения, если оно не установлено
PingResult=false
for server in `seq $NumberOfServers`; do
echo "Пингуется ${ping_server[$server]}..."
ping -w $PingDeadLine -i $PingInterval -c $PingCount ${ping_server[$server]} >/dev/null 2>&1
if [[ "$?" == "0" ]]; then
echo "Пинг успешен, остальные серверы пинговать не будем."
let retryNumber=$MaxRetryNumber # В пассивном режиме сбрасывается ограничение на частоту переподключений
PingResult=true; # Один из серверов был "пропингован" => соединение есть
let sleep_time=($NumberOfServers-$server)*$PingDeadLine
sleep $sleep_time
break
fi
done
if [[ $PingResult == false ]]; then
echo "Пинг не дошёл ни до одного из серверов, выполняем переподключение"
echo "Разрываем все соединения pppd и wvdial"
# killall pppd >/dev/null 2>&1
killall wvdial >/dev/null 2>&1
# killall -9 -r pppd >/dev/null 2>&1
# killall -9 -r wvdial >/dev/null 2>&1
sleep 1
fi
done
exit 0 # По идее, здесь интерпретатор оказаться не должен

91
bash/gprs/3Greconnect.sh Normal file
View File

@ -0,0 +1,91 @@
#!/bin/sh
# Автоматическое переподключение GPRS в случае обрыва
#killall reconnect.sh
MaxRetryNumber=50000 # Максимальное число переподключений подряд (5-10-нормально)
RingTime=15 # Время(сек), необходимое для дозвона до провайдера
PingDeadLine=20 # Время ожидания пакета при пинге сервера
PingInterval=40 # Интервал между посылкой пакетов при пинге сервера
PingCount=1 # Число пакетов, кт. требуется посылать при пинге
# расположение скрипта для wvdial
wvscript="$1"
if [[ "$wvscript" == "" ]]; then
wvscript=/home/kolan/etc/megafon1;
fi
if [ ! -e "$wvscript" ]; then
echo "Не найден файл $wvscript с правилами дозвона !"
exit 1
fi
modem=/home/kolan/.mobile_modem
NumberOfServers=4 # Число серверов, которые будем пинговать
ping_server[1]=83.149.19.126 # Megafon DNS server 1
ping_server[2]=83.149.22.14 # Megafon DNS server 2
ping_server[3]=ya.ru
ping_server[4]=beeline.ru
let retryNumber=$MaxRetryNumber # В пассивном режиме сбрасывается ограничение на частоту переподключений
# Функция создаёт новый процесс связи wvdial, если таковых в системе не обнаружено
function RedialIfNoWvdial {
let nOfWvdialProcs=`ps aux|grep wvdial|wc -l` # определяем - есть ли подключения (0-нет/1-есть одно)
while [[ "$nOfWvdialProcs" == "0" && $retryNumber > 0 ]]; do # пока соединения нет и не достигнуто макс. число переподключений подряд
echo "Подключения GPRS не обнаружены. Выполняем подключение. Осталось попыток: $retryNumber"
# Определяем номер устройства /dev/ttyUSB* и создаём ссылку на него
rm -f $modem;sleep 0.1;ln -s `ls /dev/ttyUSB*` $modem
(wvdial --config=$wvscript >/dev/null 2>&1)& # создаём процесс с новым подключением
echo "Ждём $RingTime секунд пока выполняется подключение"
sleep $RingTime
ps aux|grep wvdial
let nOfWvdialProcs=`ps aux|grep wvdial|wc -l` # проверяем - есть ли подключение заново
let retryNumber--
done
if [[ "$nOfWvdialProcs" != "0" ]]; then
echo "Соединение успешно установлено"
else
echo "Все попытки дозвониться до провайдера оказались тщетными !"
echo "Возможными причинами могут быть: неисправность соединения,"
echo "выключенный телефон, перегруженный провайдер,"
echo "ошибка в скрипте wvdial: $wvscript"
echo "Попробуйте исправить ошибки или подождать некоторое время,"
echo "после чего перезапустите скрипт снова... Выходим !"
exit 0
fi
}
while true; do # Выполняем пока не случилось страшного чего-нибудь
RedialIfNoWvdial # Выполнение соединения, если оно не установлено
PingResult=false
for server in `seq $NumberOfServers`; do
echo "Пингуется ${ping_server[$server]}..."
ping -w $PingDeadLine -i $PingInterval -c $PingCount ${ping_server[$server]} >/dev/null 2>&1
if [[ "$?" == "0" ]]; then
echo "Пинг успешен, остальные серверы пинговать не будем."
let retryNumber=$MaxRetryNumber # В пассивном режиме сбрасывается ограничение на частоту переподключений
PingResult=true; # Один из серверов был "пропингован" => соединение есть
let sleep_time=($NumberOfServers-$server)*$PingDeadLine
sleep $sleep_time
break
fi
done
if [[ $PingResult == false ]]; then
echo "Пинг не дошёл ни до одного из серверов, выполняем переподключение"
echo "Разрываем все соединения pppd и wvdial"
# killall pppd >/dev/null 2>&1
killall wvdial >/dev/null 2>&1
# killall -9 -r pppd >/dev/null 2>&1
# killall -9 -r wvdial >/dev/null 2>&1
sleep 1
fi
done
exit 0 # По идее, здесь интерпретатор оказаться не должен

10
bash/kernel/delMods.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
allneedmodnames=`lsmod | tail -n +2 | cut -d ' ' -f1`
allneedfnames=`for m in \`echo $allneedmodnames\` ; do /sbin/modinfo -F filename $m ; done`
for file in `find /lib/modules/\`uname -r\`/kernel/sound | grep "\.ko"` ; do
if [[ ! `echo $allneedfnames | grep $file 2>/dev/null` ]] ; then
rm -f $file
fi
done

19
bash/kernel/kernac.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
# Автоматический конфигуратор ядра
# 1. Путь к исходным текстам ядра
KERNEL_SRC_PATH=/usr/src/linux
# 2. pDir pDirOut
pDir=`pwd`
pDirOut="$pDir"/kernel_out
if [ ! -e "$pDirOut" ]; then mkdir "$pDirOut" ; fi
# 3. Конфиг .config "всё модулями"
cd "$KERNEL_SRC_PATH"
make O="$pDirOut" allmodconfig
# 4. Собираем все Makefile-ы в один Mak.tmp
find -name "Makefile" -exec cat '{}' >> "$pDir"/Mak.tmp \;

55
bash/kernel/lsmod.txt Normal file
View File

@ -0,0 +1,55 @@
Module Size Used by
ipv6 228320 10
ppdev 8964 0
parport_pc 32612 0
lp 11300 0
parport 33672 3 ppdev,parport_pc,lp
button 6928 0
ac 5508 0
battery 9924 0
fuse 40404 3
dm_snapshot 15904 0
dm_mirror 19600 0
dm_mod 50776 2 dm_snapshot,dm_mirror
loop 15496 0
snd_ca0106 29796 0
snd_seq_dummy 4164 0
snd_seq_oss 29120 0
snd_seq_midi 8544 0
snd_seq_midi_event 7488 2 snd_seq_oss,snd_seq_midi
snd_seq 46224 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_rawmidi 23200 2 snd_ca0106,snd_seq_midi
snd_seq_device 8140 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq,snd_rawmidi
snd_ac97_codec 83360 1 snd_ca0106
snd_pcm_oss 39200 0
snd_mixer_oss 15552 1 snd_pcm_oss
snd_pcm 68996 3 snd_ca0106,snd_ac97_codec,snd_pcm_oss
snd_timer 21316 2 snd_seq,snd_pcm
snd 47524 10 snd_ca0106,snd_seq_oss,snd_seq,snd_rawmidi,snd_seq_device,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
tsdev 7808 0
soundcore 9568 1 snd
snd_ac97_bus 2688 1 snd_ac97_codec
rtc 12788 0
usbhid 37856 0
pl2303 18436 0
usbserial 29608 1 pl2303
psmouse 35336 0
serio_raw 6980 0
pcspkr 3392 0
snd_page_alloc 9928 2 snd_ca0106,snd_pcm
evdev 9408 1
ext3 120584 1
jbd 52968 1 ext3
mbcache 8644 1 ext3
sd_mod 19456 4
sata_nv 11332 3
libata 90772 1 sata_nv
scsi_mod 124872 2 sd_mod,libata
generic 5188 0 [permanent]
ide_core 110984 1 generic
ehci_hcd 28488 0
ohci_hcd 18564 0
usbcore 113412 6 usbhid,pl2303,usbserial,ehci_hcd,ohci_hcd
thermal 13896 0
processor 29128 1 thermal
fan 5124 0

View File

@ -0,0 +1,55 @@
Module
ipv6
ppdev
parport_pc
lp
parport
button
ac
battery
fuse
dm_snapshot
dm_mirror
dm_mod
loop
snd_ca0106
snd_seq_dummy
snd_seq_oss
snd_seq_midi
snd_seq_midi_event
snd_seq
snd_rawmidi
snd_seq_device
snd_ac97_codec
snd_pcm_oss
snd_mixer_oss
snd_pcm
snd_timer
snd
tsdev
soundcore
snd_ac97_bus
rtc
usbhid
pl2303
usbserial
psmouse
serio_raw
pcspkr
snd_page_alloc
evdev
ext3
jbd
mbcache
sd_mod
sata_nv
libata
scsi_mod
generic
ide_core
ehci_hcd
ohci_hcd
usbcore
thermal
processor
fan

View File

@ -0,0 +1,547 @@
filename: /lib/modules/2.6.18-5-k7/kernel/net/ipv6/ipv6.ko
author: Cast of dozens
description: IPv6 protocol stack for Linux
license: GPL
alias: net-pf-10
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/char/ppdev.ko
license: GPL
alias: char-major-99-*
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: parport
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/parport/parport_pc.ko
author: Phil Blundell, Tim Waugh, others
description: PC-style parallel port driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: parport
alias: pci:v00001106d00000686sv*sd*bc*sc*i*
alias: pci:v00001106d00008231sv*sd*bc*sc*i*
alias: pci:v00001283d00008872sv*sd*bc*sc*i*
alias: pci:v0000131Fd00001020sv*sd*bc*sc*i*
alias: pci:v0000131Fd00001021sv*sd*bc*sc*i*
alias: pci:v0000131Fd00002020sv*sd*bc*sc*i*
alias: pci:v0000131Fd00002021sv*sd*bc*sc*i*
alias: pci:v00001407d00008000sv*sd*bc*sc*i*
alias: pci:v00001407d00008002sv*sd*bc*sc*i*
alias: pci:v00001407d00008003sv*sd*bc*sc*i*
alias: pci:v00001407d00008800sv*sd*bc*sc*i*
alias: pci:v000010B5d00009050sv0000D84Dsd00004014bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00004078bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00004079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00004085bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00004088bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00004089bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00004095bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00004096bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00005078bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00005079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00005085bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00006079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00007079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00008079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd00009079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd0000A079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd0000B079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd0000C079bc*sc*i*
alias: pci:v00001409d00007168sv00001409sd0000D079bc*sc*i*
alias: pci:v00001409d00007268sv00001409sd00000101bc*sc*i*
alias: pci:v00001409d00007268sv00001409sd00000102bc*sc*i*
alias: pci:v00001409d00007268sv00001409sd00000103bc*sc*i*
alias: pci:v00001409d00007268sv00001409sd00000104bc*sc*i*
alias: pci:v00001409d00007268sv00001409sd00009018bc*sc*i*
alias: pci:v000014F2d00000121sv*sd*bc*sc*i*
alias: pci:v00001592d00000782sv*sd*bc*sc*i*
alias: pci:v00001592d00000783sv*sd*bc*sc*i*
alias: pci:v000014D2d00008001sv*sd*bc*sc*i*
alias: pci:v00009710d00009805sv00001000sd00000010bc*sc*i*
alias: pci:v00009710d00009815sv00001000sd00000020bc*sc*i*
alias: pci:v000014DBd00002120sv*sd*bc*sc*i*
alias: pci:v000014DBd00002121sv*sd*bc*sc*i*
alias: pci:v00001415d00009513sv*sd*bc*sc*i*
alias: pci:v00001415d00008403sv*sd*bc*sc*i*
alias: pci:v0000416Cd00000100sv*sd*bc*sc*i*
alias: pci:v00009710d00009705sv*sd*bc*sc*i*
alias: pci:v00009710d00009715sv*sd*bc*sc*i*
alias: pci:v00009710d00009755sv*sd*bc*sc*i*
alias: pci:v00009710d00009805sv*sd*bc*sc*i*
alias: pci:v00009710d00009815sv*sd*bc*sc*i*
alias: pnp:dPNP0400*
alias: pnp:dPNP0401*
parm: init_mode:Initialise mode for VIA VT8231 port (spp, ps2, epp, ecp or ecpepp) (charp)
parm: verbose_probing:Log chit-chat during initialisation (int)
parm: dma:DMA channel (array of charp)
parm: irq:IRQ line (array of charp)
parm: io_hi:Base I/O address (ECR) (array of int)
parm: io:Base I/O address (SPP regs) (array of int)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/char/lp.ko
alias: char-major-6-*
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: parport
parm: reset:bool
parm: parport:array of charp
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/parport/parport.ko
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/acpi/button.ko
author: Paul Diefenbaugh
description: ACPI Button Driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/acpi/ac.ko
author: Paul Diefenbaugh
description: ACPI AC Adapter Driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/acpi/battery.ko
author: Paul Diefenbaugh
description: ACPI Battery Driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/fs/fuse/fuse.ko
alias: char-major-10-229
author: Miklos Szeredi <miklos@szeredi.hu>
description: Filesystem in Userspace
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/md/dm-snapshot.ko
description: device-mapper snapshot target
author: Joe Thornber
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: dm-mod
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/md/dm-mirror.ko
description: device-mapper mirror target
author: Joe Thornber
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: dm-mod
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/md/dm-mod.ko
description: device-mapper driver
author: Joe Thornber <dm-devel@redhat.com>
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
parm: major:The major number of the device mapper (uint)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/block/loop.ko
license: GPL
alias: block-major-7-*
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
parm: max_loop:Maximum number of loop devices (1-256) (int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/pci/ca0106/snd-ca0106.ko
author: James Courtier-Dutton <James@superbug.demon.co.uk>
description: CA0106
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd,snd-pcm,snd-page-alloc,snd-rawmidi,snd-ac97-codec
alias: pci:v00001102d00000007sv*sd*bc*sc*i*
parm: enable:Enable the CA0106 soundcard. (array of bool)
parm: id:ID string for the CA0106 soundcard. (array of charp)
parm: index:Index value for the CA0106 soundcard. (array of int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/seq/snd-seq-dummy.ko
author: Takashi Iwai <tiwai@suse.de>
description: ALSA sequencer MIDI-through client
license: GPL
alias: snd-seq-client-14
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd-seq,snd-seq-device
parm: duplex:create DUPLEX ports (bool)
parm: ports:number of ports to be created (int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/seq/oss/snd-seq-oss.ko
author: Takashi Iwai <tiwai@suse.de>
description: OSS-compatible sequencer module
license: GPL
alias: sound-service-?-1
alias: sound-service-?-8
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd,snd-seq,snd-seq-midi-event,snd-seq-device
parm: maxqlen:maximum queue length (int)
parm: seq_oss_debug:debug option (int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/seq/snd-seq-midi.ko
author: Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@suse.cz>
description: Advanced Linux Sound Architecture sequencer MIDI synth.
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd-seq-midi-event,snd-seq,snd-rawmidi,snd-seq-device
parm: input_buffer_size:Input buffer size in bytes. (int)
parm: output_buffer_size:Output buffer size in bytes. (int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/seq/snd-seq-midi-event.ko
author: Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@suse.cz>
description: MIDI byte <-> sequencer event coder
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd-seq
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/seq/snd-seq.ko
author: Frank van de Pol <fvdpol@coil.demon.nl>, Jaroslav Kysela <perex@suse.cz>
description: Advanced Linux Sound Architecture sequencer.
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd,snd-seq-device,snd-timer
parm: seq_default_timer_resolution:The default timer resolution in Hz. (int)
parm: seq_default_timer_subdevice:The default timer subdevice number. (int)
parm: seq_default_timer_device:The default timer device number. (int)
parm: seq_default_timer_card:The default timer card number. (int)
parm: seq_default_timer_sclass:The default timer slave class. (int)
parm: seq_default_timer_class:The default timer class. (int)
parm: seq_client_load:The numbers of global (system) clients to load through kmod. (array of int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/snd-rawmidi.ko
author: Jaroslav Kysela <perex@suse.cz>
description: Midlevel RawMidi code for ALSA.
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd,snd-seq-device
parm: amidi_map:Raw MIDI device number assigned to 2nd OSS device. (array of int)
parm: midi_map:Raw MIDI device number assigned to 1st OSS device. (array of int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/seq/snd-seq-device.ko
author: Takashi Iwai <tiwai@suse.de>
description: ALSA sequencer device management
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd
filename: /lib/modules/2.6.18-5-k7/kernel/sound/pci/ac97/snd-ac97-codec.ko
author: Jaroslav Kysela <perex@suse.cz>
description: Universal interface for Audio Codec '97
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd,snd-ac97-bus,snd-pcm
parm: enable_loopback:Enable AC97 ADC/DAC Loopback Control (bool)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/oss/snd-pcm-oss.ko
author: Jaroslav Kysela <perex@suse.cz>, Abramo Bagnara <abramo@alsa-project.org>
description: PCM OSS emulation for ALSA.
license: GPL
alias: sound-service-?-3
alias: sound-service-?-12
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd-pcm,snd,snd-mixer-oss
parm: nonblock_open:Don't block opening busy PCM devices. (bool)
parm: adsp_map:PCM device number assigned to 2nd OSS device. (array of int)
parm: dsp_map:PCM device number assigned to 1st OSS device. (array of int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/oss/snd-mixer-oss.ko
author: Jaroslav Kysela <perex@suse.cz>
description: Mixer OSS emulation for ALSA.
license: GPL
alias: sound-service-?-0
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/snd-pcm.ko
author: Jaroslav Kysela <perex@suse.cz>, Abramo Bagnara <abramo@alsa-project.org>
description: Midlevel PCM code for ALSA.
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd,snd-page-alloc,snd-timer
parm: maximum_substreams:Maximum substreams with preallocated DMA memory. (int)
parm: preallocate_dma:Preallocate DMA memory when the PCM devices are initialized. (int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/snd-timer.ko
author: Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de>
description: ALSA timer interface
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: snd
parm: timer_limit:Maximum global timers in system. (int)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/snd.ko
author: Jaroslav Kysela <perex@suse.cz>
description: Advanced Linux Sound Architecture driver for soundcards.
license: GPL
alias: char-major-116-*
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: soundcore
parm: cards_limit:Count of auto-loadable soundcards. (int)
parm: major:Major # for sound driver. (int)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/input/tsdev.ko
author: James Simmons <jsimmons@transvirtual.com>
description: Input driver to touchscreen converter
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
alias: input:b*v*p*e*-e*1,*2,*k*110,*r*0,*1,*a*m*l*s*f*w*
alias: input:b*v*p*e*-e*1,*3,*k*14A,*r*a*0,*1,*m*l*s*f*w*
alias: input:b*v*p*e*-e*3,*k*r*a*0,*1,*18,*m*l*s*f*w*
parm: yres:Vertical screen resolution (can be negative for Y-mirror) (uint)
parm: xres:Horizontal screen resolution (can be negative for X-mirror) (uint)
filename: /lib/modules/2.6.18-5-k7/kernel/sound/soundcore.ko
description: Core sound module
author: Alan Cox
license: GPL
alias: char-major-14-*
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/sound/pci/ac97/snd-ac97-bus.ko
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/char/rtc.ko
author: Paul Gortmaker
license: GPL
alias: char-major-10-135
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/usb/input/usbhid.ko
author: Andreas Gal, Vojtech Pavlik
description: USB HID core driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: usbcore
alias: usb:v*p*d*dc*dsc*dp*ic03isc*ip*
parm: pb_fnmode:Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst) (int)
parm: mousepoll:Polling interval of mice (uint)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/usb/serial/pl2303.ko
description: Prolific PL2303 USB to serial adaptor driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: usbserial,usbcore
alias: usb:v067Bp2303d*dc*dsc*dp*ic*isc*ip*
alias: usb:v067Bp04BBd*dc*dsc*dp*ic*isc*ip*
alias: usb:v067Bp1234d*dc*dsc*dp*ic*isc*ip*
alias: usb:v067BpAAA2d*dc*dsc*dp*ic*isc*ip*
alias: usb:v067BpAAA0d*dc*dsc*dp*ic*isc*ip*
alias: usb:v04BBp0A03d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0557p2008d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0547p2008d*dc*dsc*dp*ic*isc*ip*
alias: usb:v056Ep5003d*dc*dsc*dp*ic*isc*ip*
alias: usb:v056Ep5004d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0EBAp1080d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0EBAp2080d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DF7p0620d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0584pB000d*dc*dsc*dp*ic*isc*ip*
alias: usb:v2478p2008d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1453p4026d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0731p0528d*dc*dsc*dp*ic*isc*ip*
alias: usb:v6189p2068d*dc*dsc*dp*ic*isc*ip*
alias: usb:v11F7p02DFd*dc*dsc*dp*ic*isc*ip*
alias: usb:v04E8p8001d*dc*dsc*dp*ic*isc*ip*
alias: usb:v11F5p0001d*dc*dsc*dp*ic*isc*ip*
alias: usb:v11F5p0003d*dc*dsc*dp*ic*isc*ip*
alias: usb:v11F5p0004d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0745p0001d*dc*dsc*dp*ic*isc*ip*
alias: usb:v078Bp1234d*dc*dsc*dp*ic*isc*ip*
alias: usb:v10B5pAC70d*dc*dsc*dp*ic*isc*ip*
alias: usb:v079Bp0027d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0413p2101d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0E55p110Bd*dc*dsc*dp*ic*isc*ip*
alias: usb:v0731p2003d*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp0257d*dc*dsc*dp*ic*isc*ip*
parm: debug:Debug enabled or not (bool)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/usb/serial/usbserial.ko
author: Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/
description: USB Serial Driver core
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: usbcore
parm: product:User specified USB idProduct (ushort)
parm: vendor:User specified USB idVendor (ushort)
parm: debug:Debug enabled or not (bool)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/input/mouse/psmouse.ko
author: Vojtech Pavlik <vojtech@suse.cz>
description: PS/2 mouse driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
alias: serio:ty01pr*id*ex*
alias: serio:ty05pr*id*ex*
parm: resync_time:How long can mouse stay idle before forcing resync (in seconds, 0 = never). (uint)
parm: resetafter:Reset device after so many bad packets (0 = never). (uint)
parm: smartscroll:Logitech Smartscroll autorepeat, 1 = enabled (default), 0 = disabled. (bool)
parm: rate:Report rate, in reports per second. (uint)
parm: resolution:Resolution, in dpi. (uint)
parm: proto:Highest protocol extension to probe (bare, imps, exps, any). Useful for KVM switches. (proto_abbrev)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/input/serio/serio_raw.ko
author: Dmitry Torokhov <dtor@mail.ru>
description: Raw serio driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
alias: serio:ty01pr*id*ex*
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/input/misc/pcspkr.ko
author: Vojtech Pavlik <vojtech@ucw.cz>
description: PC Speaker beeper driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/sound/core/snd-page-alloc.ko
author: Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@suse.cz>
description: Memory allocator for ALSA system.
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/input/evdev.ko
author: Vojtech Pavlik <vojtech@ucw.cz>
description: Input driver event char devices
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
alias: input:b*v*p*e*-e*k*r*a*m*l*s*f*w*
filename: /lib/modules/2.6.18-5-k7/kernel/fs/ext3/ext3.ko
author: Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
description: Second Extended Filesystem with journaling extensions
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: mbcache,jbd
filename: /lib/modules/2.6.18-5-k7/kernel/fs/jbd/jbd.ko
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/fs/mbcache.ko
author: Andreas Gruenbacher <a.gruenbacher@computer.org>
description: Meta block cache (for extended attributes)
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/scsi/sd_mod.ko
author: Eric Youngdale
description: SCSI disk (sd) driver
license: GPL
alias: block-major-8-*
alias: block-major-65-*
alias: block-major-66-*
alias: block-major-67-*
alias: block-major-68-*
alias: block-major-69-*
alias: block-major-70-*
alias: block-major-71-*
alias: block-major-128-*
alias: block-major-129-*
alias: block-major-130-*
alias: block-major-131-*
alias: block-major-132-*
alias: block-major-133-*
alias: block-major-134-*
alias: block-major-135-*
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: scsi_mod
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/scsi/sata_nv.ko
author: NVIDIA
description: low-level driver for NVIDIA nForce SATA controller
license: GPL
version: 2.0
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: libata
alias: pci:v000010DEd0000008Esv*sd*bc*sc*i*
alias: pci:v000010DEd000000E3sv*sd*bc*sc*i*
alias: pci:v000010DEd000000EEsv*sd*bc*sc*i*
alias: pci:v000010DEd00000054sv*sd*bc*sc*i*
alias: pci:v000010DEd00000055sv*sd*bc*sc*i*
alias: pci:v000010DEd00000036sv*sd*bc*sc*i*
alias: pci:v000010DEd0000003Esv*sd*bc*sc*i*
alias: pci:v000010DEd00000266sv*sd*bc*sc*i*
alias: pci:v000010DEd00000267sv*sd*bc*sc*i*
alias: pci:v000010DEd0000037Esv*sd*bc*sc*i*
alias: pci:v000010DEd0000037Fsv*sd*bc*sc*i*
alias: pci:v000010DEd000003E7sv*sd*bc*sc*i*
alias: pci:v000010DEd000003F6sv*sd*bc*sc*i*
alias: pci:v000010DEd000003F7sv*sd*bc*sc*i*
alias: pci:v000010DEd0000045Csv*sd*bc*sc*i*
alias: pci:v000010DEd0000045Dsv*sd*bc*sc*i*
alias: pci:v000010DEd0000045Esv*sd*bc*sc*i*
alias: pci:v000010DEd0000045Fsv*sd*bc*sc*i*
alias: pci:v000010DEd*sv*sd*bc01sc01i*
alias: pci:v000010DEd*sv*sd*bc01sc04i*
srcversion: F9F313BE99523122C3F33B1
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/scsi/libata.ko
author: Jeff Garzik
description: Library module for ATA devices
license: GPL
version: 2.00
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: scsi_mod
srcversion: 26F21185FD60B09940EBE71
parm: ata_probe_timeout:Set ATA probing timeout (seconds) (int)
parm: fua:FUA support (0=off, 1=on) (int)
parm: atapi_dmadir:Enable ATAPI DMADIR bridge support (0=off, 1=on) (int)
parm: atapi_enabled:Enable discovery of ATAPI devices (0=off, 1=on) (int)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/scsi/scsi_mod.ko
description: SCSI core
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
parm: default_dev_flags:scsi default device flag integer value (int)
parm: dev_flags:Given scsi_dev_flags=vendor:model:flags[,v:m:f] add black/white list entries for vendor and model with an integer value of flags to the scsi device info list (string)
parm: inq_timeout:Timeout (in seconds) waiting for devices to answer INQUIRY. Default is 5. Some non-compliant devices need more. (int)
parm: max_report_luns:REPORT LUNS maximum number of LUNS received (should be between 1 and 16384) (int)
parm: max_luns:last scsi LUN (should be between 1 and 2^32-1) (int)
parm: scsi_logging_level:a bit mask of logging levels (int)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/ide/pci/generic.ko
author: Andre Hedrick
description: PCI driver module for generic PCI IDE
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: ide-core
alias: pci:v0000100Bd0000D001sv*sd*bc*sc*i*
alias: pci:v00001042d00003020sv*sd*bc*sc*i*
alias: pci:v00009412d00006565sv*sd*bc*sc*i*
alias: pci:v00001060d00000101sv*sd*bc*sc*i*
alias: pci:v00001060d0000886Asv*sd*bc*sc*i*
alias: pci:v00001060d0000673Asv*sd*bc*sc*i*
alias: pci:v00003388d00008013sv*sd*bc*sc*i*
alias: pci:v00001106d00000561sv*sd*bc*sc*i*
alias: pci:v00001045d0000C558sv*sd*bc*sc*i*
alias: pci:v00001179d00000102sv*sd*bc*sc*i*
alias: pci:v00001179d00000103sv*sd*bc*sc*i*
alias: pci:v00001179d00000105sv*sd*bc*sc*i*
alias: pci:v0000169Cd00000044sv*sd*bc*sc*i*
alias: pci:v*d*sv*sd*bc01sc01i*
parm: all_generic_ide:IDE generic will claim all unknown PCI IDE storage controllers. (bool)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/ide/ide-core.ko
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
parm: options:charp
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/usb/host/ehci-hcd.ko
description: 10 Dec 2004 USB 2.0 'Enhanced' Host Controller (EHCI) Driver
author: David Brownell
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: usbcore
alias: pci:v*d*sv*sd*bc0Csc03i20*
parm: park:park setting; 1-3 back-to-back async packets (uint)
parm: log2_irq_thresh:log2 IRQ latency, 1-64 microframes (int)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/usb/host/ohci-hcd.ko
author: Roman Weissgaerber, David Brownell
description: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: usbcore
alias: pci:v*d*sv*sd*bc0Csc03i10*
parm: no_handshake:true (not default) disables BIOS handshake (bool)
parm: distrust_firmware:true to distrust firmware power/overcurrent setup (bool)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/usb/core/usbcore.ko
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
alias: usb:v*p*d*dc09dsc*dp*ic*isc*ip*
alias: usb:v*p*d*dc*dsc*dp*ic09isc*ip*
parm: usbfs_snoop:true to log all usbfs traffic (bool)
parm: use_both_schemes:try the other device initialization scheme if the first one fails (bool)
parm: old_scheme_first:start with the old device initialization scheme (bool)
parm: blinkenlights:true to cycle leds on hubs (bool)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/acpi/thermal.ko
author: Paul Diefenbaugh
description: ACPI Thermal Zone Driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends: processor
parm: tzp:Thermal zone polling frequency, in 1/10 seconds.
(int)
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/acpi/processor.ko
author: Paul Diefenbaugh
description: ACPI Processor Driver
license: GPL
alias: processor
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:
parm: bm_history:uint
parm: nocst:uint
parm: max_cstate:uint
filename: /lib/modules/2.6.18-5-k7/kernel/drivers/acpi/fan.ko
author: Paul Diefenbaugh
description: ACPI Fan Driver
license: GPL
vermagic: 2.6.18-5-k7 SMP mod_unload K7 REGPARM gcc-4.1
depends:

View File

@ -0,0 +1,12 @@
#!/bin/bash
for baselib in "$@"
do
shortlib=$baselib
while extn=$(echo $shortlib | sed -n '/\.[0-9][0-9]*$/s/.*\(\.[0-9][0-9]*\)$/\1/p')
[ -n "$extn" ]
do
shortlib=${shortlib%$extn}
echo ln -s $(basename $baselib) $shortlib
done
done

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

10
bash/ld_symlinks/tmp1.sh Executable file
View File

@ -0,0 +1,10 @@
for baselib in "$@"
do
shortlib=$baselib
while extn=$(echo $shortlib | sed 's/\.[0-9][0-9]*$//')
[ -n "$extn" ]
do
shortlib=$(basename $shortlib $extn)
ln -s $baselib $shortlib
done
done

14
bash/ld_symlinks/tmp2.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
#set -- libname.so.5.1.1
for baselib in "$@"
do
shortlib=$baselib
while extn=$(echo $shortlib | sed -n '/\.[0-9][0-9]*$/s/.*\(\.[0-9][0-9]*\)$/\1/p')
[ -n "$extn" ]
do
shortlib=$(basename $shortlib $extn)
echo ln -s $baselib $shortlib
done
done

12
bash/ld_symlinks/tmp3.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
for baselib in "$@"
do
shortlib=$baselib
while extn=$(echo $shortlib | sed -n '/\.[0-9][0-9]*$/s/.*\(\.[0-9][0-9]*\)$/\1/p')
[ -n "$extn" ]
do
shortlib=${shortlib%$extn}
echo ln -s $(basename $baselib) $shortlib
done
done

43
bash/serv_opts/server.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
echo $1
cmd=
case $1 in
start) {
echo "Starting server..."
cmd="start"
} ;;
stop) {
echo "Stopping server..."
cmd="stop"
} ;;
*) (
echo "Usage: $0 start|stop options"
) ;;
esac
if [[ "$cmd" == "" ]]; then
exit 1
fi
shift
port=
ip=
while : ; do
case $1 in
--ip) {
ip=$2
echo "ip = $ip"
} ;;
--port) {
port=$2
echo "port = $port"
} ;;
*) break;;
esac
shift
shift
done

59
bash/serv_opts/server2.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
server_name="/usr/bin/myserver"
log_path="/var/log/myserver.log"
pid_file="/var/run/myserver.pid"
ip=127.0.0.1 # default ip
port=80 # default port
cmd=
case $1 in
start) {
echo "Starting server..."
cmd="start"
} ;;
stop) {
echo "Stopping server..."
cmd="stop"
} ;;
*) (
echo "Usage: $0 start|stop options"
echo "Options: ip, port"
) ;;
esac
if [[ "$cmd" == "" ]]; then
exit 1
fi
shift
TEMP=`getopt -o i:p: --long ip:,port: -- "$@"`
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
while true ; do
case "$1" in
-i|--ip) ip=$2 ; echo "ip=$ip" ; shift 2 ;;
-p|--port) port=$2 ; echo "port=$port" ; shift 2 ;;
--) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
done
if [[ "$cmd" == "start" ]]; then
$myserver $pid_file $ip $port $log_path # в зависимости от интерфейса сервера
if [[ "$?" == "0" ]]; then
echo "Start SUCCESS =)"
else
echo "Start FAILED =("
fi
else
if [[ "$cmd" == "stop" ]]; then
pid=`cat $pid_file`
kill -s INT "${pid}"
echo "Server has stopped"
fi
fi

19
bash/serv_opts/tmp1.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
TEMP=`getopt -o i:P:: --long ip:,port:: \
-n 'example.bash' -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
while true ; do
case "$1" in
-i|--ip) echo "Option a" ; shift ;;
-P|--port) echo "Option b, argument \`$2'" ; shift 2 ;;
*) echo "Internal error!" ; exit 1 ;;
esac
done
echo "Remaining arguments:"
for arg do echo '--> '"\`$arg'" ; done

60
bash/serv_opts/tmp2.sh Executable file
View File

@ -0,0 +1,60 @@
#!/bin/bash
#<?php
server_name="/usr/bin/myserver"
log_path="/var/log/myserver.log"
pid_file="/var/run/myserver.pid"
ip=127.0.0.1 # default ip
port=80 # default port
cmd=
case $1 in
start) {
echo "Starting server..."
cmd="start"
} ;;
stop) {
echo "Stopping server..."
cmd="stop"
} ;;
*) (
echo "Usage: $0 start|stop options"
echo "Options: ip, port"
) ;;
esac
if [[ "$cmd" == "" ]]; then
exit 1
fi
shift
TEMP=`getopt -o i:p: --long ip:,port: -- "$@"`
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
while true ; do
case "$1" in
-i|--ip) ip=$2 ; echo "ip=$ip" ; shift 2 ;;
-p|--port) port=$2 ; echo "port=$port" ; shift 2 ;;
--) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
done
if [[ "$cmd" == "start" ]]; then
$myserver $pid_file $ip $port $log_path # в зависимости от интерфейса сервера
if [[ "$?" == "0" ]]; then
echo "Start SUCCESS =)"
else
echo "Start FAILED =("
fi
else
if [[ "$cmd" == "stop" ]]; then
pid=`cat $pid_file`
kill -s INT "${pid}"
echo "Server has stopped"
fi
fi
#?>

105
bash/studyBash/bash_script Normal file
View File

@ -0,0 +1,105 @@
#!/bin/bash
echo $0
#n=0
#until [ $n -eq 4 ]; do
# echo $n
# let n=n+1
#done
#n=0
#while [ ! $n -eq 4 ]; do
# echo $n
# let n=n+1
#done
# #Стирает все пустые файлы
#for file in ./*
#do
# if [ ! -s $file ]; then
# echo "Erasing $file"
# rm $file
# fi
#done
#for name # Ищет среди пронумерованных переменных $1 $2 .. .
#do
# echo $name
#done
#for item in `cat backbonedirs`
#do
# echo $item
#done
#for part in `date`; do
# echo $part
#done
#for i in Kolya Vasya Petia
#do
# echo -n $i", "
#done
#echo -n "please input string:"; read s
#case $s in
# *ello*)
# echo "Hello!"
# ;;
# *ye*)
# echo "Good Bye!"
# ;;
# *[SsFf]uck*|*Xuj*)
# echo "Fuck your self ! =8( "
# ;;
# *|[A-z]) # =)
# echo "I don't understand you 8)"
# ;;
#esac
#echo -n "a = "; read a
#echo -n "b = "; read b
#if [ $a -lt 2 ]; then
# if [ $b -gt 1 ]; then
# echo "a less than 2 and b greater than 1"
# fi
#else echo "no exceptions"
#fi
#echo -n "a = "; read a
#echo -n "b = "; read b
#if [ $a -eq $b ]; then echo "a equal b"
# elif [ $a -lt $b ]; then echo "a less than b"
# else echo "a greater than b"
#fi
#if[!-e
#if (true) #[echo trigger.dat];
#then
#./mount_backbone.run
# echo "ON"
# echo -n 0 > trigger.dat
#fi
#else
# echo "OFF"
#fi
#else
#./umount_backbone.run
# echo "OFF"
# echo -n 1 > trigger.dat
#elif

View File

@ -0,0 +1,105 @@
#!/bin/bash
n=0
until [ $n -eq 4 ]; do
echo $n
let n=n+1
done
n=0
while [ ! $n -eq 4 ]; do
echo $n
let n=n+1
done
# #Стирает все пустые файлы
#for file in ./*
#do
# if [ ! -s $file ]; then
# echo "Erasing $file"
# rm $file
# fi
#done
#for name # Ищет среди пронумерованных переменных $1 $2 .. .
#do
# echo $name
#done
#for item in `cat amd64dirs`
#do
# echo $item
#done
#for part in `date`; do
# echo $part
#done
#for i in Kolya Vasya Petia
#do
# echo -n $i", "
#done
#echo -n "please input string:"; read s
#case $s in
# *ello*)
# echo "Hello!"
# ;;
# *ye*)
# echo "Good Bye!"
# ;;
# *[SsFf]uck*|*Xuj*)
# echo "Fuck your self ! =8( "
# ;;
# *|[A-z]) # =)
# echo "I don't understand you 8)"
# ;;
#esac
#echo -n "a = "; read a
#echo -n "b = "; read b
#if [ $a -lt 2 ]; then
# if [ $b -gt 1 ]; then
# echo "a less than 2 and b greater than 1"
# fi
#else echo "no exceptions"
#fi
#echo -n "a = "; read a
#echo -n "b = "; read b
#if [ $a -eq $b ]; then echo "a equal b"
# elif [ $a -lt $b ]; then echo "a less than b"
# else echo "a greater than b"
#fi
#if[!-e
#if (true) #[echo trigger.dat];
#then
#./mount_amd64.run
# echo "ON"
# echo -n 0 > trigger.dat
#fi
#else
# echo "OFF"
#fi
#else
#./umount_amd64.run
# echo "OFF"
# echo -n 1 > trigger.dat
#elif

17
bash/studyBash/example1 Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# Чтение строк из файла /etc/fstab.
File=/etc/fstab
{
read line1
read line2
} < $File
echo "Первая строка в $File :"
echo "$line1"
echo
echo "Вторая строка в $File :"
echo "$line2"
exit 0