<?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>IT блог - полезные заметки. &#187; FreeBSD</title>
	<atom:link href="http://itblog.su/category/freebsd/feed" rel="self" type="application/rss+xml" />
	<link>http://itblog.su</link>
	<description>IT blog - авторский блог о Linux, windows, php, mysql.</description>
	<lastBuildDate>Thu, 26 Aug 2010 10:00:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>как нагнать траф?</title>
		<link>http://itblog.su/kak-nagnat-traf.html</link>
		<comments>http://itblog.su/kak-nagnat-traf.html#comments</comments>
		<pubDate>Tue, 28 Jul 2009 00:20:41 +0000</pubDate>
		<dc:creator>Артур Шакиров</dc:creator>
				<category><![CDATA[CentOS Linux]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://itblog.su/?p=313</guid>
		<description><![CDATA[Возникла типичная для многих ситуация, на одном из серверов в одном из ДЦ оказалось что входящего трафа больше чем исходящего. причем нехватает пару терабайт исходящего. ничего страшного :) /dev/urandom безлимитный, осталось только выбрать ДЦ и сервер на который можно его перегнать. А перегонять будем так: cat /dev/urandom &#124; ssh server 'cat &#62; /traff' время от [...]]]></description>
			<content:encoded><![CDATA[<p>Возникла типичная для многих ситуация, на одном из серверов в одном из ДЦ оказалось что входящего трафа больше чем исходящего. причем нехватает пару терабайт исходящего.</p>
<p>ничего страшного :) /dev/urandom безлимитный, осталось только выбрать ДЦ и сервер на который можно его перегнать. А перегонять будем так:</p>
<div class="codecolorer-container bash" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">cat /dev/urandom | ssh server <span class="st0">'cat &gt; /traff'</span></div></div>
<p>время от времени (по крону например) на принимающем сервере будем обнулять файлик traff</p>
<div class="codecolorer-container bash" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">&gt; /traff</div></div>
<p>пока писал, пришла в голову мысль, что можно передавать сразу в /dev/null</p>
<div class="codecolorer-container bash" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">cat /dev/urandom | ssh server <span class="st0">'cat &gt; /dev/null'</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://itblog.su/kak-nagnat-traf.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>простановка прав на папки и файлы сайта</title>
		<link>http://itblog.su/prostanovka-prav-na-papki-i-fajjly-sajjta.html</link>
		<comments>http://itblog.su/prostanovka-prav-na-papki-i-fajjly-sajjta.html#comments</comments>
		<pubDate>Thu, 12 Mar 2009 22:48:38 +0000</pubDate>
		<dc:creator>Артур Шакиров</dc:creator>
				<category><![CDATA[CentOS Linux]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[lang]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[type]]></category>

		<guid isPermaLink="false">http://itblog.su/?p=279</guid>
		<description><![CDATA[Пришла заявка от клиента, человек по незнанию поставил рекурсивно на все файлы и папки своих сайтов права доступа 777. Захотелось человеку выставить 755 на папки и 644 на файлы, делать вручную это при паре десятков доменов и паре тысяч файлов упрятанных в запутанной структуре папок ну просто нереально. Тут ему пришел на помощь простой скрипт [...]]]></description>
			<content:encoded><![CDATA[<p>Пришла заявка от клиента, человек по незнанию поставил рекурсивно на все файлы и папки своих сайтов права доступа 777. Захотелось человеку выставить 755 на папки и 644 на файлы, делать вручную это при паре десятков доменов и паре тысяч файлов упрятанных в запутанной структуре папок ну просто нереально. Тут ему пришел на помощь простой скрипт запускаемый по ssh который просто ищет все папки в текущей директории и ставит им chmod 755 ну и файлы аналогично, только chmod 644.</p>
<p>Ну и собственно сам &laquo;скрипт&raquo;:</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;">find -<span class="kw3">type</span> d -<span class="kw3">exec</span> chmod <span class="nu0">755</span> <span class="br0">&#123;</span><span class="br0">&#125;</span> \;<br />
find -<span class="kw3">type</span> f -<span class="kw3">exec</span> chmod <span class="nu0">644</span> <span class="br0">&#123;</span><span class="br0">&#125;</span> \;</div></div>
]]></content:encoded>
			<wfw:commentRss>http://itblog.su/prostanovka-prav-na-papki-i-fajjly-sajjta.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FreeBSD free memory stats</title>
		<link>http://itblog.su/freebsd-free-memory-stats.html</link>
		<comments>http://itblog.su/freebsd-free-memory-stats.html#comments</comments>
		<pubDate>Fri, 09 Jan 2009 03:26:00 +0000</pubDate>
		<dc:creator>Артур Шакиров</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[available memory]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[freecolor]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[lang]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[memory information]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[system memory usage]]></category>

		<guid isPermaLink="false">http://itblog.su/?p=248</guid>
		<description><![CDATA[В linux-ах есть полезная тулза free, вывод её привожу ниже: &#91;root@iit ~&#93;# free &#160; &#160; &#160; &#160; &#160; &#160; &#160;total&#160; &#160; &#160; &#160;used&#160; &#160; &#160; &#160;free&#160; &#160; &#160;shared&#160; &#160; buffers&#160; &#160; &#160;cached Mem:&#160; &#160; &#160; &#160;4148892&#160; &#160; 1736588&#160; &#160; 2412304&#160; &#160; &#160; &#160; &#160; 0&#160; &#160; &#160;207108&#160; &#160; &#160;859128 -/+ buffers/cache:&#160; &#160; &#160;670352&#160; &#160; 3478540 [...]]]></description>
			<content:encoded><![CDATA[<p>В linux-ах есть полезная тулза free, вывод её привожу ниже:</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="br0">&#91;</span>root@iit ~<span class="br0">&#93;</span><span class="re3"># free</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;total&nbsp; &nbsp; &nbsp; &nbsp;used&nbsp; &nbsp; &nbsp; &nbsp;free&nbsp; &nbsp; &nbsp;shared&nbsp; &nbsp; buffers&nbsp; &nbsp; &nbsp;cached<br />
Mem:&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">4148892</span>&nbsp; &nbsp; <span class="nu0">1736588</span>&nbsp; &nbsp; <span class="nu0">2412304</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span>&nbsp; &nbsp; &nbsp;<span class="nu0">207108</span>&nbsp; &nbsp; &nbsp;<span class="nu0">859128</span><br />
-/+ buffers/cache:&nbsp; &nbsp; &nbsp;<span class="nu0">670352</span>&nbsp; &nbsp; <span class="nu0">3478540</span><br />
Swap:&nbsp; &nbsp; &nbsp; <span class="nu0">2048276</span>&nbsp; &nbsp; &nbsp; <span class="nu0">32812</span>&nbsp; &nbsp; <span class="nu0">2015464</span></div></div>
<p>В FreeBSD такой утилиты увы нет, почти нет. Замены есть две, perl скрипт (freebsd-memory &#8212; List Total System Memory Usage) и freecolor. Листинг установке того и другого ниже:</p>
<div class="codecolorer-container bash" style="height:280px;"><div class="codecolorer" style="font-family: monospace;">fetch -o /usr/<span class="kw3">local</span>/bin/free http://itblog.su/wp-content/uploads/<span class="nu0">2009</span>/<span class="nu0">01</span>/freebsd-memorypl.txt<br />
chmod +x /usr/<span class="kw3">local</span>/bin/free<br />
<br />
-bash<span class="nu0">-2</span>.05b<span class="re3"># free</span><br />
SYSTEM MEMORY INFORMATION:<br />
mem_wire:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">257478656</span> <span class="br0">&#40;</span>&nbsp; &nbsp; 245MB<span class="br0">&#41;</span> <span class="br0">&#91;</span> <span class="nu0">12</span>%<span class="br0">&#93;</span> Wired: disabled <span class="kw1">for</span> paging out<br />
mem_active:&nbsp; +&nbsp; &nbsp; <span class="nu0">564359168</span> <span class="br0">&#40;</span>&nbsp; &nbsp; 538MB<span class="br0">&#41;</span> <span class="br0">&#91;</span> <span class="nu0">26</span>%<span class="br0">&#93;</span> Active: recently referenced<br />
mem_inactive:+&nbsp; &nbsp;<span class="nu0">1172426752</span> <span class="br0">&#40;</span>&nbsp; &nbsp;1118MB<span class="br0">&#41;</span> <span class="br0">&#91;</span> <span class="nu0">55</span>%<span class="br0">&#93;</span> Inactive: recently not referenced<br />
mem_cache:&nbsp; &nbsp;+&nbsp; &nbsp; &nbsp;<span class="nu0">64004096</span> <span class="br0">&#40;</span>&nbsp; &nbsp; &nbsp;61MB<span class="br0">&#41;</span> <span class="br0">&#91;</span>&nbsp; <span class="nu0">3</span>%<span class="br0">&#93;</span> Cached: almost avail. <span class="kw1">for</span> allocation<br />
mem_free:&nbsp; &nbsp; +&nbsp; &nbsp; &nbsp;<span class="nu0">44834816</span> <span class="br0">&#40;</span>&nbsp; &nbsp; &nbsp;42MB<span class="br0">&#41;</span> <span class="br0">&#91;</span>&nbsp; <span class="nu0">2</span>%<span class="br0">&#93;</span> Free: fully available <span class="kw1">for</span> allocation<br />
mem_gap_vm:&nbsp; +&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">458752</span> <span class="br0">&#40;</span>&nbsp; &nbsp; &nbsp; 0MB<span class="br0">&#41;</span> <span class="br0">&#91;</span>&nbsp; <span class="nu0">0</span>%<span class="br0">&#93;</span> Memory gap: UNKNOWN<br />
-------------- ------------ ----------- ------<br />
mem_all:&nbsp; &nbsp; &nbsp;=&nbsp; &nbsp;<span class="nu0">2103562240</span> <span class="br0">&#40;</span>&nbsp; &nbsp;2006MB<span class="br0">&#41;</span> <span class="br0">&#91;</span><span class="nu0">100</span>%<span class="br0">&#93;</span> Total real memory managed<br />
mem_gap_sys: +&nbsp; &nbsp; &nbsp;<span class="nu0">37957632</span> <span class="br0">&#40;</span>&nbsp; &nbsp; &nbsp;36MB<span class="br0">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; Memory gap: Kernel?!<br />
-------------- ------------ -----------<br />
mem_phys:&nbsp; &nbsp; =&nbsp; &nbsp;<span class="nu0">2141519872</span> <span class="br0">&#40;</span>&nbsp; &nbsp;2042MB<span class="br0">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; Total real memory available<br />
mem_gap_hw:&nbsp; +&nbsp; &nbsp; &nbsp; <span class="nu0">5963776</span> <span class="br0">&#40;</span>&nbsp; &nbsp; &nbsp; 5MB<span class="br0">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; Memory gap: Segment Mappings?!<br />
-------------- ------------ -----------<br />
mem_hw:&nbsp; &nbsp; &nbsp; =&nbsp; &nbsp;<span class="nu0">2147483648</span> <span class="br0">&#40;</span>&nbsp; &nbsp;2048MB<span class="br0">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; Total real memory installed<br />
<br />
SYSTEM MEMORY SUMMARY:<br />
mem_used:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">866217984</span> <span class="br0">&#40;</span>&nbsp; &nbsp; 826MB<span class="br0">&#41;</span> <span class="br0">&#91;</span> <span class="nu0">40</span>%<span class="br0">&#93;</span> Logically used memory<br />
mem_avail:&nbsp; &nbsp;+&nbsp; &nbsp;<span class="nu0">1281265664</span> <span class="br0">&#40;</span>&nbsp; &nbsp;1221MB<span class="br0">&#41;</span> <span class="br0">&#91;</span> <span class="nu0">59</span>%<span class="br0">&#93;</span> Logically available memory<br />
-------------- ------------ ----------- ------<br />
mem_total:&nbsp; &nbsp;=&nbsp; &nbsp;<span class="nu0">2147483648</span> <span class="br0">&#40;</span>&nbsp; &nbsp;2048MB<span class="br0">&#41;</span> <span class="br0">&#91;</span><span class="nu0">100</span>%<span class="br0">&#93;</span> Logically total memory</div></div>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="kw3">cd</span> /usr/ports/sysutils/freecolor<br />
make install clean<br />
<br />
-bash<span class="nu0">-2</span>.05b<span class="re3"># freecolor -t -m -o</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;total&nbsp; &nbsp; &nbsp; &nbsp;used&nbsp; &nbsp; &nbsp; &nbsp;free&nbsp; &nbsp; &nbsp;shared&nbsp; &nbsp; buffers&nbsp; &nbsp; &nbsp;cached<br />
Mem:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2042</span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">834</span>&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">1207</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">61</span><br />
Swap:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">2048</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span>&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">2045</span><br />
Total:&nbsp; <span class="nu0">4294965248</span> = <span class="br0">&#40;</span>&nbsp; &nbsp; <span class="nu0">2890</span> <span class="br0">&#40;</span>used<span class="br0">&#41;</span> +&nbsp; &nbsp; &nbsp;<span class="nu0">3314</span> <span class="br0">&#40;</span>free<span class="br0">&#41;</span><span class="br0">&#41;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://itblog.su/freebsd-free-memory-stats.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
