<?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>Victor Farazdagi &#187; Linux</title>
	<atom:link href="http://www.phpmag.ru/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmag.ru</link>
	<description>Phrozn, Phing &#38; Zend Framework Musings</description>
	<lastBuildDate>Fri, 19 Aug 2011 08:47:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Vim 7.3 is out!!</title>
		<link>http://www.phpmag.ru/2010/08/17/vim-7-3-is-out/</link>
		<comments>http://www.phpmag.ru/2010/08/17/vim-7-3-is-out/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 13:07:07 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[cli]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=1085</guid>
		<description><![CDATA[Couple of days ago, Vim team released new version of their great text editor. Once I had a little time, that&#8217;s today, I upgraded all my boxes. There couple of new features that are particularly interesting: a) Persistent undo Small but nevertheless very useful addition. Basically, your undo lists are dumped into undo files allowing [...]]]></description>
			<content:encoded><![CDATA[<p>Couple of days ago, Vim team <a href="https://groups.google.com/group/vim_announce/browse_thread/thread/66c02efd1523554b">released</a> new version of their great text editor. Once I had a little time, that&#8217;s today, I upgraded all my boxes. There couple of new features that are particularly interesting:<br />
<span id="more-1085"></span></p>
<h3>a) Persistent undo</h3>
<p>Small but nevertheless very useful addition. Basically, your undo lists are dumped into undo files allowing you to undo/redo even if buffer is unloaded (or even if editor closed). Plus now you are able to undo even after buffer reload (this is separate feature actually).</p>
<p>To enable, add to your .vimrc:</p>
<pre name="code" class="bash">
set undofile
set undodir=/tmp
</pre>
<p>That will enable dumping undo lists into undofile, which will be located in /tmp folder.</p>
<h3>b) Arbitrary columns</h3>
<p>Main use for me is to highlight maximum line length. You could have similar functionality before, but now it is supported out of box:</p>
<pre name="code" class="bash">
" make sure that max lines are displayed
" (80 and 120 are from ZF Coding standards)
set colorcolumn=80,120
</pre>
<p>To update the color of the ruler use hl-ColorColumn. In our custom theme (based on <a href="http://dengmao.wordpress.com/2007/01/22/vim-color-scheme-wombat/">wombat</a>), I set color as:</p>
<pre name="code" class="bash">
hi ColorColumn guibg=#2d2d2d
</pre>
<h3>c) Relative line numbers</h3>
<p>Well, at first I though this kind of controversial feature, but once I tried to navigate inside document using it &#8211; I suppose I like this feature. In any case, not added to my .vimrc by default. I turn it manually:</p>
<pre name="code" class="bash">
:set rnu
</pre>
<p>and to get back to original line numbers:</p>
<pre name="code" class="bash">
:set nu
</pre>
<h3>d) Conceal text</h3>
<p>Well, this feature is mainly for syntax file writers, as it <em>might</em> make markup text more readable. I, honestly, haven&#8217;t enough incentive to dig into it any deeper, as I don&#8217;t really see how can I use it in my immediate work (I actually like to see all the markup).</p>
<h3>Conclusion</h3>
<p>Although 7.3 is a minor release, it is still the result of two-years of work, with a lot of issues fixed and several very cool additions.</p>
<h3>Couple of notes on installation</h3>
<p>On our <a href="http://4cinc.com/">4C&#8217;s development server</a> (running CentOS), I was able to compile 7.3 without any issues whatsoever. </p>
<p>While recently switching to Mac, I still program on my old Ubuntu box and updating the Vim installation didn&#8217;t work the first time I tried. I noticed that my Ubuntu installation needed <strong>xorg-dev</strong> and <strong>libgtk2.0-dev</strong> packages, once installed I was able to compile an complete the Vim&#8217;s installation.</p>
<p>Here is little script I use to compile and install Vim on CentOS (used it on Ubuntu as well):</p>
<pre name="code" class="php">
#!/bin/bash
export CONF_OPT_GUI='--enable-gui=gtk2'
export CONF_OPT_PYTHON='--enable-pythoninterp'
export CONF_OPT_MULTIBYTE='--enable-multibyte'
export CONF_OPT_FEAT='--with-features=huge'
export CONF_OPT_COMPBY='--with-compiledby="yourname@here.com'

