KERNEL=="sd[b-z]", GOTO="do-disk-rules"
KERNEL!="sd[b-z][0-9]", GOTO="end-of-file"
LABEL="do-disk-rules"
ACTION=="add", ENV{ID_USB_DRIVER}="usb-storage", GROUP="storage"
IMPORT{program}="/sbin/blkid -o udev -p %N"
ACTION=="remove", ENV{ID_FS_TYPE}!="", RUN+="/bin/sed -i '/\/dev\/%k /d' /etc/fstab"
ACTION=="remove", ENV{ID_FS_TYPE}!="", RUN+="/bin/rmdir /media/$env{ID_FS_TYPE}-%k"
ACTION=="add", ENV{ID_FS_TYPE}!="", RUN+="/bin/mkdir -p /media/$env{ID_FS_TYPE}-%k"
# монтирование раздела fat32
ACTION=="add", ENV{ID_FS_TYPE}=="vfat", RUN+="/bin/sed -i '$a\/dev/%k /media/$env{ID_FS_TYPE}-%k vfat rw,noatime,noauto,noatime,dmask=022,user,fmask=133,iocharset=koi8-r 0 0' /etc/fstab"
# монтирование раздела ntfs
ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/sed -i '$a\/dev/%k /media/$env{ID_FS_TYPE}-%k ntfs-3g rw,noatime,noauto,dmask=000,fmask=111,user,locale=ru_RU.koi8-r,allow_other 0 0' /etc/fstab"
# монтирование прочих ФС
ACTION=="add", ENV{ID_FS_TYPE}!="", ENV{ID_FS_TYPE}!="ntfs|vfat", RUN+="/bin/sed -i '$a\/dev/%k /media/$env{ID_FS_TYPE}-%k $env{ID_FS_TYPE} defaults,noatime,user 0 0' /etc/fstab"
LABEL="end-of-file"
ATTRS{idVendor}=="VID", ATTRS{idProduct}=="PID",…
#!/bin/sh
if [ "$1" = "" ]; then
echo "usage: $0 <latex string without \$s>"
exit
fi
[ "$2" != "" ] && pngname="$2" || pngname="out.png"
mask=tmp_$$
texfile=${mask}.tex
cat > $texfile << EOF
\documentclass[12pt]{article}
\usepackage[english, russian]{babel}
\usepackage[koi8-r]{inputenc}
\usepackage[matrix,arrow,curve]{xy}
\usepackage[intlimits]{amsmath}
\usepackage{amsfonts}
\pagestyle{empty}
\setbox0=\hbox{$\displaystyle
EOF
echo "$1" >> $texfile
cat >> $texfile << EOF
$}
\textwidth=\wd0
\textheight=\ht0
\advance\textwidth by 2em
\advance\textheight by 2\dp0
\topmargin=-1.5cm
\oddsidemargin=-1cm
\begin{document}
\vbox{\vss\hbox{\hss\copy0\hss}\vss}
\end{document}
EOF
latex $texfile
dvipng -D 600 ${mask}.dvi -o $pngname
rm -f ${mask}*
makeformula "S=\int\limits_0^{D}a_0\exp(2\pi i\nu t_0)\exp\left\{2\pi
i\frac{l\sin\epsilon}{\lambda}\right\}\,dl."