commit
cb99d998e1
16 changed files with 777 additions and 0 deletions
@ -0,0 +1,10 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#- Чтение цитат с bash.org.ru |
||||||
|
curl -s http://bash.im/rss/ | \ |
||||||
|
iconv -c -f cp1251 -t utf8 | \ |
||||||
|
sed 's/<description><!\[CDATA\[/\n---------------------------\n\n/g; |
||||||
|
s/\]\]><\/description>//g; s/<br>/\n/g; s/\</>> /g; |
||||||
|
s/\>/:/g; s/\"/"/g; s/\s*<.*$\|\s*xmlns:.*$//g;' | \ |
||||||
|
grep . | less |
||||||
|
|
@ -0,0 +1,45 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#Создан: Чт 06 Май 2010 02:44:00 |
||||||
|
#Изменён: Ср 28 авг 2013 19:58:49 |
||||||
|
|
||||||
|
# Скрипт напоминания о датах |
||||||
|
# |
||||||
|
# Формат файла DATAFILE: |
||||||
|
# |
||||||
|
# = Январь = |
||||||
|
# |
||||||
|
# * *01/01* - Событие 1 |
||||||
|
# |
||||||
|
# = Февраль = |
||||||
|
# |
||||||
|
# * *02/02* - Событие 2 |
||||||
|
# * *03/02* - Событие 3 |
||||||
|
|
||||||
|
#Файл с данными |
||||||
|
DATAFILE="$SHELLRC/vimwiki/wiki/ЖЖ/Даты и события/dates.wiki" |
||||||
|
#За сколько дней оповещать |
||||||
|
DAYS=3 |
||||||
|
#Сегодняшнее число |
||||||
|
TODAY=$(\date +%s --date=$(\date '+%m/%d')) |
||||||
|
#Количество найденных событий |
||||||
|
FOUND=0 |
||||||
|
|
||||||
|
dates() { |
||||||
|
echo "$greenБлижайшие даты:$rstc" |
||||||
|
|
||||||
|
#Поиск дат в базе данных |
||||||
|
for i in $(seq 0 $DAYS); do |
||||||
|
DATE=$(\date -d "UTC 1970-01-01 $(($TODAY + 86400*$i)) secs" '+%d/%m') |
||||||
|
grep -v '#.*' "$DATAFILE" | grep $DATE && ((FOUND++)) |
||||||
|
done; |
||||||
|
|
||||||
|
#Код возврата. 1 - не найдено дат. |
||||||
|
[ $FOUND -eq 0 ] && echo "-" && exit 1 || exit 0 |
||||||
|
} |
||||||
|
|
||||||
|
case "$1" in |
||||||
|
-all) cat "$DATAFILE";; |
||||||
|
*) dates;; |
||||||
|
esac |
||||||
|
|
@ -0,0 +1,49 @@ |
|||||||
|
#!/usr/bin/env guile |
||||||
|
!# |
||||||
|
|
||||||
|
;;;Создан: Сб 10 июл 2010 19:29:10 |
||||||
|
;;;Изменён: Вс 21 июл 2010 01:40:25 |
||||||
|
|
||||||
|
;;; |
||||||
|
;;; Скрипт составления команды UNIX Shell для добавления пользователя в группы. |
||||||
|
;;; Группы добавляются к уже имеющимся. |
||||||
|
;;; |
||||||
|
;;; (c) 2010, Maxim Lihachev, <envrm@yandex.ru> |
||||||
|
;;; |
||||||
|
|
||||||
|
;;Стандартные группы для пользователей |
||||||
|
(define default-groups (list "plugdev" "audio" "video" "cdrom" "scanner" "users")) |
||||||
|
|
||||||
|
;;Получение первого элемента вектора |
||||||
|
(define (vector-car vector) (vector-ref vector 0)) |
||||||
|
|
||||||
|
;;Получение списка существующих групп |
||||||
|
(define (get-all-groups) |
||||||
|
(do ( (group (getgr) (getgr)) |
||||||
|
(groups '() (append groups (list group)))) |
||||||
|
((not (vector? group)) groups))) |
||||||
|
|
||||||
|
;;Получение списка групп, в которые входит данный пользователь |
||||||
|
(define (get-old-groups user groups) |
||||||
|
(map vector-car (filter (lambda (g) (member user (group:mem g))) groups))) |
||||||
|
|
||||||
|
;;Получение списка групп, в которые должен входить пользователь |
||||||
|
(define (get-new-groups groups) |
||||||
|
(filter (lambda (x) (not (member x groups))) default-groups)) |
||||||
|
|
||||||
|
;;Создание команды оболочки для добавления пользователя в группы |
||||||
|
(define (make-command user groups) |
||||||
|
(format #f "usermod -G ~A ~A\n" (string-join groups ",") user)) |
||||||
|
|
||||||
|
;;;----------------------------------------------------------------------------- |
||||||
|
;;Формирование команд оболочки |
||||||
|
(let* ( (all-groups (get-all-groups)) |
||||||
|
(users (if (< 1 (length (command-line))) |
||||||
|
(cdr (command-line)) |
||||||
|
(list (cuserid)))) |
||||||
|
(get-command (lambda (user) |
||||||
|
(let* ( (oldg (get-old-groups user all-groups)) |
||||||
|
(newg (get-new-groups oldg))) |
||||||
|
(display (make-command user (append oldg newg))))))) |
||||||
|
(for-each get-command users)) |
||||||
|
|
@ -0,0 +1,15 @@ |
|||||||
|
#!/usr/bin/env tclsh |
||||||
|
|
||||||
|
#Создан: Сбт 09 Июл 2011 00:22:26 |
||||||
|
#Изменён: Сбт 09 Июл 2011 01:32:08 |
||||||
|
|
||||||
|
package require doctools |
||||||
|
package require fileutil |
||||||
|
|
||||||
|
# USAGE |
||||||
|
lassign $argv format file out |
||||||
|
|
||||||
|
::doctools::new mydtp -format $format |
||||||
|
|
||||||
|
fileutil::writeFile -encoding koi8-r $out [mydtp format [fileutil::cat $file]] |
||||||
|
|
@ -0,0 +1,30 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#- Распаковка архивов |
||||||
|
ext() { |
||||||
|
[ -f "$1" ]; { |
||||||
|
case "$1" in |
||||||
|
*.tar.bz2) tar xjf "$1";; |
||||||
|
*.tar.gz) tar xzf "$1";; |
||||||
|
*.tar.Z) tar xzf "$1";; |
||||||
|
*.txz) tar xJf "$1";; |
||||||
|
*.xz) tar xJf "$1";; |
||||||
|
*.bz2) bunzip2 "$1";; |
||||||
|
*.rar) unrar x "$1";; |
||||||
|
*.gz) gunzip "$1";; |
||||||
|
*.jar) unzip "$1";; |
||||||
|
*.tar) tar xf "$1";; |
||||||
|
*.tbz2) tar xjf "$1";; |
||||||
|
*.tgz) tar xzf "$1";; |
||||||
|
*.zip) unzip "$1";; |
||||||
|
*.Z) uncompress "$1";; |
||||||
|
*.7z) 7z x "$1";; |
||||||
|
*.7za) 7z x "$1";; |
||||||
|
*) echo -e \ |
||||||
|
""$green"<${1:-"-"}>: Неизвестный формат архива";; |
||||||
|
esac |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
ext "$*" |
||||||
|
|
@ -0,0 +1,326 @@ |
|||||||
|
#!/bin/bash |
||||||
|
# |
||||||
|
|
||||||
|
case ${1:0-3} in |
||||||
|
zip) TEXT=$(zcat "$1");; |
||||||
|
fb2) TEXT=$(cat "$1");; |
||||||
|
*) echo "Неизвестный формат файла"; exit 1;; |
||||||
|
esac |
||||||
|
|
||||||
|
# zip) zcat "$1" | xsltproc "$(dirname $(which $0))/FB2_2_xhtml.xsl" -;; |
||||||
|
# fb2) cat "$1" | xsltproc "$(dirname $(which $0))/FB2_2_xhtml.xsl" -;; |
||||||
|
|
||||||
|
FB2=`cat <<FB2RULES |
||||||
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fb="http://www.gribuser.ru/xml/fictionbook/2.0"> |
||||||
|
<xsl:output method="xml" encoding="UTF-8"/> |
||||||
|
<xsl:key name="note-link" match="fb:section" use="@id"/> |
||||||
|
<xsl:template match="/*"> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<xsl:if test="fb:description/fb:title-info/fb:lang = 'ru'"> |
||||||
|
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8"/> |
||||||
|
</xsl:if> |
||||||
|
<title> |
||||||
|
<xsl:value-of select="fb:description/fb:title-info/fb:book-title"/> |
||||||
|
</title> |
||||||
|
<style type="text/x-oeb1-css"> |
||||||
|
A { color : #0002CC } |
||||||
|
A:HOVER { color : #BF0000 } |
||||||
|
BODY { background-color : #FEFEFE; color : #000000; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; text-align : justify } |
||||||
|
H1{ font-size : 160%; font-style : normal; font-weight : bold; text-align : left; border : 1px solid Black; background-color : #E7E7E7; margin-left : 0px; page-break-before : always; } |
||||||
|
H2{ font-size : 130%; font-style : normal; font-weight : bold; text-align : left; background-color : #EEEEEE; border : 1px solid Gray; page-break-before : always; } |
||||||
|
H3{ font-size : 110%; font-style : normal; font-weight : bold; text-align : left; background-color : #F1F1F1; border : 1px solid Silver;} |
||||||
|
H4{ font-size : 100%; font-style : normal; font-weight : bold; text-align : left; border : 1px solid Gray; background-color : #F4F4F4;} |
||||||
|
H5{ font-size : 100%; font-style : italic; font-weight : bold; text-align : left; border : 1px solid Gray; background-color : #F4F4F4;} |
||||||
|
H6{ font-size : 100%; font-style : italic; font-weight : normal; text-align : left; border : 1px solid Gray; background-color : #F4F4F4;} |
||||||
|
SMALL{ font-size : 80% } |
||||||
|
BLOCKQUOTE{ margin-left :4em; margin-top:1em; margin-right:0.2em;} |
||||||
|
HR{ color : Black } |
||||||
|
UL{margin-left: 0} |
||||||
|
.epigraph{width:50%; margin-left : 35%;} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<xsl:for-each select="fb:description/fb:title-info/fb:annotation"> |
||||||
|
<div> |
||||||
|
<xsl:call-template name="annotation"/> |
||||||
|
</div> |
||||||
|
<hr/> |
||||||
|
</xsl:for-each> |
||||||
|
<!-- BUILD TOC --> |
||||||
|
<ul> |
||||||
|
<xsl:apply-templates select="fb:body" mode="toc"/> |
||||||
|
</ul> |
||||||
|
<hr/> |
||||||
|
<!-- BUILD BOOK --> |
||||||
|
<xsl:for-each select="fb:body"> |
||||||
|
<xsl:if test="position()!=1"> |
||||||
|
<hr/> |
||||||
|
</xsl:if> |
||||||
|
<xsl:if test="@name"> |
||||||
|
<h4 align="center"> |
||||||
|
<xsl:value-of select="@name"/> |
||||||
|
</h4> |
||||||
|
</xsl:if> |
||||||
|
<!-- <xsl:apply-templates /> --> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</xsl:for-each> |
||||||
|
</body> |
||||||
|
</html> |
||||||
|
</xsl:template> |
||||||
|
<!-- author template --> |
||||||
|
<xsl:template name="author"> |
||||||
|
<xsl:value-of select="fb:first-name"/> |
||||||
|
<xsl:text disable-output-escaping="no"> </xsl:text> |
||||||
|
<xsl:value-of select="fb:middle-name"/>  |
||||||
|
<xsl:text disable-output-escaping="no"> </xsl:text> |
||||||
|
<xsl:value-of select="fb:last-name"/> |
||||||
|
<br/> |
||||||
|
</xsl:template> |
||||||
|
<!-- secuence template --> |
||||||
|
<xsl:template name="sequence"> |
||||||
|
<LI/> |
||||||
|
<xsl:value-of select="@name"/> |
||||||
|
<xsl:if test="@number"> |
||||||
|
<xsl:text disable-output-escaping="no">, #</xsl:text> |
||||||
|
<xsl:value-of select="@number"/> |
||||||
|
</xsl:if> |
||||||
|
<xsl:if test="fb:sequence"> |
||||||
|
<ul> |
||||||
|
<xsl:for-each select="fb:sequence"> |
||||||
|
<xsl:call-template name="sequence"/> |
||||||
|
</xsl:for-each> |
||||||
|
</ul> |
||||||
|
</xsl:if> |
||||||
|
<!-- <br/> --> |
||||||
|
</xsl:template> |
||||||
|
<!-- toc template --> |
||||||
|
<xsl:template match="fb:section|fb:body" mode="toc"> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="name()='body' and position()=1 and not(fb:title)"> |
||||||
|
<xsl:apply-templates select="fb:section" mode="toc"/> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<li> |
||||||
|
<a href="#TOC_{generate-id()}"><xsl:value-of select="normalize-space(fb:title/fb:p[1] | @name)"/></a> |
||||||
|
<xsl:if test="fb:section"> |
||||||
|
<ul><xsl:apply-templates select="fb:section" mode="toc"/></ul> |
||||||
|
</xsl:if> |
||||||
|
</li> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</xsl:template> |
||||||
|
<!-- description --> |
||||||
|
<xsl:template match="fb:description"> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</xsl:template> |
||||||
|
<!-- body --> |
||||||
|
<xsl:template match="fb:body"> |
||||||
|
<div><xsl:apply-templates/></div> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="fb:section"> |
||||||
|
<a name="TOC_{generate-id()}"></a> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
|
||||||
|
<!-- section/title --> |
||||||
|
<xsl:template match="fb:section/fb:title|fb:poem/fb:title"> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="count(ancestor::node()) < 9"> |
||||||
|
<xsl:element name="{concat('h',count(ancestor::node())-3)}"> |
||||||
|
<a name="TOC_{generate-id()}"></a> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</xsl:element> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<xsl:element name="h6"> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</xsl:element> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</xsl:template> |
||||||
|
<!-- section/title --> |
||||||
|
<xsl:template match="fb:body/fb:title"> |
||||||
|
<h1><xsl:apply-templates mode="title"/></h1> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="fb:title/fb:p"> |
||||||
|
<xsl:apply-templates/><xsl:text disable-output-escaping="no"> </xsl:text><br/> |
||||||
|
</xsl:template> |
||||||
|
<!-- subtitle --> |
||||||
|
<xsl:template match="fb:subtitle"> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<h5> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</h5> |
||||||
|
</xsl:template> |
||||||
|
<!-- p --> |
||||||
|
<xsl:template match="fb:p"> |
||||||
|
<div align="justify"><xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if>    <xsl:apply-templates/></div> |
||||||
|
</xsl:template> |
||||||
|
<!-- strong --> |
||||||
|
<xsl:template match="fb:strong"> |
||||||
|
<b><xsl:apply-templates/></b> |
||||||
|
</xsl:template> |
||||||
|
<!-- emphasis --> |
||||||
|
<xsl:template match="fb:emphasis"> |
||||||
|
<i> <xsl:apply-templates/></i> |
||||||
|
</xsl:template> |
||||||
|
<!-- style --> |
||||||
|
<xsl:template match="fb:style"> |
||||||
|
<span class="{@name}"><xsl:apply-templates/></span> |
||||||
|
</xsl:template> |
||||||
|
<!-- empty-line --> |
||||||
|
<xsl:template match="fb:empty-line"> |
||||||
|
<br/> |
||||||
|
</xsl:template> |
||||||
|
<!-- link --> |
||||||
|
<xsl:template match="fb:a"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="href"><xsl:value-of select="@xlink:href"/></xsl:attribute> |
||||||
|
<xsl:attribute name="title"> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="starts-with(@xlink:href,'#')"><xsl:value-of select="key('note-link',substring-after(@xlink:href,'#'))/fb:p"/></xsl:when> |
||||||
|
<xsl:otherwise><xsl:value-of select="key('note-link',@xlink:href)/fb:p"/></xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</xsl:attribute> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="(@type) = 'note'"> |
||||||
|
<sup> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</sup> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</xsl:element> |
||||||
|
</xsl:template> |
||||||
|
<!-- annotation --> |
||||||
|
<xsl:template name="annotation"> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<h3>Annotation</h3> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</xsl:template> |
||||||
|
<!-- epigraph --> |
||||||
|
<xsl:template match="fb:epigraph"> |
||||||
|
<blockquote class="epigraph"> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</blockquote> |
||||||
|
</xsl:template> |
||||||
|
<!-- epigraph/text-author --> |
||||||
|
<xsl:template match="fb:epigraph/fb:text-author"> |
||||||
|
<blockquote> |
||||||
|
<i><xsl:apply-templates/></i> |
||||||
|
</blockquote> |
||||||
|
</xsl:template> |
||||||
|
<!-- cite --> |
||||||
|
<xsl:template match="fb:cite"> |
||||||
|
<blockquote> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</blockquote> |
||||||
|
</xsl:template> |
||||||
|
<!-- cite/text-author --> |
||||||
|
<xsl:template match="fb:text-author"> |
||||||
|
<blockquote> |
||||||
|
<i> <xsl:apply-templates/></i></blockquote> |
||||||
|
</xsl:template> |
||||||
|
<!-- date --> |
||||||
|
<xsl:template match="fb:date"> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="not(@value)"> |
||||||
|
   <xsl:apply-templates/> |
||||||
|
<br/> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
   <xsl:value-of select="@value"/> |
||||||
|
<br/> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</xsl:template> |
||||||
|
<!-- poem --> |
||||||
|
<xsl:template match="fb:poem"> |
||||||
|
<blockquote> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<xsl:apply-templates/> |
||||||
|
</blockquote> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<!-- stanza --> |
||||||
|
<xsl:template match="fb:stanza"> |
||||||
|
<xsl:apply-templates/> |
||||||
|
<br/> |
||||||
|
</xsl:template> |
||||||
|
<!-- v --> |
||||||
|
<xsl:template match="fb:v"> |
||||||
|
<xsl:if test="@id"> |
||||||
|
<xsl:element name="a"> |
||||||
|
<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:if> |
||||||
|
<xsl:apply-templates/><br/> |
||||||
|
</xsl:template> |
||||||
|
<!-- image --> |
||||||
|
<xsl:template match="fb:image"> |
||||||
|
<div align="center"> |
||||||
|
<img border="1"> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="starts-with(@xlink:href,'#')"> |
||||||
|
<xsl:attribute name="src"><xsl:value-of select="substring-after(@xlink:href,'#')"/></xsl:attribute> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<xsl:attribute name="src"><xsl:value-of select="@xlink:href"/></xsl:attribute> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</img> |
||||||
|
</div> |
||||||
|
</xsl:template> |
||||||
|
</xsl:stylesheet> |
||||||
|
|
||||||
|
FB2RULES` |
||||||
|
|
||||||
|
echo $TEXT | xsltproc <(echo $FB2) - | lynx -stdin -display_charset=UTF-8 |
||||||
|
|
@ -0,0 +1,25 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#Создан: Вс 25 авг 2013 19:40:12 |
||||||
|
#Изменён: Ср 28 авг 2013 20:24:59 |
||||||
|
|
||||||
|
# Добавление файлов с меткой +GITIGNORE в исключения .git |
||||||
|
|
||||||
|
# Метка должна располагаться не далее пятой колонки |
||||||
|
\grep -E '^.{1,5}\+GITIGNORE' -R > /tmp/gitignore.tmp |
||||||
|
|
||||||
|
if [ -f ".gitignore" ]; then |
||||||
|
while read line; do |
||||||
|
echo lll $line |
||||||
|
sed -i "/${line//\//.}/d" /tmp/gitignore.tmp 2> /dev/null |
||||||
|
done < .gitignore |
||||||
|
fi |
||||||
|
|
||||||
|
echo "\n# [ $(\date +%d.%m.%Y) ]\n" >> .gitignore |
||||||
|
|
||||||
|
cut -d ':' -f 1 /tmp/gitignore.tmp | sort -u >> .gitignore |
||||||
|
|
||||||
|
echo >> .gitignore |
||||||
|
|
||||||
|
\rm /tmp/gitignore.tmp |
||||||
|
|
@ -0,0 +1,10 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#- Чтение цитат с ibash.org.ru |
||||||
|
curl -s http://ibash.org.ru/rss.xml | \ |
||||||
|
iconv -c -f cp1251 -t utf8 | \ |
||||||
|
sed 's/<description><!\[CDATA\[/\n---------------------------\n\n/g; |
||||||
|
s/\]\]><\/description>//g; s/<br \/>/\n/g; s/\</>> /g; |
||||||
|
s/\>/:/g; s/\"/"/g; s/\s*<.*$\|\s*xmlns:.*$//g;' | \ |
||||||
|
grep . | less |
||||||
|
|
@ -0,0 +1,23 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#- Заметки |
||||||
|
memfile=$SHELLRC/var/memory/mem |
||||||
|
case "$1" in |
||||||
|
-h) printf "\tКлючи:\n\ |
||||||
|
-e\t-Редактирование записей\n\ |
||||||
|
-l n\t-Последние n записей\n\ |
||||||
|
-s\t-Поиск по записям\n\ |
||||||
|
-remove\t-Удалить запись по номеру\n\ |
||||||
|
-clear\t-Удалить все записи\n\ |
||||||
|
-h\t-Справка\n";; |
||||||
|
|
||||||
|
-e) vim $memfile;; |
||||||
|
-l) tail -"$2" $memfile | nl | \grep --color -E '.{1,}==>';; |
||||||
|
-s) grep "$2" $memfile | nl | \grep --color -E '.{1,}==>';; |
||||||
|
-remove) sed "$2d" -i $memfile;; |
||||||
|
-clear) > $memfile;; |
||||||
|
'') cat $memfile | nl | \grep --color -E '.{1,}==>';; |
||||||
|
*) printf "[ `\date '+%d.%m.%Y %H:%M:%S'` ] ==> $1\n" >> $memfile && printf \ |
||||||
|
"$greenЗаметка$yellow $1 $greenуспешно добавлена\n$rstc" |
||||||
|
esac |
||||||
|
|
@ -0,0 +1,17 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#pgrep soffice.bin || \ |
||||||
|
soffice \ |
||||||
|
-headless \ |
||||||
|
-accept="socket,host=127.0.0.1,port=8100;urp;" \ |
||||||
|
-nofirststartwizard |
||||||
|
|
||||||
|
sleep 1 |
||||||
|
|
||||||
|
for i; { |
||||||
|
java -jar $SHELLRC/etc/soft/jodconverter/lib/jodconverter-cli-2.2.2.jar \ |
||||||
|
"$i" "${i//\.*/}.pdf" |
||||||
|
} |
||||||
|
|
||||||
|
killall soffice.bin |
||||||
|
|
@ -0,0 +1,13 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#- Запаковка архивов |
||||||
|
case ${2:-tbz} in |
||||||
|
tbz) tar cjvf $1.tar.bz2 $1;; |
||||||
|
tgz) tar czvf $1.tar.gz $1;; |
||||||
|
tar) tar cpvf $1.tar $1;; |
||||||
|
bz2) bzip $1;; |
||||||
|
gz) gzip -c -9 -n $1 > $1.gz;; |
||||||
|
zip) zip -r $1.zip $1;; |
||||||
|
7z) 7za a $1.7z $1;; |
||||||
|
esac |
||||||
|
|
@ -0,0 +1,7 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#- Рип DVD и видео |
||||||
|
mencoder $1 -ovc x264 -vf yadif -oac copy \ |
||||||
|
-x264encopts subq=6:partitions=all:8x8dct:me=umh:\ |
||||||
|
frameref=5:bframes=4:b_pyramid:weight_b:threads=2:crf=22 -o $2 |
||||||
|
|
@ -0,0 +1,7 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
#- Рип DVD и видео с pcm-дорожкой |
||||||
|
mencoder $1 -ovc x264 -vf yadif -oac pcm \ |
||||||
|
-x264encopts subq=6:partitions=all:8x8dct:me=umh:\ |
||||||
|
frameref=5:bframes=4:b_pyramid:weight_b:threads=2:crf=22 -o $2 |
||||||
|
|
@ -0,0 +1,25 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
# |
||||||
|
# Изменение комментария в id3-теге с помощью ncmpcpp |
||||||
|
# $1 -- текст комментария |
||||||
|
# |
||||||
|
|
||||||
|
# Переход к редактору тегов |
||||||
|
xdotool key e |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Down |
||||||
|
xdotool key Return |
||||||
|
xdotool key Control+u |
||||||
|
xdotool type $1 |
||||||
|
xdotool key Return |
||||||
|
xdotool key y |
||||||
|
|
@ -0,0 +1,18 @@ |
|||||||
|
#!/usr/bin/env tclsh |
||||||
|
|
||||||
|
# Выполнение команды с правами администратора |
||||||
|
# Используется с dmenu |
||||||
|
# suDo <command> <password> |
||||||
|
|
||||||
|
package require Expect |
||||||
|
|
||||||
|
proc execCommand {command password} { |
||||||
|
spawn bash |
||||||
|
exp_send "su -c \"$command\"\n" |
||||||
|
expect -nocase "password: " |
||||||
|
exp_send "$password\n" |
||||||
|
expect eof |
||||||
|
} |
||||||
|
|
||||||
|
execCommand [lindex $argv 0] [lindex $argv 1] |
||||||
|
|
@ -0,0 +1,157 @@ |
|||||||
|
#!/usr/bin/env tclsh |
||||||
|
|
||||||
|
#Создан: Вт 06 июл 2010 19:18:44 |
||||||
|
#Изменён: Чт 22 июл 2010 19:27:09 |
||||||
|
|
||||||
|
#---------------------------------------------------------------------------+ |
||||||
|
# | |
||||||
|
# Скрипт отображает символы Unicode. | |
||||||
|
# | |
||||||
|
# Использование: utable [класс символов] | |
||||||
|
# | |
||||||
|
# Copyrignt (c) 2010-2013, Likhachev Maxim, <<user@domain>> | |
||||||
|
# | |
||||||
|
#---------------------------------------------------------------------------+ |
||||||
|
|
||||||
|
#Классы символов Unicode |
||||||
|
array set category { |
||||||
|
Basic_Latin {"Basic_Latin" 0x0000 0x007F} |
||||||
|
Latin-1_Supplement {"Latin-1_Supplement" 0x0080 0x00FF} |
||||||
|
Latin_Extended-A {"Latin_Extended-A" 0x0100 0x017F} |
||||||
|
Latin_Extended-B {"Latin_Extended-B" 0x0180 0x024F} |
||||||
|
IPA_Extensions {"IPA_Extensions" 0x0250 0x02AF} |
||||||
|
Spacing_Modifier_Letters {"Spacing_Modifier_Letters" 0x02B0 0x02FF} |
||||||
|
Combining_Diacritical_Marks {"Combining_Diacritical_Marks" 0x0300 0x036F} |
||||||
|
Greek_and_Coptic {"Greek_and_Coptic" 0x0370 0x03FF} |
||||||
|
Cyrillic {"Cyrillic" 0x0400 0x04FF} |
||||||
|
Cyrillic_Supplementary {"Cyrillic_Supplementary" 0x0500 0x052F} |
||||||
|
Armenian {"Armenian" 0x0530 0x058F} |
||||||
|
Hebrew {"Hebrew" 0x0590 0x05FF} |
||||||
|
Arabic {"Arabic" 0x0600 0x06FF} |
||||||
|
Syriac {"Syriac" 0x0700 0x074F} |
||||||
|
Thaana {"Thaana" 0x0780 0x07BF} |
||||||
|
Devanagari {"Devanagari" 0x0900 0x097F} |
||||||
|
Bengali {"Bengali" 0x0980 0x09FF} |
||||||
|
Gurmukhi {"Gurmukhi" 0x0A00 0x0A7F} |
||||||
|
Gujarati {"Gujarati" 0x0A80 0x0AFF} |
||||||
|
Oriya {"Oriya" 0x0B00 0x0B7F} |
||||||
|
Tamil {"Tamil" 0x0B80 0x0BFF} |
||||||
|
Telugu {"Telugu" 0x0C00 0x0C7F} |
||||||
|
Kannada {"Kannada" 0x0C80 0x0CFF} |
||||||
|
Malayalam {"Malayalam" 0x0D00 0x0D7F} |
||||||
|
Sinhala {"Sinhala" 0x0D80 0x0DFF} |
||||||
|
Thai {"Thai" 0x0E00 0x0E7F} |
||||||
|
Lao {"Lao" 0x0E80 0x0EFF} |
||||||
|
Tibetan {"Tibetan" 0x0F00 0x0FFF} |
||||||
|
Myanmar {"Myanmar" 0x1000 0x109F} |
||||||
|
Georgian {"Georgian" 0x10A0 0x10FF} |
||||||
|
Hangul_Jamo {"Hangul_Jamo" 0x1100 0x11FF} |
||||||
|
Ethiopic {"Ethiopic" 0x1200 0x137F} |
||||||
|
Cherokee {"Cherokee" 0x13A0 0x13FF} |
||||||
|
Unified_Canadian_Aboriginal_Syllabics {"Unified_Canadian_Aboriginal_Syllabics" 0x1400 0x167F} |
||||||
|
Ogham {"Ogham" 0x1680 0x169F} |
||||||
|
Runic {"Runic" 0x16A0 0x16FF} |
||||||
|
Tagalog {"Tagalog" 0x1700 0x171F} |
||||||
|
Hanunoo {"Hanunoo" 0x1720 0x173F} |
||||||
|
Buhid {"Buhid" 0x1740 0x175F} |
||||||
|
Tagbanwa {"Tagbanwa" 0x1760 0x177F} |
||||||
|
Khmer {"Khmer" 0x1780 0x17FF} |
||||||
|
Mongolian {"Mongolian" 0x1800 0x18AF} |
||||||
|
Limbu {"Limbu" 0x1900 0x194F} |
||||||
|
Tai_Le {"Tai_Le" 0x1950 0x197F} |
||||||
|
Khmer_Symbols {"Khmer_Symbols" 0x19E0 0x19FF} |
||||||
|
Phonetic_Extensions {"Phonetic_Extensions" 0x1D00 0x1D7F} |
||||||
|
Latin_Extended_Additional {"Latin_Extended_Additional" 0x1E00 0x1EFF} |
||||||
|
Greek_Extended {"Greek_Extended" 0x1F00 0x1FFF} |
||||||
|
General_Punctuation {"General_Punctuation" 0x2000 0x206F} |
||||||
|
Superscripts_and_Subscripts {"Superscripts_and_Subscripts" 0x2070 0x209F} |
||||||
|
Currency_Symbols {"Currency_Symbols" 0x20A0 0x20CF} |
||||||
|
Combining_Diacritical_Marks_for_Symbols {"Combining_Diacritical_Marks_for_Symbols" 0x20D0 0x20FF} |
||||||
|
Letterlike_Symbols {"Letterlike_Symbols" 0x2100 0x214F} |
||||||
|
Number_Forms {"Number_Forms" 0x2150 0x218F} |
||||||
|
Arrows {"Arrows" 0x2190 0x21FF} |
||||||
|
Mathematical_Operators {"Mathematical_Operators" 0x2200 0x22FF} |
||||||
|
Miscellaneous_Technical {"Miscellaneous_Technical" 0x2300 0x23FF} |
||||||
|
Control_Pictures {"Control_Pictures" 0x2400 0x243F} |
||||||
|
Optical_Character_Recognition {"Optical_Character_Recognition" 0x2440 0x245F} |
||||||
|
Enclosed_Alphanumerics {"Enclosed_Alphanumerics" 0x2460 0x24FF} |
||||||
|
Box_Drawing {"Box_Drawing" 0x2500 0x257F} |
||||||
|
Block_Elements {"Block_Elements" 0x2580 0x259F} |
||||||
|
Geometric_Shapes {"Geometric_Shapes" 0x25A0 0x25FF} |
||||||
|
Miscellaneous_Symbols {"Miscellaneous_Symbols" 0x2600 0x26FF} |
||||||
|
Dingbats {"Dingbats" 0x2700 0x27BF} |
||||||
|
Miscellaneous_Mathematical_Symbols-A {"Miscellaneous_Mathematical_Symbols-A" 0x27C0 0x27EF} |
||||||
|
Supplemental_Arrows-A {"Supplemental_Arrows-A" 0x27F0 0x27FF} |
||||||
|
Braille_Patterns {"Braille_Patterns" 0x2800 0x28FF} |
||||||
|
Supplemental_Arrows-B {"Supplemental_Arrows-B" 0x2900 0x297F} |
||||||
|
Miscellaneous_Mathematical_Symbols-B {"Miscellaneous_Mathematical_Symbols-B" 0x2980 0x29FF} |
||||||
|
Supplemental_Mathematical_Operators {"Supplemental_Mathematical_Operators" 0x2A00 0x2AFF} |
||||||
|
Miscellaneous_Symbols_and_Arrows {"Miscellaneous_Symbols_and_Arrows" 0x2B00 0x2BFF} |
||||||
|
CJK_Radicals_Supplement {"CJK_Radicals_Supplement" 0x2E80 0x2EFF} |
||||||
|
Kangxi_Radicals {"Kangxi_Radicals" 0x2F00 0x2FDF} |
||||||
|
Ideographic_Description_Characters {"Ideographic_Description_Characters" 0x2FF0 0x2FFF} |
||||||
|
CJK_Symbols_and_Punctuation {"CJK_Symbols_and_Punctuation" 0x3000 0x303F} |
||||||
|
Hiragana {"Hiragana" 0x3040 0x309F} |
||||||
|
Katakana {"Katakana" 0x30A0 0x30FF} |
||||||
|
Bopomofo {"Bopomofo" 0x3100 0x312F} |
||||||
|
Hangul_Compatibility_Jamo {"Hangul_Compatibility_Jamo" 0x3130 0x318F} |
||||||
|
Kanbun {"Kanbun" 0x3190 0x319F} |
||||||
|
Bopomofo_Extended {"Bopomofo_Extended" 0x31A0 0x31BF} |
||||||
|
Katakana_Phonetic_Extensions {"Katakana_Phonetic_Extensions" 0x31F0 0x31FF} |
||||||
|
Enclosed_CJK_Letters_and_Months {"Enclosed_CJK_Letters_and_Months" 0x3200 0x32FF} |
||||||
|
CJK_Compatibility {"CJK_Compatibility" 0x3300 0x33FF} |
||||||
|
CJK_Unified_Ideographs_Extension_A {"CJK_Unified_Ideographs_Extension_A" 0x3400 0x4DBF} |
||||||
|
Yijing_Hexagram_Symbols {"Yijing_Hexagram_Symbols" 0x4DC0 0x4DFF} |
||||||
|
CJK_Unified_Ideographs {"CJK_Unified_Ideographs" 0x4E00 0x9FFF} |
||||||
|
Yi_Syllables {"Yi_Syllables" 0xA000 0xA48F} |
||||||
|
Yi_Radicals {"Yi_Radicals" 0xA490 0xA4CF} |
||||||
|
Hangul_Syllables {"Hangul_Syllables" 0xAC00 0xD7AF} |
||||||
|
High_Surrogates {"High_Surrogates" 0xD800 0xDB7F} |
||||||
|
High_Private_Use_Surrogates {"High_Private_Use_Surrogates" 0xDB80 0xDBFF} |
||||||
|
Low_Surrogates {"Low_Surrogates" 0xDC00 0xDFFF} |
||||||
|
Private_Use_Area {"Private_Use_Area" 0xE000 0xF8FF} |
||||||
|
CJK_Compatibility_Ideographs {"CJK_Compatibility_Ideographs" 0xF900 0xFAFF} |
||||||
|
Alphabetic_Presentation_Forms {"Alphabetic_Presentation_Forms" 0xFB00 0xFB4F} |
||||||
|
Arabic_Presentation_Forms-A {"Arabic_Presentation_Forms-A" 0xFB50 0xFDFF} |
||||||
|
Variation_Selectors {"Variation_Selectors" 0xFE00 0xFE0F} |
||||||
|
Combining_Half_Marks {"Combining_Half_Marks" 0xFE20 0xFE2F} |
||||||
|
CJK_Compatibility_Forms {"CJK_Compatibility_Forms" 0xFE30 0xFE4F} |
||||||
|
Small_Form_Variants {"Small_Form_Variants" 0xFE50 0xFE6F} |
||||||
|
Arabic_Presentation_Forms-B {"Arabic_Presentation_Forms-B" 0xFE70 0xFEFF} |
||||||
|
Halfwidth_and_Fullwidth_Forms {"Halfwidth_and_Fullwidth_Forms" 0xFF00 0xFFEF} |
||||||
|
Specials {"Specials" 0xFFF0 0xFFFF} |
||||||
|
} |
||||||
|
|
||||||
|
#Перевод из шестнадцатеричной системы в десятичную |
||||||
|
proc hex2dec {code} { return [format "%d" $code]} |
||||||
|
|
||||||
|
#Выбор наборов символов по маске |
||||||
|
proc getCharsets {rgx} { |
||||||
|
if {$rgx eq "-b"} { set rgx {math|arrow|misc} } |
||||||
|
|
||||||
|
set charsetList {} |
||||||
|
foreach charset [lsort [array names ::category]] { |
||||||
|
if {[regexp "(?i).*($rgx).*" $charset]} { |
||||||
|
lappend charsetList $charset |
||||||
|
} |
||||||
|
} |
||||||
|
return $charsetList |
||||||
|
} |
||||||
|
|
||||||
|
#Вывод таблицы символов |
||||||
|
proc showUTFCodes {charset} { |
||||||
|
foreach {category start end} $::category($charset) {} |
||||||
|
|
||||||
|
for {set i [hex2dec $start]} {$i <= [hex2dec $end]} {incr i} { |
||||||
|
set char [format "%c" $i] |
||||||
|
if {[regexp {[^[:space:]]} $char match]} { |
||||||
|
puts [format "%-40s%#5x: %s" $category $i $char] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
#-------------------------------------------- |
||||||
|
foreach charset [getCharsets [lindex $argv 0]] { |
||||||
|
catch {showUTFCodes $charset} |
||||||
|
} |
||||||
|
|
Loading…
Reference in new issue