<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Noname yet &#187; debian</title>
	<atom:link href="http://dcsk.org.ua/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://dcsk.org.ua</link>
	<description></description>
	<lastBuildDate>Thu, 18 Feb 2010 22:00:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Добавление репозиториев к gitosis</title>
		<link>http://dcsk.org.ua/2010/01/dobavlenie-repozitoriev-k-gitosis/</link>
		<comments>http://dcsk.org.ua/2010/01/dobavlenie-repozitoriev-k-gitosis/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 13:58:09 +0000</pubDate>
		<dc:creator>dcsk</dc:creator>
				<category><![CDATA[IT статьи]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[gitosis]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://dcsk.org.ua/?p=59</guid>
		<description><![CDATA[Итак, допустим мы получили &#8220;командный репозиторий&#8221; командой
1git clone gitosis@hostname:gitosis-admin.git
В полученой папке имеем файл gitosis.conf  и папку keydir. В папке keydir хранятся RSA ключи в виде имяпользователя@имя-компьютера.pub . В файле же и хранятся все настройки. Все права хранятся по группам, то есть:

123&#91;group gitosis-admin&#93;
writable = gitosis-admin
members = dcsk@note
Для добавления репозитория надо:
Добавить права на запись в него, например [...]]]></description>
			<content:encoded><![CDATA[<p>Итак, допустим мы получили &#8220;командный репозиторий&#8221; командой</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">git clone gitosis<span style="color: #000000; font-weight: bold;">@</span><span style="color: #c20cb9; font-weight: bold;">hostname</span>:gitosis-admin.git</div></td></tr></tbody></table></div>
<p>В полученой папке имеем файл gitosis.conf  и папку keydir. В папке keydir хранятся RSA ключи в виде <em>имяпользователя@имя-компьютера.pub </em>. В файле же и хранятся все настройки. Все права хранятся по группам, то есть:<br />
<span id="more-59"></span></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>group gitosis-admin<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
writable = gitosis-admin<br />
members = dcsk<span style="color: #000000; font-weight: bold;">@</span>note</div></td></tr></tbody></table></div>
<p>Для добавления репозитория надо:</p>
<p>Добавить права на запись в него, например так:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>group gitosis-admin<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
writable = gitosis-admin my-repo<br />
members = dcsk<span style="color: #000000; font-weight: bold;">@</span>note</div></td></tr></tbody></table></div>
<p>После чего, надо добавить эти изменения на сервер:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">git commit <span style="color: #660033;">-a</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Added access to repo&quot;</span><br />
git push</div></td></tr></tbody></table></div>
<p>Допустим, что вы находитесь в папке, на основе которой хотите создать репозиторий. Тогда его создать можно так:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">git init .<br />
git remote add origin git<span style="color: #000000; font-weight: bold;">@</span><span style="color: #c20cb9; font-weight: bold;">hostname</span>:my-repo.git<br />
git add <span style="color: #000000; font-weight: bold;">*</span><br />
git commit <span style="color: #660033;">-a</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Initial commit&quot;</span><br />
git push origin master:refs<span style="color: #000000; font-weight: bold;">/</span>heads<span style="color: #000000; font-weight: bold;">/</span>master</div></td></tr></tbody></table></div>
<p>Итак, вы создали свой репозиторий.</p>
]]></content:encoded>
			<wfw:commentRss>http://dcsk.org.ua/2010/01/dobavlenie-repozitoriev-k-gitosis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Установка gitosis</title>
		<link>http://dcsk.org.ua/2010/01/ustanovka_gitosis-debian_ubuntu/</link>
		<comments>http://dcsk.org.ua/2010/01/ustanovka_gitosis-debian_ubuntu/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 13:14:20 +0000</pubDate>
		<dc:creator>dcsk</dc:creator>
				<category><![CDATA[IT статьи]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[gitosis]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://dcsk.org.ua/2010/01/53/</guid>
		<description><![CDATA[Для установки репозитория нам надо:

Установить gitosis

12apt-get update
apt-get install gitosis
После этого должен создатся пользователь git, однако у меня такого не создалось, создался пользователь gitosis. Проверить наличие пользователя можно так:

1cat /etc/passwd&#124;grep git
Если у вас тоже его нет &#8211; надо его создать. Например, так:
12345678sudo adduser \
--system \
--shell /bin/sh \
--gecos 'git version control' \
--group \
--disabled-password \
--home /home/git \
git
Если же [...]]]></description>
			<content:encoded><![CDATA[<p>Для установки репозитория нам надо:</p>
<ul>
<li>Установить gitosis</li>
</ul>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> update<br />
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> gitosis</div></td></tr></tbody></table></div>
<p>После этого должен создатся пользователь git, однако у меня такого не создалось, создался пользователь gitosis. Проверить наличие пользователя можно так:<br />
<span id="more-53"></span></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> git</div></td></tr></tbody></table></div>
<p>Если у вас тоже его нет &#8211; надо его создать. Например, так:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> adduser \<br />
<span style="color: #660033;">--system</span> \<br />
<span style="color: #660033;">--shell</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sh</span> \<br />
<span style="color: #660033;">--gecos</span> <span style="color: #ff0000;">'git version control'</span> \<br />
<span style="color: #660033;">--group</span> \<br />
<span style="color: #660033;">--disabled-password</span> \<br />
<span style="color: #660033;">--home</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>git \<br />
git</div></td></tr></tbody></table></div>
<p>Если же вас устраивает пользователь gitosis в адресе пользователя (ака gitosis@myserver.com:myreponame) то предыдущий пункт можно пропустить и далее заменять git на gitosis соотв-но.</p>
<p>Далее перейдем в консоль созданного пользователя.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">su git</div></td></tr></tbody></table></div>
<p>В файл id_rsa.pub , находящийся в домашней папке этого пользователя (т.е. /home/git/id_rsa.pub ) надо скопировать публичный <a href="http://en.wikipedia.org/wiki/RSA">RSA</a> ключ, после чего можно запустить инициализацию репозитория:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">git<span style="color: #000000; font-weight: bold;">@</span>server:~$ gitosis-init <span style="color: #000000; font-weight: bold;">&amp;</span>lt; id_rsa.pub<br />
Initialized empty Git repository <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>gitosis-admin.git<span style="color: #000000; font-weight: bold;">/</span><br />
Reinitialized existing Git repository <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>gitosis-admin.git<span style="color: #000000; font-weight: bold;">/</span></div></td></tr></tbody></table></div>
<p>После чего можно проверять работоспособность с компьютера, с которого был скопирован RSA ключ.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">$git</span> clone git<span style="color: #000000; font-weight: bold;">@</span><span style="color: #c20cb9; font-weight: bold;">hostname</span>:gitosis-admin.git<br />
Initialized empty Git repository <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dcsk<span style="color: #000000; font-weight: bold;">/</span>gitosis-admin<span style="color: #000000; font-weight: bold;">/</span>.git<span style="color: #000000; font-weight: bold;">/</span><br />
remote: Counting objects: <span style="color: #000000;">5</span>, done.<br />
remote: Compressing objects: <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">4</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, done.<br />
remote: Total <span style="color: #000000;">5</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>delta <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, reused <span style="color: #000000;">5</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>delta <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Receiving objects: <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, done.</div></td></tr></tbody></table></div>
<p>Если у вас все прошло так же &#8211; поздравляю, вы установили gitosis. Теперь можно переходить к добавлению репозиториев, про что будет написано в следующем посте.</p>
]]></content:encoded>
			<wfw:commentRss>http://dcsk.org.ua/2010/01/ustanovka_gitosis-debian_ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Настройка Counter-strike сервера под debian(ubuntu)</title>
		<link>http://dcsk.org.ua/2009/08/nastrojka-counter-strike-servera-pod-debianubuntu/</link>
		<comments>http://dcsk.org.ua/2009/08/nastrojka-counter-strike-servera-pod-debianubuntu/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 09:56:41 +0000</pubDate>
		<dc:creator>dcsk</dc:creator>
				<category><![CDATA[Игровые сервера]]></category>
		<category><![CDATA[Counter-Strike]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[hlds]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[steam]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[игры]]></category>
		<category><![CDATA[сервера]]></category>

		<guid isPermaLink="false">http://dcsk.org.ua/?p=44</guid>
		<description><![CDATA[Данная статья является универсальным руководством для любого дистрибутива linux, но писался для debian, потому могут быть разного рода особенности.
Итак, установка и настройка Counter-Strike сервера на linux на примере debian/ubuntu.
Установим необходимые в дальнейшем пакеты:
#apt-get install gdb gawk screen
Скачивание сервера Counter-strike с steam
Первым делом создадим пользователя и авторизуемся как он:
123$sudo adduser cs
#sudo su cs
$cd ~
Скачаем и запустим [...]]]></description>
			<content:encoded><![CDATA[<p>Данная статья является универсальным руководством для любого дистрибутива linux, но писался для debian, потому могут быть разного рода особенности.</p>
<p>Итак, установка и настройка Counter-Strike сервера на linux на примере debian/ubuntu.</p>
<h3><span id="more-44"></span>Установим необходимые в дальнейшем пакеты:</h3>
<p>#apt-get install gdb gawk screen</p>
<h3>Скачивание сервера Counter-strike с steam</h3>
<p>Первым делом создадим пользователя и авторизуемся как он:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">$sudo</span> adduser cs<br />
<span style="color: #666666; font-style: italic;">#sudo su cs</span><br />
<span style="color: #007800;">$cd</span> ~</div></td></tr></tbody></table></div>
<p>Скачаем и запустим hldsupdatetool:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">$wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>storefront.steampowered.com<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>hldsupdatetool.bin<br />
<span style="color: #007800;">$chmod</span> +x hldsupdatetool.bin</div></td></tr></tbody></table></div>
<p>Вводим yes, что соглашаемся с правилами и обовляем саму утилиту скачивания:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Enter <span style="color: #ff0000;">'yes'</span> to accept this agreement, <span style="color: #ff0000;">'no'</span> to decline: <span style="color: #c20cb9; font-weight: bold;">yes</span><br />
extracting steam.tar.Z...done<br />
$ .<span style="color: #000000; font-weight: bold;">/</span>steam<br />
Checking bootstrapper version ...<br />
Getting version 34 of Steam HLDS Update Tool<br />
Downloading. . . . . . . . . . .<br />
Steam Linux Client updated, please retry the <span style="color: #7a0874; font-weight: bold;">command</span></div></td></tr></tbody></table></div>
<p>Итак, теперь можно узнать опции запуска:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$.<span style="color: #000000; font-weight: bold;">/</span>steam<br />
Checking bootstrapper version ...<br />
<br />
Use: steam <span style="color: #660033;">-command</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt;<span style="color: #7a0874; font-weight: bold;">command</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #7a0874; font-weight: bold;">&#91;</span>parameters<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>flags<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<br />
Commands:<br />
<br />
update: Install or update HLDS<br />
<br />
parameters:<br />
<span style="color: #660033;">-game</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt;game<span style="color: #000000; font-weight: bold;">&amp;</span>gt;            -   Game name: use <span style="color: #ff0000;">'list'</span> to see available games<br />
<span style="color: #660033;">-dir</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt;installdir<span style="color: #000000; font-weight: bold;">&amp;</span>gt;       -   HLDS Install <span style="color: #c20cb9; font-weight: bold;">dir</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #c20cb9; font-weight: bold;">dir</span> not specified, will use value from <span style="color: #c20cb9; font-weight: bold;">last</span> run of tool<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<br />
flags:<br />
-verify_all             -   Verify all HLDS files are up to <span style="color: #c20cb9; font-weight: bold;">date</span><br />
-retry                  -   Automatically retry every 30 seconds <span style="color: #000000; font-weight: bold;">if</span> the Steam Network is busy<br />
-remember_password      -   Remember password <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">if</span> a username is supplied<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<br />
For example: steam <span style="color: #660033;">-command</span> update <span style="color: #660033;">-game</span> cstrike <span style="color: #660033;">-dir</span> <span style="color: #000000; font-weight: bold;">/</span>hlds<br />
<br />
version: View installed versions<br />
<br />
list: View available games<br />
<br />
Optional parameters <span style="color: #000000; font-weight: bold;">for</span> all commands:<br />
<br />
<span style="color: #660033;">-username</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt;username<span style="color: #000000; font-weight: bold;">&amp;</span>gt;    -   Steam account username <span style="color: #7a0874; font-weight: bold;">&#40;</span>only needed to access limited content<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #660033;">-password</span> <span style="color: #000000; font-weight: bold;">&amp;</span>lt;password<span style="color: #000000; font-weight: bold;">&amp;</span>gt;    -   Steam account password <span style="color: #7a0874; font-weight: bold;">&#40;</span>only needed to access limited content<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></td></tr></tbody></table></div>
<p>Так как нужен cs сервер в папке hlds_cs, то мы ее создадим и запустим загрузку:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">$mkdir</span> hlds_cs<br />
$.<span style="color: #000000; font-weight: bold;">/</span>steam <span style="color: #660033;">-command</span> update <span style="color: #660033;">-game</span> cstrike <span style="color: #660033;">-dir</span> .<span style="color: #000000; font-weight: bold;">/</span>hlds_cs</div></td></tr></tbody></table></div>
<h3>Создание скриптов запуска и автоматизация запуска</h3>
<p>Для создания скрипта запуска надо открыть своим любимым редактором файл /etc/init.d/cs (либо с любым другим названием) с правами суперпользователя и вставить туда такой код:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#! /bin/bash</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Start the Counter-Strike dedicated server.</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># AUTHORS :</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Julien Escario ( pandemik@azilog.net )</span><br />
<span style="color: #666666; font-style: italic;"># &amp;amp;</span><br />
<span style="color: #666666; font-style: italic;"># Cedric Rochat ( crochat@younics.org )</span><br />
<span style="color: #666666; font-style: italic;"># &amp;amp;</span><br />
<span style="color: #666666; font-style: italic;"># Cmdr._Firewalker ( cmdr._firewalker@web.de )</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># ===========================================</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># What you need:</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Linux :)</span><br />
<span style="color: #666666; font-style: italic;"># awk</span><br />
<span style="color: #666666; font-style: italic;"># screen</span><br />
<span style="color: #666666; font-style: italic;"># the hlds_l &amp;amp; cstrike files (obtainable via steam)</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># How to use:</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Edit the CS_USER-Var to the user running your cs-servers</span><br />
<span style="color: #666666; font-style: italic;"># Edit the DIR-Var to fit your system (just contains the path to the dir that contains hlds_run)</span><br />
<span style="color: #666666; font-style: italic;"># Edit the PARAMS-Var to fit your needs</span><br />
<span style="color: #666666; font-style: italic;"># - standard is startup as internet server</span><br />
<span style="color: #666666; font-style: italic;"># if you use multiple scripts on one system you should change the NAME-var (otherwise</span><br />
<span style="color: #666666; font-style: italic;"># &nbsp; all will be stopped if you run the script with &quot;stop&quot;, and status will be useless)</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># When this is done, copy the file to /etc/rc.d/init.d (or whereever your system stores the</span><br />
<span style="color: #666666; font-style: italic;"># scripts for starting the services) and set the execute permission.</span><br />
<span style="color: #666666; font-style: italic;"># Now you can link the script to your runlevel-dir, here's an example for runlevel 3:</span><br />
<span style="color: #666666; font-style: italic;"># ln -s /etc/rc.d/init.d/hlds /etc/rc.d/rc3.d/S90hlds</span><br />
<span style="color: #666666; font-style: italic;"># ln -s /etc/rc.d/init.d/hlds /etc/rc.d/rc3.d/K50hlds</span><br />
<span style="color: #666666; font-style: italic;"># or use update-rc.d if you got a system using that tool (like Debian, see manpage)</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Or use it manually like:</span><br />
<span style="color: #666666; font-style: italic;"># ./hlds start</span><br />
<span style="color: #666666; font-style: italic;"># ./hlds stop</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># To see the server-console start the script with the parameter &quot;watch&quot;.</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># DOC by jwm (jwm@counter-strike.de)</span><br />
<br />
<span style="color: #666666; font-style: italic;"># !!!!!!!!!!!!!! CHANGE THIS TO THE USER YOU USE FOR YOUR SERVER !!!!!!!!!!!!!!!</span><br />
<span style="color: #007800;">CS_USER</span>=csserveruser<br />
<br />
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<br />
<br />
<span style="color: #666666; font-style: italic;"># # DON'T FORGET TO CHANGE THE PATH TO YOUR NEEDS!</span><br />
<span style="color: #007800;">DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>hlds<br />
<br />
<span style="color: #007800;">DAEMON</span>=hlds_run<br />
<br />
<span style="color: #666666; font-style: italic;"># LAN server:</span><br />
<span style="color: #666666; font-style: italic;"># PARAMS=&quot;-game cstrike -nomaster -insecure +sv_lan 1 +maxplayers 16 +map de_dust&quot;</span><br />
<span style="color: #666666; font-style: italic;"># Internet server:</span><br />
<span style="color: #007800;">PARAMS</span>=<span style="color: #ff0000;">&quot;-game cstrike +map de_dust +maxplayers 12 -port 27015&quot;</span><br />
<br />
<span style="color: #007800;">NAME</span>=csserver<br />
<span style="color: #007800;">DESC</span>=<span style="color: #ff0000;">&quot;CS dedicated server&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># No edits (should be) necessary beyond this line</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #c20cb9; font-weight: bold;">awk</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;You need awk for this script&quot;</span>; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #c20cb9; font-weight: bold;">screen</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;You need screen (the program, moron!) for this script&quot;</span>; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">whoami</span><span style="color: #000000; font-weight: bold;">`</span> = root <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #000000; font-weight: bold;">then</span><br />
<span style="color: #007800;">usagetype</span>=root<br />
<span style="color: #000000; font-weight: bold;">else</span><br />
<span style="color: #007800;">usagetype</span>=nonroot<br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
start<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$DIR</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; ... No such directory: <span style="color: #007800;">$DIR</span>!&quot;</span>; &nbsp;<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-x</span> <span style="color: #007800;">$DIR</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$DAEMON</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$DAEMON</span> does not exist or is not executable!&quot;</span>; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">if</span> status; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; ... <span style="color: #007800;">$DESC</span>: <span style="color: #007800;">$NAME</span> is already running!&quot;</span>; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$usagetype</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span><br />
root<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$CS_USER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;cd <span style="color: #007800;">$DIR</span> ; screen -AmdS <span style="color: #007800;">$NAME</span> ./<span style="color: #007800;">$DAEMON</span> <span style="color: #007800;">$PARAMS</span>&quot;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
nonroot<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$DIR</span> ; <span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-AmdS</span> <span style="color: #007800;">$NAME</span> .<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$DAEMON</span> <span style="color: #007800;">$PARAMS</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<span style="color: #000000; font-weight: bold;">esac</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
stop <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> status; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; ... <span style="color: #007800;">$DESC</span> <span style="color: #007800;">$NAME</span> could not be found. Probably not running.&quot;</span>; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$usagetype</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span><br />
root<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #007800;">tmp</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$CS_USER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;screen -ls&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> . <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\$</span>2 ~ /^<span style="color: #007800;">$NAME</span>[[:space:]].*/ {print <span style="color: #000099; font-weight: bold;">\$</span>1}&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$CS_USER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;screen -r <span style="color: #007800;">$tmp</span> -X quit&quot;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
nonroot<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-r</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-ls</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> . <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\$</span>2 ~ /^<span style="color: #007800;">$NAME</span>[[:space:]].*/ {print <span style="color: #000099; font-weight: bold;">\$</span>1}&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-X</span> quit<br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<span style="color: #000000; font-weight: bold;">esac</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
status <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$usagetype</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span><br />
root<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$CS_USER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;screen -ls&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>.<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #007800;">$NAME</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>:space:<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null<br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
nonroot<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-ls</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>.<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #007800;">$NAME</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>:space:<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null<br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<span style="color: #000000; font-weight: bold;">esac</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
watch <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> status; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DESC</span> <span style="color: #007800;">$NAME</span> could not be found. Probably not running.&quot;</span>; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>; <span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$usagetype</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span><br />
root<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #007800;">tmp</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$CS_USER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;screen -ls&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> . <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\$</span>2 ~ /^<span style="color: #007800;">$NAME</span>[[:space:]].*/ {print <span style="color: #000099; font-weight: bold;">\$</span>1}&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$CS_USER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;screen -r <span style="color: #007800;">$tmp</span>&quot;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
nonroot<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-r</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-ls</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> . <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\$</span>2 ~ /^<span style="color: #007800;">$NAME</span>[[:space:]].*/ {print <span style="color: #000099; font-weight: bold;">\$</span>1}&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<span style="color: #000000; font-weight: bold;">esac</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span><br />
start<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting <span style="color: #007800;">$DESC</span>: <span style="color: #007800;">$NAME</span>&quot;</span><br />
start<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; ... done.&quot;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<br />
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Stopping <span style="color: #007800;">$DESC</span>: <span style="color: #007800;">$NAME</span>&quot;</span><br />
stop<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; ... done.&quot;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<br />
restart<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Restarting <span style="color: #007800;">$DESC</span>: <span style="color: #007800;">$NAME</span>&quot;</span><br />
status <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; stop<br />
start<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; ... done.&quot;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<br />
status<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">if</span> status<br />
<span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DESC</span>: <span style="color: #007800;">$NAME</span> is UP&quot;</span><br />
<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DESC</span>: <span style="color: #007800;">$NAME</span> is DOWN&quot;</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
watch<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
watch<br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 {start|stop|status|restart|watch}<span style="color: #000099; font-weight: bold;">\n</span>While watching press ctrl-a, ctrl-d to stop watching without stopping the server.&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span> 1<br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">esac</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></div></td></tr></tbody></table></div>
<p><span><span>Данный скрипт найден на <a href="http://forum.ubuntuusers.de/topic/mehrere-counter-strike-server-in-einem-starts/">каком-то немецком форуме</a>,  за что честь им и хвала. <img src='http://dcsk.org.ua/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  А теперь разбор изменяемых параметров:</span></span></p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">CS_USER</span>=csserveruser</div></td></tr></tbody></table></div>
<p>Изменение пользователя, под которым будет запускатся наш сервер.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>hlds<br />
<br />
<span style="color: #007800;">DAEMON</span>=hlds_run</div></td></tr></tbody></table></div>
<p>Настройка папки, где находится наш сервер и название скрипта hlds_run соответственно.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># LAN server:</span><br />
<span style="color: #666666; font-style: italic;"># PARAMS=&quot;-game cstrike -nomaster -insecure +sv_lan 1 +maxplayers 16 +map de_dust&quot;</span><br />
<span style="color: #666666; font-style: italic;"># Internet server:</span><br />
<span style="color: #007800;">PARAMS</span>=<span style="color: #ff0000;">&quot;-game cstrike +map de_dust +maxplayers 12 -port 27015&quot;</span></div></td></tr></tbody></table></div>
<p>Параметры запуска сервера.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">NAME</span>=csserver<br />
<span style="color: #007800;">DESC</span>=<span style="color: #ff0000;">&quot;CS dedicated server&quot;</span></div></td></tr></tbody></table></div>
<p>Настройки для screen, если один сервер &#8211; их изменять не надо.</p>
<p>Итак, теперь у нас есть steam сервер counter-strike последней на данный момент версии. В следующей статье я опишу как установить и настроить amxmodx мод и настроить сервер..</p>
]]></content:encoded>
			<wfw:commentRss>http://dcsk.org.ua/2009/08/nastrojka-counter-strike-servera-pod-debianubuntu/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Развертка VPN сервера на основе ubuntu/debian</title>
		<link>http://dcsk.org.ua/2009/07/razvertka-vpn-servera-na-osnove-ubuntudebian/</link>
		<comments>http://dcsk.org.ua/2009/07/razvertka-vpn-servera-na-osnove-ubuntudebian/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 11:08:54 +0000</pubDate>
		<dc:creator>dcsk</dc:creator>
				<category><![CDATA[IT статьи]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://dcsk.org.ua/?p=33</guid>
		<description><![CDATA[Итак, предположим что у нас есть сервер на Ubuntu(либо Debian &#8211; не суть важно).
1) Установка пакета Openvpn на сервере:

sudo apt-get install openvpn
2) Копируем конфигурацию демона из примеров в документации:
zcat /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz &#62; /etc/openvpn/server.conf
3) Конфигурация &#8211; бесспорно личное дело каждого, однако на мой взгляд имеет смысл:

Изменить подсеть, которая будет использоваться сетью (строка server 10.8.0.0 255.255.255.0).
Снять комментарий с [...]]]></description>
			<content:encoded><![CDATA[<p>Итак, предположим что у нас есть сервер на Ubuntu(либо Debian &#8211; не суть важно).</p>
<p>1) Установка пакета Openvpn на сервере:</p>
<p><span id="more-33"></span></p>
<p><em>sudo apt-get install openvpn</em></p>
<p>2) Копируем конфигурацию демона из примеров в документации:</p>
<p><em>zcat /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz &gt; /etc/openvpn/server.conf</em></p>
<p>3) Конфигурация &#8211; бесспорно личное дело каждого, однако на мой взгляд имеет смысл:</p>
<ul>
<li>Изменить подсеть, которая будет использоваться сетью (строка <strong>server 10.8.0.0 255.255.255.0</strong>).</li>
<li>Снять комментарий с строки <strong>client-to-client</strong>, если есть необходимость в междуклиентских взаимодействиях(по умолчанию весь трафик будет идти через сервер)</li>
<li>Ограничить количество единовременных подключений к серверу(строка <strong>max-clients 100</strong>)</li>
<li>Ограничить пользователя openvpn в правах (строки <strong>user nobody</strong> и <strong>group nobody</strong>)</li>
</ul>
<p>4) Создадим сертификат СА</p>
<p>Перейдем в папку <tt>/usr/share/doc/openvpn/examples/easy-rsa/2.0 , где находятся скрипты для этого. </tt></p>
<p><em>cd <tt>/usr/share/doc/openvpn/examples/easy-rsa/2.0</tt></em></p>
<ul>
<li>Для того чтобы не вводить несколько раз одну и ту же информацию, измените любимым текстовым редактором настройки в файле vars.</li>
</ul>
<p>Создадим сам сертификат(при его создании надо будет ответить на несколько вопросов):</p>
<p><em>. ./vars &amp;&amp;./clean-all &amp;&amp;./build-ca</em></p>
<p>5)Создание сертификата для самого сервера</p>
<pre><em>./build-key-server server</em><em>
</em></pre>
<p>6)Создание параметров Diffie-Hellman(<a href="http://www.rsa.com/rsalabs/node.asp?id=2248">о том что это такое</a>)</p>
<p><em>./build-dh</em></p>
<p>7)Копирование ключей в папку самого впн сервера</p>
<p><em>cp -r keys/* /etc/openvpn/</em></p>
<p>8)Создание сертификатов для клиентов. Для этого надо для каждого клиента запустить команду:</p>
<p><em>./build-key computer</em></p>
<p>где вместо computer &#8211; уникальное название каждой &#8220;машины&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://dcsk.org.ua/2009/07/razvertka-vpn-servera-na-osnove-ubuntudebian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nginx+php(FastCGI) под ubuntu</title>
		<link>http://dcsk.org.ua/2009/02/nginxphpfastcgi-pod-ubuntu/</link>
		<comments>http://dcsk.org.ua/2009/02/nginxphpfastcgi-pod-ubuntu/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 23:11:35 +0000</pubDate>
		<dc:creator>dcsk</dc:creator>
				<category><![CDATA[IT статьи]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://dcsk.org.ua/?p=3</guid>
		<description><![CDATA[Казалось бы &#8211; что может быть тривиальнее &#8211; поставить nginx с поддержкой php. Но оказывается что все не так просто: большая часть информации уже устарела или просто не работает, потому я решил обьеденить всю собранную информацию. (Использовался Ubuntu 8.04.2 LTS Hardy Heron)

1)Ставим инструментарий для сборки:

apt-get install php5-cli build-essential

Нюанс: я не знаю какой логикой руководствовались мейнтейнеры убунту, [...]]]></description>
			<content:encoded><![CDATA[<p>Казалось бы &#8211; что может быть тривиальнее &#8211; поставить nginx с поддержкой php. Но оказывается что все не так просто: большая часть информации уже устарела или просто не работает, потому я решил обьеденить всю собранную информацию. (Использовался Ubuntu 8.04.2 LTS Hardy Heron)</p>
<p><span id="more-3"></span></p>
<p>1)Ставим инструментарий для сборки:</p>
<blockquote>
<p class="command">apt-get install php5-cli build-essential</p>
</blockquote>
<p><em>Нюанс: я не знаю какой логикой руководствовались мейнтейнеры убунту, но факт в том что пакет php5 зависит от  libapache2-mod-php5, который в свою очередь тянет за собой весь апач, потому нам нужен именно php5-cgi.</em></p>
<p>2)Устанавливаем spawn-fcgi из состава lighttpd</p>
<blockquote><p>wget http://www.lighttpd.net/download/lighttpd-1.4.21.tar.gz<br />
tar -xvvf lighttpd-1.4.21.tar.gz<br />
./configure &amp;&amp; make</p></blockquote>
<p>Далее из-под рута копируем куда надо бинарники spawn-fcgi:</p>
<div class="codecolorer-container bash vibrant" style="overflow: auto; white-space: nowrap; width: 900px;">
<blockquote>
<div class="bash codecolorer" style="font-family: Monaco,Lucida Console,monospace;"><span class="kw2">cp</span> src<span class="sy0">/</span>spawn-fcgi <span class="sy0">/</span>usr<span class="sy0">/</span><span class="kw3">local</span><span class="sy0">/</span>bin<span class="sy0">/</span>spawn-fcgi<br />
<span class="kw2">cp</span> doc<span class="sy0">/</span>spawn-php.sh <span class="sy0">/</span>etc/init.d/spawn-php</div>
<div class="bash codecolorer" style="font-family: Monaco,Lucida Console,monospace;">chmod +x <span class="sy0">/</span>etc/init.d/spawn-php</div>
</blockquote>
</div>
<p>Да, есть более удобный метод, описаный <a href="http://blog.kovyrin.net/2006/05/30/nginx-php-fastcgi-howto/" target="_blank">тут</a>. (Запуск встроенного в PHP сервера FastCGI &#8211; метод, не требующий никаких дополнительных утилит.) Но у меня он банально не заработал:</p>
<blockquote><p>2009/02/27 23:24:27 [error] 14755#0: *19 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.0.102, server: home-test, URL: &#8220;/var/www/files/index.php&#8221;, upstream: &#8220;fastcgi://127.0.0.1:8888&#8243;, host: &#8220;home-test&#8221;</p></blockquote>
<p>3) Исправляем настройки spawn-php:</p>
<p>Обязательно:</p>
<blockquote><p>SPAWNFCGI=&#8221;/usr/local/bin/spawn-fcgi&#8221;<br />
FCGIPROGRAM=&#8221;/usr/lib/cgi-bin/php5&#8243;</p></blockquote>
<p>Желательно:</p>
<blockquote><p>USERID=www-data<br />
GROUPID=www-data<br />
FCGIPORT=&#8221;9999&#8243;</p></blockquote>
<p>Остальное.</p>
<p>4)Настраиваем nginx:</p>
<p>Для настройки nginx достаточно убрать комментарии с строк в файле /etc/nginx/sites-enabled/default , и получить:</p>
<blockquote><p>location ~ \.php$ {<br />
fastcgi_pass   127.0.0.1:9999;<br />
fastcgi_index  index.php;<br />
fastcgi_param  SCRIPT_FILENAME  $fastcgi_script_name;<br />
}</p></blockquote>
<p><em>includefastcgi_params я удалил, т.к. nginx не запускался с таким параметром.</em></p>
<p>5) За(пере)запускаем nginx и spawn-fcgi:</p>
<blockquote><p>/etc/init.d/spawn-php</p>
<p>/etc/init.d/nginx restart</p></blockquote>
<p>И получаем работающий php. Кто не знает, его работоспособность можно проверить простым кодом:</p>
<blockquote><p>&lt;?php<br />
phpinfo();<br />
?&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dcsk.org.ua/2009/02/nginxphpfastcgi-pod-ubuntu/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
