<?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>Jontas &#187; linux</title>
	<atom:link href="http://www.f15ijp.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.f15ijp.com</link>
	<description>My digital notepad (notes etc)</description>
	<lastBuildDate>Wed, 28 Dec 2011 18:24:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Add a user to a group</title>
		<link>http://www.f15ijp.com/2010/12/03/add-a-user-to-a-group/</link>
		<comments>http://www.f15ijp.com/2010/12/03/add-a-user-to-a-group/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 10:14:33 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=745</guid>
		<description><![CDATA[To add a existing user to a group usermod -a -G thegroup theuser To add a user to a group when the user is created useradd -G thegroup theuser]]></description>
			<content:encoded><![CDATA[<p>To add a existing user to a group</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usermod <span style="color: #660033;">-a</span> <span style="color: #660033;">-G</span> thegroup theuser</pre></div></div>

<p>To add a user to a group when the user is created</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">useradd <span style="color: #660033;">-G</span> thegroup theuser</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/12/03/add-a-user-to-a-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL 8.3 adding uuid-ossp on Debian</title>
		<link>http://www.f15ijp.com/2010/10/03/postgresql-8-3-adding-uuid-ossp-on-debian/</link>
		<comments>http://www.f15ijp.com/2010/10/03/postgresql-8-3-adding-uuid-ossp-on-debian/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 09:53:23 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Postgres]]></category>
		<category><![CDATA[PostgreSQL module]]></category>
		<category><![CDATA[uuid]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=675</guid>
		<description><![CDATA[UUID is a nice way to generate (almost) unique id&#8217;s. However on PostgreSQL 8.3 the data type exists, but if you wish to be able to generate UUID&#8217;s you need to get a module (in this case uuid-ossp). On Debian this module is in the contrib package, so if you have not installed this before [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/UUID">UUID</a> is a nice way to generate (almost) unique id&#8217;s.</p>
<p>However on PostgreSQL 8.3 the data type exists, but if you wish to be able to generate UUID&#8217;s you need to get a module (in this case <a href="http://www.postgresql.org/docs/8.3/static/uuid-ossp.html">uuid-ossp</a>).</p>
<p>On Debian this module is in the contrib package, so if you have not installed this before do it now</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> postgresql-contrib</pre></div></div>

<p>Then you need to &#8220;load&#8221; the module into PostgreSQL; or more accurately you tell PostgreSQL about the new functions this module has, how to reach them etc.<br />
Depending on you security settings (in pg_hba.conf) you may need to log in as the postgres user on your system.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">postgres<span style="color: #000000; font-weight: bold;">@</span>sever:~$ psql <span style="color: #660033;">-d</span> MYDB <span style="color: #660033;">-U</span> postgres <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postgresql<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8.3</span><span style="color: #000000; font-weight: bold;">/</span>contrib<span style="color: #000000; font-weight: bold;">/</span>uuid-ossp.sql</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/10/03/postgresql-8-3-adding-uuid-ossp-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Hibernate/Suspend problem</title>
		<link>http://www.f15ijp.com/2010/10/01/ubuntu-hibernatesuspend-problem/</link>
		<comments>http://www.f15ijp.com/2010/10/01/ubuntu-hibernatesuspend-problem/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 08:34:56 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[suspend]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=669</guid>
		<description><![CDATA[First off, quick explanation. Suspend saves a image to ram. It is faster to save and reload; but the computer uses a minimal amount of energy to keep this in ram. If the power is lost (battery is drained etc) then the image is lost. Hibernate save a image to disk. It is slightly slower [...]]]></description>
			<content:encoded><![CDATA[<p>First off, quick explanation.<br />
Suspend saves a image to ram. It is faster to save and reload; but the computer uses a minimal amount of energy to keep this in ram. If the power is lost (battery is drained etc) then the image is lost.<br />
Hibernate save a image to disk. It is slightly slower to save and reload; but there is no problem if the power is lost.</p>
<p>However I am not the only one that have noticed that hibernate/suspend on Ubuntu does not work on a default installation.<br />
One solution that more than me have found to be working is to switch to uswsusp.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>laptop$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> uswsusp
user<span style="color: #000000; font-weight: bold;">@</span>laptop$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> s2disk</pre></div></div>

<p>s2disk does a hibernation (s2ram does a suspend); and it is good to test it out before swapping the hibernate/suspend function.<br />
When you know hibernate/suspend works, you can swap to using uswsusp by using:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>laptop$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dpkg-divert <span style="color: #660033;">--rename</span> <span style="color: #660033;">--divert</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>pmi-disabled <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>pmi</pre></div></div>

<p>If you later on would like to swap back you can use</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>laptop$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> dpkg-divert <span style="color: #660033;">--rename</span> <span style="color: #660033;">--remove</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>pmi</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/10/01/ubuntu-hibernatesuspend-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.forward to several recipients</title>
		<link>http://www.f15ijp.com/2010/09/28/forward-to-several-recipients/</link>
		<comments>http://www.f15ijp.com/2010/09/28/forward-to-several-recipients/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 08:08:03 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[.forward]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=660</guid>
		<description><![CDATA[On *nix environments it is possible to forward the mail to one account to another user (or another email address if external mail is supported). This is done by adding the recipient in a file called .forward in the home directory. Example To simply forward to another address: user@server$ echo recipient@mail.com &#62; ~/.forward user@server$ chmod [...]]]></description>
			<content:encoded><![CDATA[<p>On *nix environments it is possible to forward the mail to one account to another user (or another email address if external mail is supported).<br />
This is done by adding the recipient in a file called .forward in the home directory.</p>
<p>Example To simply forward to another address:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server$ <span style="color: #7a0874; font-weight: bold;">echo</span> recipient<span style="color: #000000; font-weight: bold;">@</span>mail.com <span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.forward
user<span style="color: #000000; font-weight: bold;">@</span>server$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> go-w ~<span style="color: #000000; font-weight: bold;">/</span>.forward</pre></div></div>

<p>In order to forward to several addresses coma (,) is used as a delimiter between the different recipients.</p>
<p>Example To forward to two addresses at the same time:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server$ <span style="color: #7a0874; font-weight: bold;">echo</span> recipient1<span style="color: #000000; font-weight: bold;">@</span>mail.com,recipient2<span style="color: #000000; font-weight: bold;">@</span>mail.com <span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.forward
user<span style="color: #000000; font-weight: bold;">@</span>server$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> go-w ~<span style="color: #000000; font-weight: bold;">/</span>.forward</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/09/28/forward-to-several-recipients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sudo: cd: command not found</title>
		<link>http://www.f15ijp.com/2010/09/13/sudo-cd-command-not-found/</link>
		<comments>http://www.f15ijp.com/2010/09/13/sudo-cd-command-not-found/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 13:21:45 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=626</guid>
		<description><![CDATA[If you try to use sudo to get to a directory (for instance if the user calling sudo don&#8217;t have permissions for that folder) then you will see an error message like this user@server:~$ sudo cd /var/log/ sudo: cd: command not found While I don&#8217;t know how to get sudo to work with cd I [...]]]></description>
			<content:encoded><![CDATA[<p>If you try to use sudo to get to a directory (for instance if the user calling sudo don&#8217;t have permissions for that folder) then you will see an error message like this</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span>: <span style="color: #7a0874; font-weight: bold;">cd</span>: <span style="color: #7a0874; font-weight: bold;">command</span> not found</pre></div></div>

<p>While I don&#8217;t know how to get sudo to work with cd I can offer some workarounds.<br />
As far as I can tell the problem with sudo cd is that if it would have worked the user would be in a directory that he/she has no permissions to so nothing is gained and having a folder that the user don&#8217;t have permissions to as the working directory might cause problems in more way than one.</p>
<ul>
<li>Use &#8220;sudo ls&#8221; and then continue with the next command as sudo without entering that folder; for instance

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>syslog</pre></div></div>

</li>
<li>Open a shell using sudo:

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

<p> this will give you a shell with su permissions</li>
<li>simulate initial login using sudo:

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

<p> this will also give you su permissions but with the difference that it will be like logging in like root (home dir, profile, variables etc) [this would be equivalent of running "sudo su"]</li>
<li>Use sudo to start a new shell and do all you need to do in this shell

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'cd /var/spool/exim4/;ls'</span></pre></div></div>

<p> (don&#8217;t miss the single quotes in the command)</li>
</ul>
<p>To give some more details on the difference between -i and -s here is a excerpt from the man pages</p>
<p><strong>-i [command]</strong><br />
The -i (simulate initial login) option runs the shell specified in the passwd(5) entry of the target user as a login shell.  This means that login-specific resource files such as .profile or .login will be read by the shell.  If a command is specified, it is passed to the shell for execution.  Otherwise, an interactive shell is executed.  sudo attempts to change to that user&#8217;s home directory before running the shell.  It also initializes the environment, leaving DISPLAY and TERM unchanged, setting HOME, SHELL, USER, LOGNAME, and PATH, as well as the contents of /etc/environment on Linux and AIX systems.  All other environment variables are removed.<br />
<strong>-s [command]</strong><br />
The -s (shell) option runs the shell specified by the SHELL environment variable if it is set or the shell as specified in passwd(5).  If a command is specified, it is passed to the shell for execution.  Otherwise, an interactive shell is executed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/09/13/sudo-cd-command-not-found/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux send a log (or output from a command) as a mail from the linux console</title>
		<link>http://www.f15ijp.com/2010/08/18/linux-send-a-log-as-a-mail-from-the-linux-console/</link>
		<comments>http://www.f15ijp.com/2010/08/18/linux-send-a-log-as-a-mail-from-the-linux-console/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 11:00:22 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=584</guid>
		<description><![CDATA[Sometimes it is nice to send a log or some other file as a email to someone (or a part of a file) cat myfile.txt &#124; mail -s 'SUBJECT' example@mail.com; Change myfile.txt, SUBJECT and example@mail.com to something useful. It is also possible to send the output of a command to someone ps -ef&#124;mail -s 'SUBJET' [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is nice to send a log or some other file as a email to someone (or a part of a file)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> myfile.txt <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">'SUBJECT'</span> example<span style="color: #000000; font-weight: bold;">@</span>mail.com;</pre></div></div>

<p>Change myfile.txt, SUBJECT and example@mail.com to something useful.</p>
<p>It is also possible to send the output of a command to someone</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ef</span><span style="color: #000000; font-weight: bold;">|</span>mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">'SUBJET'</span> example<span style="color: #000000; font-weight: bold;">@</span>mail.com;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/08/18/linux-send-a-log-as-a-mail-from-the-linux-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: Finding the serial number of a hard drive</title>
		<link>http://www.f15ijp.com/2010/07/23/linux-finding-the-serial-number-of-a-hard-driv/</link>
		<comments>http://www.f15ijp.com/2010/07/23/linux-finding-the-serial-number-of-a-hard-driv/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 20:33:22 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[hd]]></category>
		<category><![CDATA[hdparm]]></category>
		<category><![CDATA[sd]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=557</guid>
		<description><![CDATA[Finding the serial number of a hard drive on a Linux console (as root) is simple with the right tool. The right tool in this case is hdparm (using the -i option). -i will query the device directly for the details. Example: themachine:/proc# hdparm -i /dev/sda &#160; /dev/sda: &#160; Model=ST31500341AS , FwRev=CC1H , SerialNo= 9VS21ZXM [...]]]></description>
			<content:encoded><![CDATA[<p>Finding the serial number of a hard drive on a Linux console (as root) is simple with the right tool.<br />
The right tool in this case is hdparm (using the -i option).<br />
-i will query the device directly for the details.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">themachine:<span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #666666; font-style: italic;"># hdparm -i /dev/sda</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda:
&nbsp;
 <span style="color: #007800;">Model</span>=ST31500341AS                            , <span style="color: #007800;">FwRev</span>=CC1H    , <span style="color: #007800;">SerialNo</span>=            9VS21ZXM
 <span style="color: #007800;">Config</span>=<span style="color: #7a0874; font-weight: bold;">&#123;</span> HardSect NotMFM HdSw<span style="color: #000000; font-weight: bold;">&gt;</span>15uSec Fixed DTR<span style="color: #000000; font-weight: bold;">&gt;</span>10Mbs RotSpdTol<span style="color: #000000; font-weight: bold;">&gt;</span>.5<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span>
 <span style="color: #007800;">RawCHS</span>=<span style="color: #000000;">16383</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">16</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">63</span>, <span style="color: #007800;">TrkSize</span>=<span style="color: #000000;">0</span>, <span style="color: #007800;">SectSize</span>=<span style="color: #000000;">0</span>, <span style="color: #007800;">ECCbytes</span>=<span style="color: #000000;">4</span>
 <span style="color: #007800;">BuffType</span>=unknown, <span style="color: #007800;">BuffSize</span>=0kB, <span style="color: #007800;">MaxMultSect</span>=<span style="color: #000000;">16</span>, <span style="color: #007800;">MultSect</span>=?<span style="color: #000000;">16</span>?
 <span style="color: #007800;">CurCHS</span>=<span style="color: #000000;">16383</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">16</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">63</span>, <span style="color: #007800;">CurSects</span>=<span style="color: #000000;">16514064</span>, <span style="color: #007800;">LBA</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>, <span style="color: #007800;">LBAsects</span>=<span style="color: #000000;">18446744072344861488</span>
 <span style="color: #007800;">IORDY</span>=on<span style="color: #000000; font-weight: bold;">/</span>off, <span style="color: #007800;">tPIO</span>=<span style="color: #7a0874; font-weight: bold;">&#123;</span>min:<span style="color: #000000;">120</span>,w<span style="color: #000000; font-weight: bold;">/</span>IORDY:<span style="color: #000000;">120</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>, <span style="color: #007800;">tDMA</span>=<span style="color: #7a0874; font-weight: bold;">&#123;</span>min:<span style="color: #000000;">120</span>,rec:<span style="color: #000000;">120</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 <span style="color: #000000; font-weight: bold;">*</span>udma6 
 <span style="color: #007800;">AdvancedPM</span>=no <span style="color: #007800;">WriteCache</span>=enabled
 Drive conforms to: unknown:  ATA<span style="color: #000000; font-weight: bold;">/</span>ATAPI-<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span>,<span style="color: #000000;">7</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">*</span> signifies the current active mode</pre></div></div>

<p>Using the option -I instead gives even more information:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">themachine:<span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #666666; font-style: italic;"># hdparm -I /dev/sda</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda:
&nbsp;
ATA device, with non-removable media
        Model Number:       ST31500341AS                            
        Serial Number:      9VS21ZXM
        Firmware Revision:  CC1H    
        Transport:          Serial
Standards:
        Used: unknown <span style="color: #7a0874; font-weight: bold;">&#40;</span>minor revision code 0x0029<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
        Supported: <span style="color: #000000;">8</span> <span style="color: #000000;">7</span> <span style="color: #000000;">6</span> <span style="color: #000000;">5</span> 
        Likely used: <span style="color: #000000;">8</span>
Configuration:
        Logical         max     current
        cylinders       <span style="color: #000000;">16383</span>   <span style="color: #000000;">16383</span>
        heads           <span style="color: #000000;">16</span>      <span style="color: #000000;">16</span>
        sectors<span style="color: #000000; font-weight: bold;">/</span>track   <span style="color: #000000;">63</span>      <span style="color: #000000;">63</span>
        <span style="color: #660033;">--</span>
        CHS current addressable sectors:   <span style="color: #000000;">16514064</span>
        LBA    user addressable sectors:  <span style="color: #000000;">268435455</span>
        LBA48  user addressable sectors: <span style="color: #000000;">2930277168</span>
        device <span style="color: #c20cb9; font-weight: bold;">size</span> with M = <span style="color: #000000;">1024</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000;">1024</span>:     <span style="color: #000000;">1430799</span> MBytes
        device <span style="color: #c20cb9; font-weight: bold;">size</span> with M = <span style="color: #000000;">1000</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000;">1000</span>:     <span style="color: #000000;">1500301</span> MBytes <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1500</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Capabilities:
        LBA, IORDY<span style="color: #7a0874; font-weight: bold;">&#40;</span>can be disabled<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        Queue depth: <span style="color: #000000;">32</span>
        Standby timer values: spec<span style="color: #ff0000;">'d by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = ?
        Recommended acoustic management value: 254, current value: 0
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4 
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    DOWNLOAD_MICROCODE
                SET_MAX security extension
           *    Automatic Acoustic Management feature set
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    General Purpose Logging feature set
           *    WRITE_{DMA|MULTIPLE}_FUA_EXT
           *    64-bit World wide name
                Write-Read-Verify feature set
           *    WRITE_UNCORRECTABLE_EXT command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
           *    SATA-I signaling speed (1.5Gb/s)
           *    SATA-II signaling speed (3.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Phy event counters
                Device-initiated interface power management
           *    Software settings preservation
           *    SMART Command Transport (SCT) feature set
           *    SCT Long Sector Access (AC1)
           *    SCT LBA Segment Access (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
                unknown 206[12] (vendor specific)
Security: 
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
                supported: enhanced erase
        240min for SECURITY ERASE UNIT. 240min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000c50014ec1f60
        NAA             : 5
        IEEE OUI        : c50
        Unique ID       : 014ec1f60
Checksum: correct</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/07/23/linux-finding-the-serial-number-of-a-hard-driv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pine: Flags</title>
		<link>http://www.f15ijp.com/2010/06/23/pine-flags/</link>
		<comments>http://www.f15ijp.com/2010/06/23/pine-flags/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 19:18:34 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[pine]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=514</guid>
		<description><![CDATA[To mark a message as unread in pine this can be done using flags. First flags have to be turned on in setup [M]ain [S]etup [C]onfig Then find &#8220;enable-flag-cmd&#8221; and turn it on. After this marking a message as unread is done by &#8220;* N&#8221; in the list view or when looking at the message. [...]]]></description>
			<content:encoded><![CDATA[<p>To mark a message as unread in pine this can be done using flags.<br />
First flags have to be turned on in setup<br />
[M]ain [S]etup [C]onfig<br />
Then find &#8220;enable-flag-cmd&#8221; and turn it on.<br />
After this marking a message as unread is done by &#8220;* N&#8221; in the list view or when looking at the message.</p>
<p>All the flags are:</p>
<ul>
<li>[N]New</li>
<li>[D]Deleted</li>
<li>[*] Important</li>
<li>[A] Answered</li>
</ul>
<p>[^T] Can be used to see all the flags and set/unset them one by one (or all).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/06/23/pine-flags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apt-get WARNING: The following packages cannot be authenticated!</title>
		<link>http://www.f15ijp.com/2010/06/08/apt-get-warning-the-following-packages-cannot-be-authenticated/</link>
		<comments>http://www.f15ijp.com/2010/06/08/apt-get-warning-the-following-packages-cannot-be-authenticated/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 07:12:49 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[apt-get]]></category>

		<guid isPermaLink="false">http://www.f15ijp.com/?p=500</guid>
		<description><![CDATA[apt-get is verifying the packages before installing them. If the keys are not up to date, then apt-get upgrade will issue a warning. WARNING: The following packages cannot be authenticated! ure uno-libs3 Install these packages without verification &#91;y/N&#93;? The way to solve this is rather simple, just run apt-get update and it should download the [...]]]></description>
			<content:encoded><![CDATA[<p>apt-get is verifying the packages before installing them.<br />
If the keys are not up to date, then apt-get upgrade will issue a warning.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">WARNING: The following packages cannot be authenticated<span style="color: #000000; font-weight: bold;">!</span>
  ure uno-libs3
Install these packages without verification <span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #000000; font-weight: bold;">/</span>N<span style="color: #7a0874; font-weight: bold;">&#93;</span>?</pre></div></div>

<p>The way to solve this is rather simple, just run apt-get update and it should download the keys automatically.</p>
<p>apt-key handles keys, using apt-key list will show you the keys that are on the computer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/06/08/apt-get-warning-the-following-packages-cannot-be-authenticated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Limit the download speed of apt-get</title>
		<link>http://www.f15ijp.com/2010/05/27/limit-the-download-speed-of-apt-get/</link>
		<comments>http://www.f15ijp.com/2010/05/27/limit-the-download-speed-of-apt-get/#comments</comments>
		<pubDate>Thu, 27 May 2010 07:25:53 +0000</pubDate>
		<dc:creator>jontas</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[apt-get]]></category>

		<guid isPermaLink="false">http://f15ijp.com/?p=476</guid>
		<description><![CDATA[Sometimes it is nice to limit the download speed of apt-get. The way I do this is to create a file &#8220;/etc/apt/apt.conf.d/76download&#8221; and enter the following to it Acquire&#123;Queue-mode &#34;access&#34;;http&#123;Dl-Limit &#34;50&#34;;&#125;;&#125;; This will limit apt-get to at most 50 kb/s for apt-get. Some other how to&#8217;s suggest the use of dl-limit but be adviced, dl-limit [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is nice to limit the download speed of apt-get.</p>
<p>The way I do this is to create a file &#8220;/etc/apt/apt.conf.d/76download&#8221; and enter the following to it</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Acquire<span style="color: #7a0874; font-weight: bold;">&#123;</span>Queue-mode <span style="color: #ff0000;">&quot;access&quot;</span>;http<span style="color: #7a0874; font-weight: bold;">&#123;</span>Dl-Limit <span style="color: #ff0000;">&quot;50&quot;</span>;<span style="color: #7a0874; font-weight: bold;">&#125;</span>;<span style="color: #7a0874; font-weight: bold;">&#125;</span>;</pre></div></div>

<p>This will limit apt-get to at most 50 kb/s for apt-get.<br />
Some other how to&#8217;s suggest the use of dl-limit but be adviced, dl-limit is per each connection apt-get does (normally it does 2 at a time); the one used above caps apt-get in total.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f15ijp.com/2010/05/27/limit-the-download-speed-of-apt-get/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

