<?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>aliyev&#039;s notes</title>
	<atom:link href="http://aliyev.ws/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://aliyev.ws</link>
	<description>noted answers on ever raised issues</description>
	<lastBuildDate>Thu, 20 May 2010 10:30:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Smarty error with Google Analytics</title>
		<link>http://aliyev.ws/?p=137</link>
		<comments>http://aliyev.ws/?p=137#comments</comments>
		<pubDate>Thu, 20 May 2010 10:30:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[php template]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=137</guid>
		<description><![CDATA[The error appears after modifing a page and load it for the first time.
If the analytics tracking code removed from the template (*.tpl), the error does not appear.
Solution:
wrap around your js code with {literal} {/literal}
Example:
{literal}
&#60;script type=&#8221;text/javascript&#8221;&#62;
var _gaq = _gaq &#124;&#124; [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement(&#8217;script&#8217;); ga.type = &#8216;text/javascript&#8217;; ga.async = true;
ga.src = (&#8216;https:&#8217; == [...]]]></description>
			<content:encoded><![CDATA[<p>The error appears after modifing a page and load it for the first time.<br />
If the analytics tracking code removed from the template (*.tpl), the error does not appear.</p>
<p>Solution:</p>
<p>wrap around your js code with {literal} {/literal}</p>
<p>Example:</p>
<p><strong><span id="more-137"></span>{literal}</strong></p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>var _gaq = _gaq || [];<br />
_gaq.push(['_setAccount', 'UA-XXXXX-X']);<br />
_gaq.push(['_trackPageview']);</p>
<p>(function() {<br />
var ga = document.createElement(&#8217;script&#8217;); ga.type = &#8216;text/javascript&#8217;; ga.async = true;<br />
ga.src = (&#8216;https:&#8217; == document.location.protocol ? &#8216;https://ssl&#8217; : &#8216;http://www&#8217;) + &#8216;.google-analytics.com/ga.js&#8217;;<br />
var s = document.getElementsByTagName(&#8217;script&#8217;)[0]; s.parentNode.insertBefore(ga, s);<br />
})();</p>
<p>&lt;/script&gt;</p>
<p><strong>{/literal}</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=137</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use .htaccess to Deny Access Directory Listing</title>
		<link>http://aliyev.ws/?p=132</link>
		<comments>http://aliyev.ws/?p=132#comments</comments>
		<pubDate>Fri, 14 May 2010 12:09:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=132</guid>
		<description><![CDATA[Don’t have an index in all your directory’s? Many people create a blank index.html file in every directory to prevent directory listing. It’s ok for a small website, but imagine if you have a website that has hundred or thousand directories. The easiest way is to write a htaccess file, include the following line in [...]]]></description>
			<content:encoded><![CDATA[<p>Don’t have an index in all your directory’s? Many people create a blank index.html file in every directory to prevent directory listing. It’s ok for a small website, but imagine if you have a website that has hundred or thousand directories. The easiest way is to write a htaccess file, include the following line in your .htaccess file to deny access to all the directory listings, if there is no index file.</p>
<p>Options -Indexes</p>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=132</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing default gateway on MS Windows using command line</title>
		<link>http://aliyev.ws/?p=130</link>
		<comments>http://aliyev.ws/?p=130#comments</comments>
		<pubDate>Sun, 28 Jun 2009 11:56:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=130</guid>
		<description><![CDATA[Despite the fact this post is quite fat from Ubuntu or Linux I decided to puclish it here as find this usefull and sometimes neccessary.
So here we are on how to update default gateway using command line:
netsh interface ip add address &#8220;local area connection&#8221; gateway=100.1.1.5
gwmetric=2
]]></description>
			<content:encoded><![CDATA[<p>Despite the fact this post is quite fat from Ubuntu or Linux I decided to puclish it here as find this usefull and sometimes neccessary.</p>
<p>So here we are on how to update default gateway using command line:</p>
<p><strong>netsh interface ip add address &#8220;local area connection&#8221; gateway=100.1.1.5<br />
gwmetric=2</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=130</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To search for an string in a file using grep</title>
		<link>http://aliyev.ws/?p=126</link>
		<comments>http://aliyev.ws/?p=126#comments</comments>
		<pubDate>Thu, 23 Apr 2009 04:28:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ubuntu advices]]></category>
		<category><![CDATA[find text in file linux]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[grep command]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=126</guid>
		<description><![CDATA[grep searches the input files for lines containing a match to a given pattern list. When it finds a match in a line, it copies the line to standard output (by default), or does whatever other sort of output you have requested with options.
grep can simply be invoked: $ grep &#8216;STRING&#8217; filename

This is OK but [...]]]></description>
			<content:encoded><![CDATA[<p>grep searches the input files for lines containing a match to a given pattern list. When it finds a match in a line, it copies the line to standard output (by default), or does whatever other sort of output you have requested with options.</p>
<p>grep can simply be invoked: <strong>$ grep &#8216;STRING&#8217; filename</strong></p>
<p><span id="more-126"></span></p>
<p>This is OK but it does not show the true power of grep. First this only looks at one file. A cool example of using grep with multiple file would be to find all files in a directory that contains the name of a person. This can be easily accomplished using a grep in the following way :</p>
<p><strong>$ grep &#8216;Nikesh J&#8217; *</strong></p>
<p>Notice the use of single quotes; This are not essential but in this example it was required since the name contains a space. Double quotes could also have been used in this example.</p>
<p>Grep Regular Expression</p>
<p>grep can search for complicated pattern to find what you need. Here is a list of some of the special characters used to create a regular expression:</p>
<p><strong>`.&#8217; </strong>The period `.&#8217; matches any single character.</p>
<p><strong>`?&#8217; </strong>The preceding item is optional and will be matched at most once.</p>
<p><strong>`*&#8217;</strong> The preceding item will be matched zero or more times.</p>
<p><strong>`+&#8217; </strong>The preceding item will be matched one or more times.</p>
<p>So an example of a regular expression search would be: $ grep &#8220;\&lt;[A-Za-z].*&#8221; file</p>
<p>This will search for any word which begins with a letter upper or lower case.</p>
<p>For more details check: <strong>$ man grep</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=126</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the Date and Time in Linux</title>
		<link>http://aliyev.ws/?p=124</link>
		<comments>http://aliyev.ws/?p=124#comments</comments>
		<pubDate>Wed, 08 Oct 2008 05:24:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ubuntu advices]]></category>
		<category><![CDATA[Ubuntu troubles]]></category>
		<category><![CDATA[setting date linux]]></category>
		<category><![CDATA[Setting the Date and Time in Linux]]></category>
		<category><![CDATA[setting time linux]]></category>
		<category><![CDATA[time linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=124</guid>
		<description><![CDATA[Run the date command to make sure you have the correct time:
[root@server /root]# date
Thu Sep 20 11:00:06 CDT 2001
[root@server /root]#
If your timezone is correct but the date and/or time needs updating, the following commands will update the date and time. The second command is needed in order to push the date and time into the [...]]]></description>
			<content:encoded><![CDATA[<p>Run the date command to make sure you have the correct time:</p>
<pre>[root@server /root]# <strong>date</strong>
Thu Sep 20 11:00:06 CDT 2001
[root@server /root]#</pre>
<p>If your timezone is correct but the date and/or time needs updating, the following commands will update the date and time. The second command is needed in order to push the date and time into the PC clock.</p>
<pre>[root@server /root]# <strong>date 092011082001</strong>
Thu Sep 20 11:08:00 CDT 2001
[root@server /root]# <strong>hwclock --utc --systohc</strong>
[root@server /root]#</pre>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=124</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Wordpress themes and Hidden code</title>
		<link>http://aliyev.ws/?p=119</link>
		<comments>http://aliyev.ws/?p=119#comments</comments>
		<pubDate>Wed, 10 Sep 2008 04:26:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Free Wordpress themes]]></category>
		<category><![CDATA[Hidden code]]></category>
		<category><![CDATA[Wordress]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=119</guid>
		<description><![CDATA[If you are using a free wordpress theme, make sure that the footer does not contain hidden code. I’ll show you how to find and unhide that hidden code below, something that many people starting out with Wordpress miss. Such a mistake can have you linking to bad link partners which can cause your site [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using a free wordpress theme, make sure that the footer does not contain hidden code. I’ll show you how to find and unhide that hidden code below, something that many people starting out with Wordpress miss. Such a mistake can have you linking to bad link partners which can cause your site to never rank well with the search engines.</p>
<p>You are who you hang around with, at least that is the way it is on the internet. If your site is on Green Tea and you keep linking to mountain dew, then your site is considered to be about dew, not tea to most search engines.</p>
<p>If you have a site that links to websites considered bad by search engines, you will be penalized and may not recover for years &#8211; at that point, you might as well start another site.<span id="more-119"></span></p>
<p>So what does this have to do with hidden code inside wordpress themes? The hidden code can contain links to inappropriate sites or worse, code that fetches links from a main server that are then placed on you site without your knowledge!</p>
<p>So, what do you look for when evaluating a wordpress theme? Start with the footer.php file and look for code like this:</p>
<p>&lt;?php eval(gzinflate(base64_decode(’rZFNT8MwDIbP66+wcmCbBM3YBYml2QG4I4a<br />
049Ru7oeUJlGc0u3f06wbaB2ICzk4ih0/r/NmKSOxqz5gq1KihOXGeHTsp+TG730oZA647<br />
GMEIKycbKcwn80eQCxtaSFTpqh0biZjndY4ni5gKeNoNLrRGdnFRcwapRbX+e6ySKF0mCd<br />
syHRE803jVM9l8kV7VyHB5G21mgqeyn9T2pq6Ru1pM5R8OhW+NQW3wYvLFQneefibk/f<br />
ByrN06b195Ny6Svt4ryl2DZNrzOAZqSp0kIDsAFcSQ8C5td9D2y2QNZqMw10g3P3NOA5B/q<br />
CwQ3AmX7/O/RjONEXpe9iwt23buLW+xBopd4hx5yFn4CuvMGFr43bWIRG8H290Txxkgk<br />
J88u34HRF8Ag==’)));?&gt;</p>
<p>Looks odd, doesn’t it? If not, then you need to step away from the computer right now <img class="wp-smiley" src="http://www.jamesmaurer.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>If you take this code, replace eval with print and place it in a file on your server called testme.php, you will see the hidden code. After you have created the file, access it by typing your websiteaddress/testme.php and then choose view source from your browser. Behold, the hidden code revealed. In the example above, the hidden code equates to something like this:</p>
<p>?&gt;<br />
&lt;div class=”footer”&gt;<br />
&lt;div class=”footer_txt”&gt;<br />
&lt;br /&gt;&lt;br /&gt;<br />
&lt;p&gt;(c) 2007 &lt;?php bloginfo(’name’); ?&gt;.<br />
&lt;a href=”&lt;?php bloginfo(’rss2_url’); ?&gt;”&gt;Entries (RSS)&lt;/a&gt;.<br />
&lt;a href=”&lt;?php bloginfo(’comments_rss2_url’); ?&gt;”&gt;Comments (RSS)&lt;/a&gt;&lt;/p&gt;</p>
<p>&lt;/div&gt;<br />
&lt;div class=”footer_txt1″&gt;<br />
&lt;a href=”http://badsite. com”&gt;Inappropriate Text&lt;/a&gt; by Bad Site&lt;/a&gt;.<br />
&lt;/div&gt;&lt;?php&gt;</p>
<p>So next time you decide to use a free wordpress theme, make sure you check the theme files BEFORE you place it on your site! If there is encrypted code and it’s released under the GPL License (most are), then there should never be any need for encryption!</p>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=119</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMMS on Ubuntu</title>
		<link>http://aliyev.ws/?p=113</link>
		<comments>http://aliyev.ws/?p=113#comments</comments>
		<pubDate>Sat, 30 Aug 2008 20:02:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ubuntu advices]]></category>
		<category><![CDATA[audacious]]></category>
		<category><![CDATA[audacious ubuntu]]></category>
		<category><![CDATA[Geforce 5200 driver ubuntu]]></category>
		<category><![CDATA[toshiba tecra m2 audacious]]></category>
		<category><![CDATA[toshiba tecra m2 nvidia]]></category>
		<category><![CDATA[xmms]]></category>
		<category><![CDATA[xmms audacious]]></category>
		<category><![CDATA[xmms ubuntu]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=113</guid>
		<description><![CDATA[I&#8217;ve finally got new hdd for my laptop. So I decided to dedicate myself on getting to know more about Desktop version of Ubuntu. Latest copy was installed successfully without any troubles except driver for Nvidia. But that was easily solved by downloading and installing latest driver.

So after a little while I felt that I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally got new hdd for my laptop. So I decided to dedicate myself on getting to know more about Desktop version of Ubuntu. Latest copy was installed successfully without any troubles except driver for Nvidia. But that was easily solved by downloading and installing latest driver.</p>
<p><span id="more-113"></span></p>
<p>So after a little while I felt that I need msn to chat. Browsing the web the choice was done quickly by installing aMSN. Works fine with me. To tell the truth, I didn&#8217;t try camera and voice function, but the rest is fine.</p>
<p>So getting back to the topic. There are articles in the internet saying that there are better mp3 players that xmms. But taking in to the consideration the fact that I&#8217;m experienced MS user, so that it won&#8217;t changed my mind just like that.</p>
<p><strong>sudo apt-get install xmms </strong>-didn&#8217;t work</p>
<p>Spending a bit more time on reading I&#8217;ve found a useful note that xmms has been replaced with <strong>audacious</strong>.</p>
<p>So what i did it was</p>
<p><strong>sudo apt-get install </strong><strong>audacious</strong></p>
<p><strong>Audacious </strong>looks very friendly and common for me. Hope this was useful<strong>.<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=113</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 Things in Linux you should NOT Install</title>
		<link>http://aliyev.ws/?p=95</link>
		<comments>http://aliyev.ws/?p=95#comments</comments>
		<pubDate>Sun, 24 Aug 2008 10:19:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=95</guid>
		<description><![CDATA[While I’m all for promoting the use of Linux and software on Linux, unless you absolutely know what you’re doing, there are certain things you should not install. Entirely too often, I see people on LinuxQuestions.org asking how to configure one of these or why they will not work. So, in no particular order, 3 [...]]]></description>
			<content:encoded><![CDATA[<p>While I’m all for promoting the use of Linux and software on Linux, unless you absolutely know what you’re doing, there are certain things you should not install. Entirely too often, I see people on <a href="http://LinuxQuestions.org ">LinuxQuestions.org </a>asking how to configure one of these or why they will not work. So, in no particular order, 3 Things you should NOT Install:<span id="more-95"></span></p>
<ol>
<li><strong>RedHat 9</strong>. For that matter, you should not install any of the “classic” RedHats. They’re old and outdated. If you want commercially supported, look at RHEL. For free RedHat-like distributions, look at CentOS (Server) and Fedora Core (Workstation). If you run a RedHat 9 server that faces the internet, there is a good chance you will get rooted. It is NOT supported for security or otherwise.</li>
<p></p>
<li><strong>Telnetd</strong>. [Edit: several people have pointed out that I did not make it clear if I meant the server or the client.  The telnet client is quite useful, it is the server that introduces many security concerns.] Telnet is unencrypted and unsecure. Would you send your credit card number over an unencrypted link? Then why send your passwords? SSH can do everything Telnet can, and more. SSH can do file transfers, encrypt other connections, compress your data stream, and allow you to connect without typing a password. Oh, and there are SSH clients for just about every system on earth, so no worries about incompatibilities.</li>
<p></p>
<li><strong>rsh, rlogin, etc</strong>. The authentication mechanisms in rsh and rlogin can easily be defeated. Oh, and they use plaintext too, so everything that applies to Telnet applies here as well.</li>
</ol>
<p>I can think of several more items, but these are the biggest for security. And while you’re configuring the SSH server, don’t forget to turn root logins off with “PermitRootLogin no”.</p>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=95</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux file permissions</title>
		<link>http://aliyev.ws/?p=86</link>
		<comments>http://aliyev.ws/?p=86#comments</comments>
		<pubDate>Wed, 20 Aug 2008 08:38:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ubuntu advices]]></category>
		<category><![CDATA[file permissions]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux permissions]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=86</guid>
		<description><![CDATA[The basics of file ownership and permissions on Linux. Learn to understand who are the owners of a file or directory, how the file permissions work and how you can view them, and learn how to set basic file permissions yourself.

&#60; Permissions and ownership &#8211; why? &#62;
If you can&#8217;t access some of the files on [...]]]></description>
			<content:encoded><![CDATA[<p>The basics of file ownership and permissions on Linux. Learn to understand who are the owners of a file or directory, how the file permissions work and how you can view them, and learn how to set basic file permissions yourself.</p>
<p><span id="more-86"></span><br />
<strong>&lt; Permissions and ownership &#8211; why? &gt;</strong></p>
<p>If you can&#8217;t access some of the files on your very own Linux system, it&#8217;s usually because of misconfigured file access permissions. If you are the only user on your Linux box, you may be wondering what&#8217;s the point of having all these permissions (or lack thereof) that restrict your access to your very own penguin OS. However, before pulling your hair off, you must keep in mind Linux is designed to be a multi-user environment. In an environment with more than one users, it is crucial to have a secure system for deciding which files are yours and who can fiddle with them.</p>
<p>Even if you&#8217;re the only user on an ordinary desktop system, file permissions help keeping your important files safe, both from outsiders and your own mistakes. <img src='http://aliyev.ws/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>&lt; Understanding file ownership &gt;</strong></p>
<p>Every file on your Linux system, including directories, is owned by a specific user and group. Therefore, file permissions are defined separately for users, groups, and others.</p>
<p>User: The username of the person who owns the file. By default, the user who creates the file will become its owner.</p>
<p>Group: The usergroup that owns the file. All users who belong into the group that owns the file will have the same access permissions to the file. This is useful if, for example, you have a project that requires a bunch of different users to be able to access certain files, while others can&#8217;t. In that case, you&#8217;ll add all the users into the same group, make sure the required files are owned by that group, and set the file&#8217;s group permissions accordingly.</p>
<p>Other: A user who isn&#8217;t the owner of the file and doesn&#8217;t belong in the same group the file does. In other words, if you set a permission for the &#8220;other&#8221; category, it will affect everyone else by default. For this reason, people often talk about setting the &#8220;world&#8221; permission bit when they mean setting the permissions for &#8220;other.&#8221;</p>
<p><strong>&lt; Understanding file permissions &gt;</strong></p>
<p>There are three types of access permissions on Linux: read, write, and execute. These permissions are defined separately for the file&#8217;s owner, group and all other users.</p>
<p>Read permission. On a regular file, the read permission bit means the file can be opened and read. On a directory, the read permission means you can list the contents of the directory.</p>
<p>Write permission. On a regular file, this means you can modify the file, aka write new data to the file. In the case of a directory, the write permission means you can add, remove, and rename files in the directory. This means that if a file has the write permission bit, you are allowed to modify the file&#8217;s contents, but you&#8217;re allowed to rename or delete the file only if the permissions of the file&#8217;s directory allow you to do so.</p>
<p>Execute permission. In the case of a regular file, this means you can execute the file as a program or a shell script. On a directory, the execute permission (also called the &#8220;search bit&#8221;) allows you to access files in the directory and enter it, with the cd command, for example. However, note that although the execute bit lets you enter the directory, you&#8217;re not allowed to list its contents, unless you also have the read permissions to that directory.</p>
<p><strong>&lt; How to view file permissions &gt;</strong></p>
<p>You can view the access permissions of a file by doing the long directory listing with the ls -l command. This is what a long directory listing might look like:</p>
<p><strong>me@puter: /home/writers$ ls -l</strong><br />
<strong><br />
total 17</strong><br />
<strong><br />
drwxr-xr-x 3 nana writers 80 2005-09-20 21:37 dir<br />
-rw-r&#8212;&#8211; 1 nana writers 8187 2005-09-19 13:35 file<br />
-rwxr-xr-x 1 nana writers 10348 2005-07-17 20:31 otherfile</strong></p>
<p>What does the output of ls -l mean? The very first column, the one that looks like a bunch of mumbo jumbo, shows the file type and permissions. The second column shows the number of links (directory entries that refer to the file), the third one shows the owner of the file, and the fourth one shows the group the file belongs to. The other columns show the file&#8217;s size in bytes, date and time of last modification, and the filename.</p>
<p>The first column, the one that shows the file&#8217;s permissions and looks like mumbo jumbo, is organized into four separate groups, although it certainly doesn&#8217;t look very organized.</p>
<p>The first group consists of only one character, and it shows the file&#8217;s type. For example, d means a directory and &#8211; means a normal file, so if you take a look at our example output, you&#8217;ll notice dir is a directory, while file and otherfile are regular files.</p>
<p>The first character can be any of these:</p>
<p><em>d = directory<br />
- = regular file<br />
l = symbolic link<br />
s = Unix domain socket<br />
p = named pipe<br />
c = character device file<br />
b = block device file</em></p>
<p>The next nine characters show the file&#8217;s permissions, divided into three groups, each consisting of three characters. The first group of three characters shows the read, write, and execute permissions for user, the owner of the file. The next group shows the read, write, and execute permissions for the group of the file. Similarly, the last group of three characters shows the permissions for other, everyone else. In each group, the first character means the read permission, the second one write permission, and the third one execute permission.</p>
<p>The characters are pretty easy to remember.</p>
<p><strong>r</strong> = read permission<br />
<strong>w</strong> = write permission<br />
<strong>x</strong> = execute permission<br />
<strong>-</strong> = no permission</p>
<p>What does this mean in practice? Let&#8217;s have an example. Remember the imaginary directory listing we did at the beginning? The output looked like this:</p>
<p><strong>drwxr-xr-x 3 nana writers 80 2005-09-20 21:37 dir<br />
-rw-r&#8212;&#8211; 1 nana writers 8187 2005-09-19 13:35 file<br />
-rwxr-xr-x 1 nana writers 10348 2005-07-17 20:31 otherfile</strong></p>
<p>As we already noticed, dir is a directory, because the first column begins with a d. The owner of this directory is user nana and the group owner is writers. The first three characters, rwx, indicate the directory&#8217;s owner, nana in this case, has full access to the directory. The user nana is able to access, view, and modify the files in that directory. The next three characters, r-x, indicate that all users belonging to group writers have read and execute permissions to the directory. They can change into the directory, execute files, and view its contents. However, because they don&#8217;t have write permissions, they can&#8217;t make any changes to the directory content. Finally, the last three characters, r-x, indicate that all the users who are not nana or don&#8217;t belong into group writers, have read and execute permissions in the directory.</p>
<p>How about file? Because the first column begins with a -, the file is a regular file, owned by user nana and group writers, just like the directory in our example. The first three characters, rw-, indicate the owner has read and write access to the file. According to the next three characters, r&#8211;, the users belonging to group writers can view the file but not modify or execute it. The final three characters, &#8212;, indicate no one else has any access to the file.</p>
<p>Similarly, you can see otherfile is a regular file and its owner has full access to it, while everyone else can read and execute the file but not modify it.</p>
<p><strong>&lt; How to set file permissions &#8211; symbolic mode &gt;</strong></p>
<p>You can set file permissions with the chmod command. Both the root user and the file&#8217;s owner can set file permissions. chmod has two modes, symbolic and numeric.</p>
<p>The symbolic mode is pretty easy to remember. First, you decide if you set permissions for the user (u), the group (g), others (o), or all of the three (a). Then, you either add a permission (+), remove it (-), or wipe out the previous permissions and add a new one (=). Next, you decide if you set the read permission (r), write permission (w), or execute permission (x). Last, you&#8217;ll tell chmod which file&#8217;s permissions you want to change.</p>
<p>Let&#8217;s have a couple of examples. Suppose we have a regular file called testfile, and the file has full access permissions for all the groups (long directory listing would show -rwxrwxrwx as the file&#8217;s permissions).</p>
<p>Wipe out all the permissions but add read permission for everybody:<br />
<strong><br />
$ chmod a=r testfile</strong><br />
After the command, the file&#8217;s permissions would be -r&#8211;r&#8211;r&#8211;</p>
<p>Add execute permissions for group:<br />
<strong><br />
$ chmod g+x testfile</strong><br />
Now, the file&#8217;s permissions would be -r&#8211;r-xr&#8211;</p>
<p>Add both write and execute permissions for the file&#8217;s owner. Note how you can set more than one permission at the same time:<br />
<strong><br />
$ chmod u+wx testfile</strong><br />
After this, the file permissions will be -rwxr-xr&#8211;</p>
<p>Remove the execute permission from both the file&#8217;s owner and group. Note, again, how you can set them both at once:<br />
<strong><br />
$ chmod ug-x testfile</strong><br />
Now, the permissions are -rw-r&#8211;r&#8211;</p>
<p>As a summary, have a look at this quick reference for setting file permissions in symbolic mode:</p>
<table class="tuxtable" border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Which user?</strong></em></td>
</tr>
<tr>
<td class="tuxtext">u</td>
<td class="tuxtext">user/owner</td>
</tr>
<tr>
<td class="tuxtext">g</td>
<td class="tuxtext">group</td>
</tr>
<tr>
<td class="tuxtext">o</td>
<td class="tuxtext">other</td>
</tr>
<tr>
<td class="tuxtext">a</td>
<td class="tuxtext">all</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>What to do?</strong></em></td>
</tr>
<tr>
<td class="tuxtext">+</td>
<td class="tuxtext">add this permission</td>
</tr>
<tr>
<td class="tuxtext">-</td>
<td class="tuxtext">remove this permission</td>
</tr>
<tr>
<td class="tuxtext">=</td>
<td class="tuxtext">set exactly this permission</td>
</tr>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Which permissions?</strong></em></td>
</tr>
<tr>
<td class="tuxtext">r</td>
<td class="tuxtext">read</td>
</tr>
<tr>
<td class="tuxtext">w</td>
<td class="tuxtext">write</td>
</tr>
<tr>
<td class="tuxtext">x</td>
<td class="tuxtext">execute</td>
</tr>
</tbody>
</table>
<p><strong>&lt; How to set file permissions &#8211; numeric mode &gt;</strong></p>
<p>The other mode in which chmod can be used is the numeric mode. In the numeric mode, the file permissions aren&#8217;t represented by characters. Instead, they are represented by a three-digit octal number.</p>
<p><strong>4</strong> = read (r)<br />
<strong>2</strong> = write (w)<br />
<strong>1</strong> = execute (x)<br />
<strong>0</strong> = no permission (-)</p>
<p>To get the permission bits you want, you add up the numbers accordingly. For example, the rwx permissions would be 4+2+1=7, rx would be 4+1=5, and rw would be 4+2=6. Because you set separate permissions for the owner, group, and others, you&#8217;ll need a three-digit number representing the permissions of all these groups.</p>
<p>Let&#8217;s have an example.<br />
<strong><br />
$ chmod 755 testfile</strong><br />
This would change the testfile&#8217;s permissions to -rwxr-xr-x. The owner would have full read, write, and execute permissions (7=4+2+1), the group would have read and execute permissions (5=4+1), and the world would have the read and execute permissions as well.</p>
<p>Let&#8217;s have another example:<br />
<strong><br />
$ chmod 640 testfile</strong><br />
In this case, testfile&#8217;s permissions would be -rw-r&#8212;&#8211;. The owner would have read and write permissions (6=4+2), the group would have read permissions only (4), and the others wouldn&#8217;t have any access permissions (0).</p>
<p>The numeric mode may not be as straightforward as the symbolic mode, but with the numeric mode, you can more quickly and efficiently set the file permissions. This quick reference for setting file permissions in numeric mode might help:</p>
<table class="tuxtable" border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td class="tuxtitle" colspan="2"><em><strong>Which number?</strong></em></td>
</tr>
<tr>
<td class="tuxtext">0</td>
<td class="tuxtext">&#8212;</td>
</tr>
<tr>
<td class="tuxtext">1</td>
<td class="tuxtext">&#8211;x</td>
</tr>
<tr>
<td class="tuxtext">2</td>
<td class="tuxtext">-w-</td>
</tr>
<tr>
<td class="tuxtext">3</td>
<td class="tuxtext">-wx</td>
</tr>
<tr>
<td class="tuxtext">4</td>
<td class="tuxtext">r&#8211;</td>
</tr>
<tr>
<td class="tuxtext">5</td>
<td class="tuxtext">r-x</td>
</tr>
<tr>
<td class="tuxtext">6</td>
<td class="tuxtext">rw-</td>
</tr>
<tr>
<td class="tuxtext">7</td>
<td class="tuxtext">rwx</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=86</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change a file&#8217;s owner and group in Linux</title>
		<link>http://aliyev.ws/?p=82</link>
		<comments>http://aliyev.ws/?p=82#comments</comments>
		<pubDate>Wed, 20 Aug 2008 08:23:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ubuntu advices]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[chown]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[file permissions]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[линукс]]></category>
		<category><![CDATA[права]]></category>
		<category><![CDATA[права доступа]]></category>
		<category><![CDATA[убунту]]></category>

		<guid isPermaLink="false">http://aliyev.ws/?p=82</guid>
		<description><![CDATA[&#60; chown &#8211; change the owner of a file &#62;
You can change the owner and group of a file or a directory with the chown command. Please, keep in mind you can do this only if you are the root user or the owner of the file.
Set the file&#8217;s owner:
$ chown username somefile
After giving this [...]]]></description>
			<content:encoded><![CDATA[<p><strong>&lt; chown &#8211; change the owner of a file &gt;</strong></p>
<p>You can change the owner and group of a file or a directory with the chown command. Please, keep in mind you can do this only if you are the root user or the owner of the file.</p>
<p>Set the file&#8217;s owner:<br />
<strong>$ chown username somefile</strong><br />
After giving this command, the new owner of a file called somefile will be the user username. The file&#8217;s group owner will not change. Instead of a user name, you can also give the user&#8217;s numeric ID here if you want.<br />
<span id="more-82"></span><br />
You can also set the file&#8217;s group at the same time. If the user name is followed by a colon and a group name, the file&#8217;s group will be changed as well.<br />
<strong>$ chown username:usergroup somefile</strong><br />
After giving this command, somefile&#8217;s new owner would be user username and the group usergroup.</p>
<p>You can set the owner of a directory exactly the same way you set the owner of a file:<br />
<strong>$ chown username somedir</strong><br />
Note that after giving this command, only the owner of the directory will change. The owner of the files inside of the directory won&#8217;t change.</p>
<p>In order to set the ownership of a directory and all the files in that directory, you&#8217;ll need the -R option:<br />
<strong>$ chown -R username somedir</strong><br />
Here, R stands for recursive because this command will recursively change the ownership of directories and their contents. After issuing this example command, the user username will be the owner of the directory somedir, as well as every file in that directory.</p>
<p>Tell what happens:</p>
<p><strong>$ chown -v username somefile</strong><br />
changed ownership of &#8217;somefile&#8217; to username</p>
<p>Here, v stands for verbose. If you use the -v option, chown will list what it did (or didn&#8217;t do) to the file.</p>
<p>The verbose mode is especially useful if you change the ownership of several files at once. For example, this could happen when you do it recursively:</p>
<p><strong>$ chown -Rv username somedir</strong><br />
<em>changed ownership of &#8217;somedir/&#8217; to username<br />
changed ownership of &#8217;somedir/boringfile&#8217; to username<br />
changed ownership of &#8217;somedir/somefile&#8217; to u</em>sername</p>
<p>As you can see, chown nicely reports to you what it did to each file.</p>
<p><strong>&lt; chgrp &#8211; change the group ownership of a file &gt;</strong></p>
<p>In addition to chown, you can also use the chgrp command to change the group of a file or a directory. You must, again, be either the root user or the owner of the file in order to change the group ownership.</p>
<p>chgrp works pretty much the same way as chown does, except it changes the file&#8217;s user group instead of the owner, of course.<br />
<strong>$ chgrp usergroup somefile</strong><br />
After issuing this command, the file somefile will be owned by a user group usergroup. Although the file&#8217;s group has changed to usergroup, the file&#8217;s owner will still be the same.</p>
<p>The options of using chgrp are the same as using chown. So, for example, the -R and -v options will work with it just like they worked with chown:</p>
<p><strong>$ chgrp -Rv usergroup somedir</strong><br />
<em>changed group of &#8217;somedir/&#8217; to usergroup<br />
changed group of &#8217;somedir/boringfile&#8217; to usergroup<br />
changed group of &#8217;somedir/somefile&#8217; to usergroup<br />
</em><br />
chown nicely reports to you what it did to each file.</p>
]]></content:encoded>
			<wfw:commentRss>http://aliyev.ws/?feed=rss2&amp;p=82</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