make distclean
./configure $CONF_OPT_FEAT $CONF_OPT_MULTIBYTE $CONF_OPT_PYTHON $CONF_OPT_COMPBY $CONF_OPT_GUI
make
make install
</pre>
<p>Save it into extracted <strong>vim73</strong> directory (I prefer to use name &#8220;configure-my&#8221;), then simply source:</p>
<pre name="code" class="shell">
source configure-my
</pre>
<p>Hope that saves you some time and happy Viming!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2010/08/17/vim-7-3-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DOS end of lines in Vim</title>
		<link>http://www.phpmag.ru/2010/03/28/dos-end-of-lines-in-vim/</link>
		<comments>http://www.phpmag.ru/2010/03/28/dos-end-of-lines-in-vim/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 04:42:50 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tricks & Tips]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=983</guid>
		<description><![CDATA[Sometimes I get annoying ^M chars when opening files using Vim &#8211; obviously it&#8217;s a DOS EOL which mixes the picture. The good place to seek for fixes and workarounds is Vim Wikia, which not only shows you what to do, but also gives you a brief background on what is going on (if you [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I get annoying ^M chars when opening files using Vim &#8211; obviously it&#8217;s a DOS EOL which mixes the picture.</p>
<p>The good place to seek for fixes and workarounds is <a href="http://vim.wikia.com/wiki/Change_end-of-line_format_for_dos-mac-unix">Vim Wikia</a>, which not only shows you what to do, but also gives you a brief background on what is going on (if you are unaware).</p>
<p>I am generally happy with dos2unix utility to convert files, but sometimes it seems to be unable to fix the issue. In such situations I do a simple search/replace, right inside of Vim (in ex mode):<br />
<span id="more-983"></span></p>
<pre name="code" class="bash">
:%s/\r/\r/g
</pre>
<p>In my opinion it is real magic &#8211; it replaces carriage returns (CR) with line-feeds (LF), but the actual command reads: do a replacement of \r with \r, right?<br />
Well, Vim is clever enough to look into file-type, and if it&#8217;s unix &#8211; it presumes that first \r can be either CR or LF, while second (replacement) is always LF <img src='http://www.phpmag.ru/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>If it doesn&#8217;t work for you check your buffer&#8217;s file type:</p>
<pre name="code" class="bash">
:set ff?
</pre>
<p>I only recently moved to Vim, but start loving it for such small but extremely useful gems.</p>
<p>Should you have any questions/suggestions &#8211; hit me back on <a href="http://twitter.com/farazdagi">my tweeter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2010/03/28/dos-end-of-lines-in-vim/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to create self-signed SSL certificate</title>
		<link>http://www.phpmag.ru/2009/08/12/how-to-create-self-signed-ssl-certificate/</link>
		<comments>http://www.phpmag.ru/2009/08/12/how-to-create-self-signed-ssl-certificate/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 02:05:17 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tricks & Tips]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=859</guid>
		<description><![CDATA[Note: this is really a how-to, w/o any in-depth explanation, just a note to myself. Today, I needed to add SSL support to UMapper.com application running on my Slackware localhost. We use CA-signed certificates on our server, but for local box self-signed was quite enough (all I need is to be able to view development [...]]]></description>
			<content:encoded><![CDATA[<p>Note: this is really a how-to, w/o any in-depth explanation, just a note to myself.</p>
<p>Today, I needed to add SSL support to <a href="http://www.umapper.com">UMapper.com</a> application running on my Slackware localhost. We use CA-signed certificates on our server, but for local box self-signed was quite enough (all I need is to be able to view development version of site via https). Here what I did:</p>
<p>1. Create private key:</p>
<pre name="code" class="bash">
$ openssl genrsa -out localhost.key 1024
</pre>
<p>2. Generate CSR (Certificate Signing Request):</p>
<pre name="code" class="php">
$ openssl req -new -key localhost.key -out localhost.csr
</pre>
<p>3. Generate certificate:</p>
<pre name="code" class="shell">
$ openssl x509 -req -days 365 -in localhost.csr \
        -signkey localhost.key -out localhost.crt
</pre>
<p>4. Make sure SSL is enabled in httpd.conf:</p>
<pre name="code" class="shell">
# Following two should be uncommented
LoadModule ssl_module lib/httpd/modules/mod_ssl.so
Include /etc/httpd/extra/httpd-ssl.conf
</pre>
<p>5. Edit httpd-ssl.conf so that virtual host users your created certificate:</p>
<pre name="code" class="shell">
# locate and edit cert.details. Make sure localhost.crt and localhost.key
# are present (you either created them there or copied)
SSLCertificateFile "/etc/httpd/certs/localhost.crt"
SSLCertificateKeyFile "/etc/httpd/certs/localhost.key"
</pre>
<p>6. Restart apache:</p>
<pre name="code" class="shell">
$ apachectl restart
</pre>
<p>That&#8217;s it. Please note that browser would still generate exception (and it is a good thing, as otherwise certificates wouldn&#8217;t be that useful). All you need is to add your localhost as exception &#8211; since we really trust that details we provided during certificate creation are our own <img src='http://www.phpmag.ru/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>P.S. If you are getting &#8220;[warn] _default_ VirtualHost overlap on port 443,<br />
the first has precedence&#8221;, add <i>NameVirtualHost *:443</i> into your httpd.conf</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/08/12/how-to-create-self-signed-ssl-certificate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu &#8211; how to disable apache</title>
		<link>http://www.phpmag.ru/2009/07/09/ubuntu-how-to-disable-apache/</link>
		<comments>http://www.phpmag.ru/2009/07/09/ubuntu-how-to-disable-apache/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 01:36:50 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=672</guid>
		<description><![CDATA[Couple of days ago I decided to give lighttpd web-server a try. I didn&#8217;t want to uninstall already installed apache, I just wanted it to stop and not auto-start itself on system reboot. Stopping apache is trivial, as it turned out disabling it is even easier: # aptitude install sysv-rc-conf # sysv-rc-conf From there just [...]]]></description>
			<content:encoded><![CDATA[<p>Couple of days ago I decided to give lighttpd web-server a try. I didn&#8217;t want to uninstall already installed apache, I just wanted it to stop and not auto-start itself on system reboot. Stopping apache is trivial, as it turned out disabling it is even easier:</p>
<pre name="code" class="php">
# aptitude install sysv-rc-conf
# sysv-rc-conf
</pre>
<p>From there just turn off apache service and press &#8216;q&#8217; to quit. I really liked this nice command line tool!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/07/09/ubuntu-how-to-disable-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EC2 Ubuntu &#8211; configuring vsftpd</title>
		<link>http://www.phpmag.ru/2009/07/04/ec2-ubuntu-configuring-vsftpd/</link>
		<comments>http://www.phpmag.ru/2009/07/04/ec2-ubuntu-configuring-vsftpd/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 22:18:18 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[vsftpd]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=646</guid>
		<description><![CDATA[I am creating custom AMI from very well prepared Ubuntu 9.04 Jaunty (Server) AMI by Eric Hammond. In process, I decided to ship vsftpd (simple and very stable ftp server) by default with my AMI. So, I went on with installing vsftpd: apt-get install vsftpd I further configured installed FTP server (/etc/vsftpd.conf): anonymous_enable=NO # don't [...]]]></description>
			<content:encoded><![CDATA[<p>I am creating custom AMI from very well prepared <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1952&#038;categoryID=101">Ubuntu 9.04 Jaunty (Server)</a> AMI by Eric Hammond. In process, I decided to ship vsftpd (simple and very stable ftp server) by default with my AMI. So, I went on with installing vsftpd:</p>
<pre name="code" class="html">
apt-get install vsftpd
</pre>
<p>I further configured installed FTP server (/etc/vsftpd.conf):</p>
<pre name="code" class="xml">
anonymous_enable=NO # don't want anonymous access
pasv_enable=YES # enable passive mode
pasv_min_port=50000
pasv_max_port=50100
pasv_address=YOUR_INSTANCE_ASSOCIATED_IP
local_enable=YES # enable local users to login into system
write_enable=YES # enable local users to execute FTP write commands
</pre>
<p>Everything is pretty much simple, probably except for pasv ports. In a nutshell, passive mode means server handles which ports are used for data transfers, and we are using ports in range of 50000-50100. Now any system user should be able to login into your server via ftp. If you need further info regarding laying down the user accounts read <a href="http://www.phpmag.ru/2009/01/19/add-new-ftp-user-via-shell/">my previous post</a>.</p>
<p>One last thing &#8211; data ports should be accessible (which is obvious but I have spent half an hour figuring out why I can login via ftp, but cannot execute LIST command), so configure your authorization group accordingly:</p>
<pre name="code" class="html">
ec2-authorize default -p 50000-50100 #open ports for default group
</pre>
<p>I hope it saves you some time.<br />
Have a nice weekends!</p>
<p>If you need more info on how FTP functions <a href="http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch15_:_Linux_FTP_Server_Setup">here</a> is good overview.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/07/04/ec2-ubuntu-configuring-vsftpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find files ignoring the Subversion .svn directories</title>
		<link>http://www.phpmag.ru/2009/03/25/find-files-ignoring-the-subversion-svn-directories/</link>
		<comments>http://www.phpmag.ru/2009/03/25/find-files-ignoring-the-subversion-svn-directories/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 16:23:50 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tricks & Tips]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=520</guid>
		<description><![CDATA[One-liner that I use almost daily when working with source files (put it on separate lines for readablity): find . -type f -not -regex '.*/.svn/*.*' -exec grep -Hn --colour 'SEARCH_STRING '{}' \; You see, when you need to find some string within source files, and you don&#8217;t want to see duplicates coming from .svn folders, [...]]]></description>
			<content:encoded><![CDATA[<p>One-liner that I use almost daily when working with source files (put it on separate lines for readablity):</p>
<p><code><br />
find . -type f -not -regex '.*/.svn/*.*'<br />
        -exec grep -Hn --colour 'SEARCH_STRING '{}' \;<br />
</code></p>
<p>You see, when you need to find some string within source files, and you don&#8217;t want to see duplicates coming from .svn folders, this one-liner does the trick &#8211; .svn directories are ignored from search.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/03/25/find-files-ignoring-the-subversion-svn-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GTK2 Apps look like a crap in your Slackware..</title>
		<link>http://www.phpmag.ru/2009/02/12/gtk2-apps-look-like-a-crap-in-your-slackware/</link>
		<comments>http://www.phpmag.ru/2009/02/12/gtk2-apps-look-like-a-crap-in-your-slackware/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 23:37:16 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[GTK2]]></category>
		<category><![CDATA[look'n'feel]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=427</guid>
		<description><![CDATA[If you&#8217;re like me very fond of Thunderbird (or Firefox, Seamonkey, GQView, Pidgin and similar GTK applications), and are geek enough to run Slackware while being complete novice to Linux &#8211; you&#8217;ve probably noticed that your GTK look&#8217;n'feel is like..well complete crap. To get rid of this issue, I used to install themes, or for [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me very fond of Thunderbird (or Firefox, Seamonkey, GQView, Pidgin and similar GTK applications), and are geek enough to run Slackware while being complete novice to Linux &#8211; you&#8217;ve probably noticed that your GTK look&#8217;n'feel is like..well complete crap. </p>
<p>To get rid of this issue, I used to install themes, or for applications other than Thunderbird just got used to their ugly look, but then yesterday I got Ubuntu 8.10 disc and my brother&#8217;s notebook. Combined, they demonstrated me one of the best out-of-box distributions, and you know what? GTK applications in there look really nice! That was a moment I realized that my Slackware shouldn&#8217;t be left behind (well, it took me only 2 months to figure that out &#8211; kudos!). The only thing that was required is to enable Xfce configuration:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$xfce</span>-mcs-manager</pre></div></div>

<p>Once typed into console, try to re-open one of your GTK2 applications &#8211; you should be amazed how ugly previous style was. If you don&#8217;t want to initialize Xfce manager manually on every login (and you don&#8217;t) you have to make sure that this command is invoked when your window manager launches. For me, I just put the <em>xfce-mcs-manager</em> command into .xsession file (depending on your configuration .xinitrc might also be an option).</p>
<p>Hope that saves you some time, and you&#8217;d be smarter than me <img src='http://www.phpmag.ru/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you need more similar tips &#8211; make sure you read <a href="http://www.vcn.bc.ca/~dugan/setting-up-slackware.html">How to properly setup Slackware Linux</a>!</p>
<p>UPD: Checkout xfce-setting-show if you want to manipulate Xfce settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/02/12/gtk2-apps-look-like-a-crap-in-your-slackware/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create bookmarks in pdf documents on Linux</title>
		<link>http://www.phpmag.ru/2009/02/01/create-bookmarks-in-pdf-documents-on-linux/</link>
		<comments>http://www.phpmag.ru/2009/02/01/create-bookmarks-in-pdf-documents-on-linux/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 15:31:11 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tricks & Tips]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[soft]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=380</guid>
		<description><![CDATA[There&#8217;s probably an easier way to do this, but I haven&#8217;t found it. I have quite an extensive collection of IT books in PDF format, and not all of them come with navigation bookmarks. On Windows that was not a problem since Adobe Professional allows you to edit pdf documents. It&#8217;s only a pity that [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s probably an easier way to do this, but I haven&#8217;t found it. I have quite an extensive collection of IT books in PDF format, and not all of them come with navigation bookmarks. On Windows that was not a problem since Adobe Professional allows you to edit pdf documents. It&#8217;s only a pity that it doesn&#8217;t have a Linux version (it should be noted that Acrobat <em><strong>Reader</strong></em> is available for Linux).</p>
<p>So, when I wanted to edit newly downloaded e-book in pdf format (there were no bookmarks at all!), I scrattched my head, asked google and didn&#8217;t find anything suitable. Going a little deeper with the search I located very good program that does exactly what I need &#8211; it is able to add/delete/edit bookmarks of existing pdf files.</p>
<p>Program is called <a href="http://linux.softpedia.com/get/Desktop-Environment/Tools/JPdfBookmarks-39503.shtml">JPdfBookmarks</a>, and it works like a charm (it even has a GUI version).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/02/01/create-bookmarks-in-pdf-documents-on-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Добавление ftp-пользователя через шелл</title>
		<link>http://www.phpmag.ru/2009/01/19/add-new-ftp-user-via-shell/</link>
		<comments>http://www.phpmag.ru/2009/01/19/add-new-ftp-user-via-shell/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 20:06:48 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tricks & Tips]]></category>
		<category><![CDATA[linux shell]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=306</guid>
		<description><![CDATA[Сегодня возникла надобность добавить нового ftp-пользователя используя шелл. На самом деле задача эта достаточно тривиальная, но все-таки поделюсь с теми, кто возможно не знает как это сделать. Для начала стоит создать нового пользователя, испольуя стандартные средства useradd: useradd -d /home/ftp/myuser/ -s /dev/null myuser &#62; /dev/null 2&#62;&#38;1 Домашней принята директория /home/ftp/myuser (в общем-то это стандартно), можно [...]]]></description>
			<content:encoded><![CDATA[<p>Сегодня возникла надобность добавить нового ftp-пользователя используя шелл. На самом деле задача эта достаточно тривиальная, но все-таки поделюсь с теми, кто возможно не знает как это сделать.</p>
<p>Для начала стоит создать нового пользователя, испольуя стандартные средства useradd:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>myuser<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null myuser <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span></pre></div></div>

<p>Домашней принята директория /home/ftp/myuser (в общем-то это стандартно), можно естественно использовать любую другую директорию, хотя лучше все же делать не извращаясь.</p>
<p>В большинстве случаев, доступ к шеллу должен быть закрытым для пользователя, поэтому мы использовали флаг &#8220;-s /dev/null&#8221;, т.е. как <strong>s</strong>hell у пользователя будет использована псевдо-оболочка /dev/null. Стоит заметить, что у меня (на CentOS) подключиться через фтп удалось только при использовании /bin/false, /dev/null же перекрывал доступ как к шеллу, так и к фтп. В чем дело разбираться не захотел, возможно именно так это и должно работать на этой дистре (хотя в RedHat изначально добавленна псевдо-оболочка /dev/null в /etc/shells вроде как именно для этих целей).</p>
<p>После создания пользователя, задаем пароль:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">passwd</span> myuser</pre></div></div>

<p>Далее, следует убедиться что /dev/null (в случае с CentOS /bin/false) присутсвуют в /etc/shells. Если наша псевдо-оболочка не найдена, добавляем ее.</p>
<p>И последнее, для удобства пользователя, заходящего через фтп, стоит по-определению открывать именно директорию его аккаунта. Как это сделать? ЛеХко! Для этого редактируем /etc/passwd:<br />
вместо</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">myuser:x:10010:10010::/home/ftp/myuser/:/bin/false</pre></div></div>

<p> вставляем</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">myuser:x:<span style="color: #000000;">10010</span>:<span style="color: #000000;">10010</span>::<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>.<span style="color: #000000; font-weight: bold;">/</span>myuser<span style="color: #000000; font-weight: bold;">/</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;">false</span></pre></div></div>

<p>таким образом при входе в систему, пользователь попадет в каталог myuser.</p>
<p>Вот, в общем-то, и все! Удачного начала рабочей недели.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/01/19/add-new-ftp-user-via-shell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Игнорирование файлов при работе с репозиторем svn</title>
		<link>http://www.phpmag.ru/2009/01/10/%d0%b8%d0%b3%d0%bd%d0%be%d1%80%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-%d1%84%d0%b0%d0%b9%d0%bb%d0%be%d0%b2-%d0%bf%d1%80%d0%b8-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b5-%d1%81-%d1%80%d0%b5%d0%bf/</link>
		<comments>http://www.phpmag.ru/2009/01/10/%d0%b8%d0%b3%d0%bd%d0%be%d1%80%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-%d1%84%d0%b0%d0%b9%d0%bb%d0%be%d0%b2-%d0%bf%d1%80%d0%b8-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b5-%d1%81-%d1%80%d0%b5%d0%bf/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 04:08:45 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks & Tips]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.php-alania.ru/?p=269</guid>
		<description><![CDATA[В случае когда определенные файлы/каталоги не должны попадать под контроль версий, достаточно установить свойство svn:ignore: svn propset svn:ignore *.pyc dirname В случае если такое свойство уже существует: svn propedit svn:ignore dirname Например, на UMapper&#8216;е для игнорирования авто-сгенеренных CAPTCHA файлов находящихся в каталоге /files/captcha и имеющих названия вида &#8220;cap_RANDOM_STRING&#8221;, я использовал следующую комманду: svn propset svn:ignore [...]]]></description>
			<content:encoded><![CDATA[<p>В случае когда определенные файлы/каталоги не должны попадать под контроль версий, достаточно установить свойство svn:ignore:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">svn propset svn:ignore *.pyc dirname</pre></div></div>

<p>В случае если такое свойство уже существует:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">svn propedit svn:ignore dirname</pre></div></div>

<p>Например, на <a href="http://www.umapper.com">UMapper</a>&#8216;е для игнорирования авто-сгенеренных CAPTCHA файлов находящихся в каталоге /files/captcha и имеющих названия вида &#8220;cap_RANDOM_STRING&#8221;, я использовал следующую комманду:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">svn propset svn:ignore cap_* /files/captcha/</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/01/10/%d0%b8%d0%b3%d0%bd%d0%be%d1%80%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-%d1%84%d0%b0%d0%b9%d0%bb%d0%be%d0%b2-%d0%bf%d1%80%d0%b8-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b5-%d1%81-%d1%80%d0%b5%d0%bf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

