tag:blogger.com,1999:blog-57867279527164943612024-03-08T19:07:02.250+03:00Лесные ИТ заметкиБлог CIO живущего в лесу в "Новой Москве"KSN135http://www.blogger.com/profile/18014597354648495010noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5786727952716494361.post-37569396671649296852013-12-10T09:16:00.002+04:002013-12-10T09:16:17.175+04:00Свежая OS X: что накатывать?<div dir="ltr" style="text-align: left;" trbidi="on">
<i>Кладу сюда как поминальник. </i><br />
Итак понеслась:<br />
1) для начала правильный shell<br />
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh<br />
2) Xcode и command-line tools из App Store<br />
3) затем, конечно, Home Brew<br />
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"<br />
4) переключалка<br />
http://punto.yandex.ru/download/<br />
5) конечно, Parallels Desktop<br />
дистрибутив http://www.parallels.com/ru/download/desktop/<br />
мои ключи https://www.parallels.com/ru/account/products/?<br />
6) расширение menumeters<br />
http://www.ragingmenace.com/software/menumeters/index.html<br />
7) MAMP PRO отсюда http://www.mamp.info/en/downloads/index.html<br />
8) TokenLok https://itunes.apple.com/ru/app/tokenlock/id402433482?mt=12<br />
<br />
Буду дополнять "по ходу пьесы"...<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/07015081122691189622noreply@blogger.com0tag:blogger.com,1999:blog-5786727952716494361.post-10771583444825578082013-11-04T13:19:00.004+04:002013-11-04T16:05:38.271+04:00Symfony2: памятка по созданию нового проекта<div dir="ltr" style="text-align: left;" trbidi="on">
<i>Кладу здесь, чтоб каждый раз не вспоминать...</i><br />
<br />
1. Обновляем композитора:<br />
<div style="text-align: left;">
<span style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">composer self-update</span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
2. Запускаем композитора на установку Symfony Framevork </div>
<div style="text-align: left;">
<span style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">composer create-project symfony/framework-standard-edition project/</span><span style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;"> </span></div>
<br />
3. Заходим в папку проекта<br />
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
cd project</div>
<br />
4. Удаляем содержимое папок кэша и логов:<br />
<div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
rm -rf app/cache/*</div>
</div>
<div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
rm -rf app/logs/*</div>
</div>
<br />
5. "Правильно" задаём права на эти папки (ниже версия для OS X, для других – <a href="http://symfony.com/doc/current/book/installation.html#configuration-and-setup" target="_blank">тут</a>):<br />
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1`</div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
<br /></div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
sudo chmod +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" </div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
app/cache app/logs</div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
<br /></div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" </div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
app/cache app/logs</div>
<br />
6. Инициализируем новый Git репозиторий и добавляем все файлы:<br />
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
git init</div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
git add -A .</div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
git commit -m 'Initial commit'</div>
<br />
7. Добавляем origin и отливаемся на сервер VCS:<br />
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
git remote add origin ssh://git@git.kalachev.ru/ksn135/project.git<br />
<br /></div>
<div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
git push -u origin --all </div>
<span style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;"><br /></span>
8. Очищаем кэш и публикуем assets:<br />
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
</div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
app/console cache:clear</div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
app/console assets:install --symlink</div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
app/console assetic:dump --force</div>
<i>В этот момент мы имеем работающий в dev версии пустой сайт проекта по адресу http://project/app_dev.php</i><br />
<br />
9. Добавляем propel и отключаем doctrine. Для начала правим app/config/config.yml<br />
<blockquote class="tr_bq">
<span style="background-color: #7f6000; color: #f1c232;"># Propel Configuration<br />propel:<br /> dbal:<br /> driver: "%database_driver%"<br /> user: "%database_user%"<br /> password: "%database_password%"<br /> dsn: "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%"</span> </blockquote>
<blockquote class="tr_bq">
<span style="background-color: #f3f3f3; color: #999999;"># Doctrine Configuration<br /># doctrine:<br /># dbal:<br /># driver: %database_driver%<br /># host: %database_host%<br /># port: %database_port%<br /># dbname: %database_name%<br /># user: %database_user%<br /># password: %database_password%<br /># charset: UTF8<br /># # if using pdo_sqlite as your database driver, add the path in parameters.yml<br /># # e.g. database_path: %kernel.root_dir%/data/data.db3<br /># # path: %database_path%<br /># orm:<br /># auto_generate_proxy_classes: %kernel.debug%<br /># auto_mapping: true</span></blockquote>
10. Правим файл app/AppKernel.php убираем Doctrine и добавляем Propel:<br />
<blockquote class="tr_bq">
// new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),<br />
new Propel\PropelBundle\PropelBundle(),</blockquote>
11. Правим конфигурацию композитора в файле composer.json.<br />
Добавляем в секцию "require":<br />
<blockquote class="tr_bq">
"propel/propel-bundle": "1.2.*",</blockquote>
<div>
Убираем из секции "required":</div>
<div>
<blockquote class="tr_bq">
"doctrine/orm": ">=2.2.3,<2.4-dev",<br />
"doctrine/doctrine-bundle": "1.2.*",</blockquote>
</div>
<div>
Добавляем в секцию "config" следующую строку:</div>
<div>
<blockquote class="tr_bq">
"component-dir": "web/components", </blockquote>
</div>
<div>
Добавляем в секцию "extra":</div>
<div>
<blockquote class="tr_bq">
"symfony-assets-install": "symlink", </blockquote>
</div>
<div>
11. Запускаем композитора для обновления пакетов, согласно новой конфигурации:</div>
<div>
<div style="background-color: black; color: #29f914; font-family: 'Andale Mono'; font-size: 12px;">
composer update</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<br />
<br />
<br />
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/07015081122691189622noreply@blogger.com2tag:blogger.com,1999:blog-5786727952716494361.post-2875693015405173802010-07-16T08:53:00.001+04:002010-08-24T07:50:05.799+04:00Установка DB2 и 1С на Linux Ubuntu 10.04 LTS<div></div>Итак, мальчики и девочки придвигайтесь поближе к своим мониторам.<br />
<br />
<br />
<div>Мы с вами сегодня пошагово пройдём весь процесс установки с нуля бесплатного сервера баз данных IBM DB2 Express-C v9.5 (сборка 22521) и сервера 1С:Предприятия 8.2 (версия 8.2.11.236) на сервер под управлением 64-битной операционной системы Linux Ubuntu 10.04.<br />
<br />
</div><div>Установку операционной системой оставим за рамками данного повествования. Для начала внесем корректировки в параметры ядра системы, а именно в файл /etc/sysctl.conf, согласно официальной документации:</div><div></div><blockquote><div>kernel.sem = 250 256000 32 1024</div><div>kernel.msgmax = 65535</div><div>kernel.msgmnb = 65535</div><div></div></blockquote><div>Следующие параметры зависят от количества установленной памяти в вашем сервере.Например, в моём случае, когда установлено 12 Гб, значения следующие:<br />
</div><blockquote><div>kernel.shmmax = 12619325440</div><div>kernel.shmall = 2772801</div><div></div></blockquote><div>Как расчитывать эти значения ?</div><div>Параметр shmmax равен физическому размеру оперативной памяти в сервере. Параметр shmall задается в количестве 4K блоков памяти умещающихся в 90% физической памяти. Вам поможет следующая формула: shmall = shmmax * 0,9 / 4096. </div><div>Итак, Вы внесли изменения в файл /etc/sysctl.conf, теперь чтоб они вступили в силу необходимо выполнить нижеследующую команду:</div><div><b></b></div><blockquote><div><b>sudo sysctl -p</b></div></blockquote><div>Теперь нам понадобятся дистрибутивы программ, которые мы возьмем с сайта 1С. Перейдите в домашний каталог:</div><div><b></b></div><blockquote><div><b>cd ~</b></div><div></div></blockquote><div><b></b>Для начала скачаем IB DB2 (426M):</div><div><b></b></div><blockquote><div><b>wget http://downloads.v8.1c.ru/get/Info/Platform/DB2_22251/v9.5.4_linuxx64_expc_1C.tar.gz</b></div><div></div></blockquote><div>Распакуем полученный дистрибутив (он распаковался в папку expc):</div><div><b></b></div><blockquote><div><b>tar xfz v9.5.4_linuxx64_expc_1C.tar.gz</b></div><div></div></blockquote><div>Качнём дистрибутив платформы (128M): </div><div><b></b></div><blockquote><div><b>wget http://dl01.v8.1c.ru/get/Info/Platform/8_2_11_236/setupdeb64.rar</b></div><div></div></blockquote><div>Обратите внимание на следующий забавный факт, что дистрибуция платформы 1C под Linux запакована WinRar'ом... :-)</div><div>Соответственно, сразу устанавливаем распаковщик, если он у вас ещё не стоял:</div><div><b></b></div><blockquote><div><b>sudo apt-get install unrar</b></div><div></div></blockquote><div><b></b>Теперь распаковываем выкаченный пакет, чтоб получить deb-пакеты:</div><div><b></b></div><blockquote><div><b>unrar x setupdeb64.rar</b></div><div></div></blockquote><div><b></b>Для запуска и работы IBM DB2 на 64-битной Linux Ubuntu нужна библиотека libstdc++.so.5, которую мы сейчас поставим вручную. Для начало выкачаем её deb-архивы из репозитория для разных платформ:<br />
<b></b><br />
<b><blockquote>wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-20_amd64.deb<br />
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-20_i386.deb</blockquote></b></div><div><b></b>Сначалу принудительно установим библиотеку для i386:</div><div><b></b></div><blockquote><div><b>sudo dpkg --force-architecture -i libstdc++5_3.3.6-20_i386.deb</b></div><div></div></blockquote><div><b></b>Вручную перемещаем в "нужный" каталог:</div><div><b></b></div><blockquote><div><b>sudo mv /usr/lib/libstdc++.so.5* /usr/lib32/</b></div><div></div></blockquote><div>А теперь нативную библиотеку:</div><div><b></b></div><blockquote><div><b>sudo dpkg -i libstdc++5_3.3.6-20_amd64.deb</b></div><div></div></blockquote><div>Проверяем:</div><div><b></b></div><blockquote><div><b>sudo updatedb</b></div><div><b>locate libstdc++.so.</b></div></blockquote><div><b></b></div><div>Должны получить такой вывод на консоли:</div><div></div><blockquote><div>/usr/lib/libstdc++.so.5</div><div>/usr/lib/libstdc++.so.5.0.7</div><div>/usr/lib/libstdc++.so.6</div><div>/usr/lib/libstdc++.so.6.0.13</div><div>/usr/lib32/libstdc++.so.5</div><div>/usr/lib32/libstdc++.so.5.0.7</div><div>/usr/lib32/libstdc++.so.6</div><div>/usr/lib32/libstdc++.so.6.0.13</div></blockquote><div></div><div>Так же нужно поставить стандартным образом следующие пакеты, иначе инсталляция всё равно будет ругаться на то что, не может найти libstdc++.so.5 и libaio.so.1 :</div><div><b></b></div><blockquote><div><b>sudo apt-get install ia32-libs libaio-dev</b></div><div></div></blockquote><div>Уф. Вроде "усё" выкачали и распаковали.<br />
<br />
</div><div>Для начала установим сам сервер 1С:</div><div><b></b></div><blockquote><div><b>sudo dpkg -i *.deb</b></div><div></div></blockquote><div>Дополнительно поставим часть пакетов:<br />
<b></b></div><blockquote><div><b>sudo apt-get install imagemagick msttcorefonts libgsf-1-114 texlive-base texlive-binaries</b></div><div></div></blockquote><div>Проверим все ли библиотеки установлены:</div><div><b></b></div><blockquote><div><b>sudo /opt/1C/v8.2/x86_64/utils/config_server</b></div><div></div></blockquote><div>Теперь запустим сервер 1С:Предприятия:<br />
<b></b></div><blockquote><div><b>sudo /etc/init.d/srv1cv82 start</b></div><div></div></blockquote><div>И настроим автозапуск:</div><div><b></b></div><blockquote><div><b>sudo update-rc.d srv1cv82 defaults</b></div><div></div></blockquote><div><b></b>Готово.<br />
<br />
</div><div>Теперь примемся за установку DB2. Как вы помните у нас лежит распакованный дистрибутив в папке ~/expc. Перейдем туда:</div><div><b></b></div><blockquote><div><b>cd ~/expc</b></div><div></div></blockquote><div>Запускаем установщик:</div><div><b></b></div><blockquote><div><b>sudo ./db2_install</b></div><div></div></blockquote><div>Оставляем каталог по умолчанию:</div><div><b></b><br />
<b><blockquote>нет</blockquote></b></div><div><b></b>После чего устанавливаем сам продукт:</div><div><b></b><br />
<b><blockquote>EXP</blockquote></b></div><div><b></b>Теперь начинается самое интересное. Зайдём под правами суперюзера:</div><div><b></b></div><blockquote><div><b>sudo -i</b></div><div></div></blockquote><div><b></b>Создаём пользователей необходимых для работы DB2:</div><div><b></b></div><blockquote><div><b>useradd -m dasusr1</b></div><div><b>useradd -m db2fenc1</b></div><div><b>useradd -m db2inst1</b></div></blockquote><div><b></b></div><div>Задаем им пароли:</div><div><b></b></div><blockquote><div><b>passwd dasusr1</b></div><div><b>passwd db2fenc1</b></div><div><b>passwd db2inst1</b></div></blockquote><div><b></b></div><div>Создаем DB2 Administration Server (DAS):</div><div><b></b></div><blockquote><div><b>cd /opt/ibm/db2/V9.5/instance/</b></div><div><b>./dascrt dasusr1</b></div></blockquote><div><b></b></div><div>Создаим экземпляр DB2, настроенный на работу через порт 50000 (порт DB2 по-умолчанию):</div><div><b></b><br />
<b><blockquote>./db2icrt -u db2fenc1 -p 50000 db2inst1</blockquote></b></div><div>Зайдём под пользователем db2inst1:</div><div><b></b><br />
<b><blockquote>su - db2inst1</blockquote></b></div><div><b></b>Конфигурируем DB2 для работы с 1С:</div><div><b></b><br />
<b><blockquote>db2set DB2_WORKLOAD=1C</blockquote></b></div><div><b></b>Запускаем экземпляр DB2:</div><div><b></b><br />
<b><blockquote>db2start</blockquote></b></div><div><b></b>Возвращаемся в root через Ctrl-D (logout)</div><div>Настраиваем автозапуск сервера:</div><div><b></b><br />
<b><blockquote>./db2iauto -on db2inst1</blockquote></b></div><div><b></b>Готово.</div><div><br />
Теперь надо подружить 1С и DB2.</div><div>Для начала выясним код группы доступа, которая является основной для запущенного экземпляра DB2:</div><div><b></b></div><blockquote><div><b>id db2inst1</b></div><div></div></blockquote><div>У меня вот такой вывод:</div><div><br />
<blockquote>uid=1006(db2inst1) gid=1007(db2inst1) группы=<span class="Apple-style-span" style="color: red;">1007</span>(db2inst1),1005(dasusr1)</blockquote></div><div>После этого необходимо добавить пользователя usr1cv81 в эту группу доступа (в моём случае, это <span class="Apple-style-span" style="color: red;">1007</span>):</div><div><b></b><br />
<b><blockquote>usermod -G <span class="Apple-style-span" style="color: red;">1007</span> usr1cv82</blockquote></b>Чтобы сервер 1С:Предприятия видел динамические библиотеки DB2, то их нам надо их добавить в пути поиска. а так же задать "правильные" переменные окружения для корректной работы. Для этого добавим в конец файла /home/usr1cv82/.profile подключение профиля от нашего экземпляра DB2:</div><div><b></b></div><blockquote><div><b>echo ". /home/db2inst1/sqllib/db2profile" >> /home/usr1cv82/.profile </b></div><div></div></blockquote><div>Теперь перезапустим сервер 1С:</div><div><b></b></div><blockquote><div><b>sudo /etc/init.d/srv1cv82 restart</b></div><div></div></blockquote><div>Готово.<br />
<br />
</div><div>Таким образом мы получили работающую связку 1С и DB2 на одном сервере под управлением Linux Ubuntu 10.04 LTS.<br />
<div><div><div><div><div><br />
</div><div><span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; color: #330099; font-family: 'Times New Roman'; font-size: large; white-space: normal;"></span></span></div></div></div></div></div></div>KSN135http://www.blogger.com/profile/18014597354648495010noreply@blogger.com5tag:blogger.com,1999:blog-5786727952716494361.post-3602799644626300592010-04-20T20:46:00.000+04:002010-04-20T23:09:41.408+04:00Yaml-формат и GEdit<div><div><b><span class="Apple-style-span" style="font-weight: normal;"><div><b><span class="Apple-style-span" style="font-weight: normal; "><div><span class="Apple-style-span" style="font-family:Verdana, sans-serif;font-size:100%;"><span class="Apple-style-span" style="font-size: 12px;"><b><div><span class="Apple-style-span" style="font-weight: normal;"><h4>Хозяйке на заметку</h4></span></div><div><span class="Apple-style-span" style="font-weight: normal;">Я пишу в основном под PHP Symfony Framework, поэтому часто сталкиваюсь с редактированием YAML-файлов. </span></div><div><span class="Apple-style-span" style="font-weight: normal;">Окончательно переполз под Ubuntu и с удивлением обнаружил что боковая панель (File Browser) в GEdit не показывает в списке файлов и каталогов текстовые файлы *.yml, а так же отсутствует подсветка синтаксиса для данного типа файлов.<habracut></span></div><div><span class="Apple-style-span" style="font-weight: normal;">Как выяснилось это происходит из-за того что база MIME-типов считает что файлы формат YAML не является текстовыми файлами, а умный GEdit отображает лишь текстовые файлы в своей боковой панели.</span></div><div><span class="Apple-style-span" style="font-weight: normal;">Итак, что же делать? Добавим новый MIME-тип:</span></div><div><span class="Apple-style-span" style="font-weight: normal;">1) Создадим файлик <b>x-yaml.xml</b> со следующим содержанием:</span></div><div><span class="Apple-style-span" style="font-weight: normal;"><code></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><?xml version="1.0" encoding="utf-8"?></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><mime-type type="text/x-yaml"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <comment>YAML document</comment></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <comment xml:lang="ru">Документ - YAML</comment></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <comment xml:lang="en_GB">YAML document</comment></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <acronym>YAML</acronym></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <sub-class-of type="text/plain"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <glob pattern="*.yml"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <glob pattern="*.yaml"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <expanded-acronym>Yaml Aint Markup Language</expanded-acronym></span></div><div><span class="Apple-style-span" style="font-weight: normal;"></mime-type></span></div><div><span class="Apple-style-span" style="font-weight: normal;"></mime-info></span></div><div><span class="Apple-style-span" style="font-weight: normal;"></code></span></div><div><span class="Apple-style-span" style="font-weight: normal;">2) Положим его в <b>/usr/share/mime/packages</b></span></div><div><span class="Apple-style-span" style="font-weight: normal;">3) Выполним <b>sudo update-mime-database /usr/share/mime</b> для обновления </span></div><div><span class="Apple-style-span" style="font-weight: normal;">Готово, теперь GEdit прекрасно показывает и открывает YAML-фалики.</span></div><div><span class="Apple-style-span" style="font-weight: normal;">Но что это? GEdit теперь видит, открывает, но не знает как раскрасить этот формат файла и не имеет соответствующего файла расцветки. </span></div><div><span class="Apple-style-span" style="font-weight: normal;">Что делать? Создаем свой файл "расцветки":</span></div><div><span class="Apple-style-span" style="font-weight: normal;">4) Создадим файлик <b>yaml.lang</b> с нижеследующим содержанием:</span></div><div><span class="Apple-style-span" style="font-weight: normal;"><code></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><?xml version="1.0" encoding="UTF-8"?></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><!--</span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> Copyright (C) 2009 Masood Behabadi <m.behabadi AT gmail DOT com></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> This program is free software: you can redistribute it and/or modify</span></div><div><span class="Apple-style-span" style="font-weight: normal;"> it under the terms of the GNU General Public License as published by</span></div><div><span class="Apple-style-span" style="font-weight: normal;"> the Free Software Foundation, either version 3 of the License, or</span></div><div><span class="Apple-style-span" style="font-weight: normal;"> (at your option) any later version.</span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> This program is distributed in the hope that it will be useful,</span></div><div><span class="Apple-style-span" style="font-weight: normal;"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div><span class="Apple-style-span" style="font-weight: normal;"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div><span class="Apple-style-span" style="font-weight: normal;"> GNU General Public License for more details.</span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> You should have received a copy of the GNU General Public License</span></div><div><span class="Apple-style-span" style="font-weight: normal;"> along with this program. If not, see <http://www.gnu.org/licenses/>. </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;">--></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><language id="yaml" _name="YAML" version="2.0" _section="Others"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <metadata></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <property name="globs">*.yaml;*.yml;</property></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <property name="line-comment-start">#</property></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </metadata></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <styles></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="scalar" _name="Block literal" map-to="def:string"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="comment" _name="Comment" map-to="def:comment"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="string" _name="String" map-to="def:string"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="anchor" _name="Anchor" map-to="def:identifier"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="tag" _name="Tag" map-to="def:preprocessor"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="alias" _name="Alias" map-to="def:type"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="map-key" _name="Map key" map-to="def:keyword"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="directive" _name="Directive" map-to="def:shebang"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="null" _name="Null" map-to="def:special-constant"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="bool" _name="Boolean" map-to="def:boolean"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="int" _name="Integer" map-to="def:decimal"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <style id="float" _name="Floating point" map-to="def:floating-point"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </styles></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <definitions></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <define-regex id="ischar">[^-\?:,\[\]\{\}#&amp;*!|&gt;'"%@\s]</define-regex></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <define-regex id="lschar">[\s\[\{,]</define-regex></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <define-regex id="rschar">[\s\]\},]</define-regex></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="scalar"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <start>(?&lt;=^|\s)[|&gt;]$</start></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context end-parent="true" style-ref="scalar"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <start>^(?'indent'\s+)</start></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <end>^(?!\%{indent@start})</end></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context end-parent="true"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?=.)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="alias" style-ref="alias"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?&lt;=^|\s)\*\%{ischar}+(?=$|\s)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="tag" style-ref="tag"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?&lt;=^|\s)!(?:\%{ischar}*)?!?\%{ischar}+(?=$|\s)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="anchor" style-ref="anchor"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?&lt;=^|\s)&amp;\%{ischar}+(?=$|\s)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="string" end-at-line-end="true" style-ref="string"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <start>(?&lt;=^|\%{lschar})(?'q'["'])</start></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <end>[^\\]\%{q@start}</end></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="unquoted-string" end-at-line-end="true" style-ref="string"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <start>(?=\%{ischar}|[:-\?\]\}]\S)</start></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <end>(?=:\s|:$|\s#)</end></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="inline-unquoted" end-at-line-end="true" style-ref="string"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <start>(?=\%{ischar}|-\S)</start></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <end>(?=[:,?\[\{\]\}]|\s#)</end></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="null" style-ref="null"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?:null)(?=\s*$|\s+#)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="inline-null" style-ref="null"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?:null)(?=\s*[:,?\[\{\]\}]|\s+#)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="bool" style-ref="bool"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?:true|false)(?=\s*$|\s+#)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="inline-bool" style-ref="bool"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?:true|false)(?=\s*[:,?\[\{\]\}]|\s+#)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="inline-int" style-ref="int"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>-?(?:0|[1-9][0-9]*)(?=\s*[:,?\[\{\]\}]|\s+#)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="int" style-ref="int"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>-?(?:0|[1-9][0-9]*)(?=\s*$|\s+#)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="inline-float" style-ref="float"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>-?(?:0|[1-9][0-9]*)(?:[.][0-9]*)?(?:[eE][-+]?[0-9]+)?(?=\s*[:,?\[\{\]\}]|\s+#)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="float" style-ref="float"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>-?(?:0|[1-9][0-9]*)(?:[.][0-9]*)?(?:[eE][-+]?[0-9]+)?(?=\s*$|\s+#)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="comment" style-ref="comment"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?&lt;=^|\s)#.*$</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="inline-sequence"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <start>(?&lt;=^|\s)\[</start></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="scalar"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-sequence"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-map"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="comment"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="alias"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="tag"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="anchor"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="string"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-null"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-bool"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-int"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-float"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-unquoted"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context end-parent="true"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>\]</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="inline-map"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <start>(?&lt;=^|\s)\{</start></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="scalar"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-sequence"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-map"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="comment"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="alias"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="tag"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="anchor"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="string"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-null"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-bool"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-int"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-float"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-unquoted"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context end-parent="true"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>\}</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="map"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>(?&lt;=^|\s)((?:[^:]|:(?=\S))+)(?::\s|:$)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context sub-pattern="1" style-ref="map-key"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="sequence"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>^\s*-\s+</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="document" style-ref="comment"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>^(?:-{3}|[.]{3})(?:\s|$)</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="directive" style-ref="directive"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <match>^%\%{ischar}(?:\%{ischar}|\s)*</match></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context id="yaml"></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="directive"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="document"/> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="scalar"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="sequence"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-sequence"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="inline-map"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="comment"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="null"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="bool"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="int"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="float"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="alias"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="tag"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="anchor"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="map"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="string"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> <context ref="unquoted-string"/></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </include></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </context></span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"> </definitions> </span></div><div><span class="Apple-style-span" style="font-weight: normal;"><br /></span></div><div><span class="Apple-style-span" style="font-weight: normal;"></language></span></div><div><span class="Apple-style-span" style="font-weight: normal;"></code></span></div><div><span class="Apple-style-span" style="font-weight: normal;">5) Положим его в </span>/usr/share/gtksourceview-2.0/language-specs</div><div><span class="Apple-style-span" style="font-weight: normal;">Ву-а-ля. Миссия выполнена. Мы подружили GEDIT и YAML.</span></div><div><span class="Apple-style-span" style="font-weight: normal;">Теперь мы можем полноценно работать с документами в этом формате.</span></div><div><br /></div></b></span></span></div></span></b></div></span></b></div></div>KSN135http://www.blogger.com/profile/18014597354648495010noreply@blogger.com2