<?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>Russell Coker's Documents</title>
	<atom:link href="http://doc.coker.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://doc.coker.com.au</link>
	<description>Documents that are not date based</description>
	<lastBuildDate>Sat, 26 Jun 2010 13:14:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Computer Power Use</title>
		<link>http://doc.coker.com.au/environment/computer-power-use/</link>
		<comments>http://doc.coker.com.au/environment/computer-power-use/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 08:24:51 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[environment]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/environment/computer-power-use/</guid>
		<description><![CDATA[This table shows the power consumption of some of the computers I own. I use a domestic electricity meter that was certified for use in billing customers to measure this. Any inaccuracies in the measurement will correspond to inaccuracies in electricity bills of people who use such computers. Before anyone asks, I am not interested [...]]]></description>
			<content:encoded><![CDATA[<p>This table shows the power consumption of some of the computers I own.  I use a domestic electricity meter that was certified for use in billing customers to measure this.  Any inaccuracies in the measurement will<br />
correspond to inaccuracies in electricity bills of people who use such computers.</p>
<p>Before anyone asks, I am not interested in contributions of data, I believe that doing tests with a different meter or in a different country with a different supply voltage will diminish the accuracy of the results.  Also I will provide minimal analysis on this page (the numbers should allow you to perform your own analysis).</p>
<p>Before I started such tests I had significant problems cooling my house in summer.  Based on the results of these tests I made changes such as replacing the Compaq 1GHz Athlon machine by an IBM 1GHz P3 machine for a small server I run, this saved 49W of power, 49W of power which mostly ends up as heat makes a significant difference in a small server room when running 24*7!</p>
<p>All the machines below apart from the SMP machine are workstation class machines, they don&#8217;t have ECC RAM and their PSUs are designed for small load.  The SMP machine has a PSU designed for a desktop machine (I couldn&#8217;t easily obtain any other type).  If it had a PSU designed for server use it would draw more power.</p>
<p>Unless otherwise noted all machines were idling while running Linux (idling while running DOS uses significantly more power).</p>
<p>The summary of this table is, P3 is a great CPU for power to computer power ratio, the P4 isn&#8217;t too good, and the Athlon sucks badly &#8211; don&#8217;t run an Athlon server if you have heat problems!</p>
<table border="1">
<tr>
<td>Compaq SFF 800MHz P3 512M 10G IDE</td>
<td>35W</td>
</tr>
<tr>
<td>Compaq SFF 800MHz P3 512M 10G IDE spun-down</td>
<td>28W</td>
</tr>
<tr>
<td>Compaq 800MHz P3 128M 10G IDE</td>
<td>38W</td>
</tr>
<tr>
<td>Compaq 1.5GHz P4 256M 20G IDE, idling</td>
<td>78W</td>
</tr>
<tr>
<td>Compaq 1.5GHz P4 256M 20G IDE, installing</td>
<td>85W</td>
</tr>
<tr>
<td>IBM 1GHz P3 256M 30G IDE, idling</td>
<td>38W</td>
</tr>
<tr>
<td>Compaq 1.1GHz Celeron 512M 40G IDE idling</td>
<td>46W</td>
</tr>
<tr>
<td>Compaq 1GHz Athlon 256M 20G IDE idling</td>
<td>87W</td>
</tr>
<tr>
<td>SMP 2*P3 1GHz, 1GB RAM, 2*U160 SCSI 18G disks idle</td>
<td>81W</td>
</tr>
<tr>
<td>SMP 2*P3 1GHz, 1GB RAM, 2*U160 SCSI 18G disks disk busy</td>
<td>99W</td>
</tr>
<tr>
<td>SMP 2*P3 1GHz, 1GB RAM, 2*U160 SCSI 18G disks CPU busy</td>
<td>130W</td>
</tr>
<tr>
<td>SMP 2*P3 1GHz, 1GB RAM, 2*U160 SCSI 18G disks CPU and disk busy</td>
<td>136W</td>
</tr>
<tr>
<td>White-box Athlon XP 1700+, 768M RAM, 2*80G IDE + 46G IDE</td>
<td>110W</td>
</tr>
<tr>
<td>HP Pavilion 513A Celeron 1.8GHz, 384M RAM, 40G IDE</td>
<td>45W</td>
</tr>
<tr>
<td>HP Pavilion 513A Celeron 1.8GHz, 768M RAM, 2*80G IDE + 46G IDE</td>
<td>58W</td>
</tr>
<tr>
<td>Cobalt Qube AMD K6-450MHz, 128M RAM, 10G IDE</td>
<td>20W</td>
</tr>
<tr>
<td>Packard-Bell (NEC) Celeron-D 2.93GHz, 512M RAM, 2*20G IDE</td>
<td>75W</td>
</tr>
<tr>
<td>NEC Pentium-D (920) 2.8GHz, 1G RAM, 160G S-ATA</td>
<td>98W</td>
</tr>
<tr>
<td>NEC Pentium-E2160 1.8GHz, 1G RAM (1 DIMM), 160G S-ATA</td>
<td>52W</td>
</tr>
<tr>
<td>HP/Compaq Celeron 2.4GHz, 512M RAM, 300G IDE</td>
<td>50W</td>
</tr>
<tr>
<td>HP/Compaq Celeron 2.4GHz, 512M RAM, no hard disk</td>
<td>43W</td>
</tr>
<tr>
<td>Thinkpad T41p 1.7GHz idle at 600MHz, screen on and battery charged</td>
<td>23W</td>
</tr>
<tr>
<td>Thinkpad T20 500MHz P3 512M 30G IDE</td>
<td>10.7W</td>
</tr>
</table>
<p>Here is the <a href="http://doc.coker.com.au/environment/computer-related-power-use/">Computer Related Power Use page [1]</a> (for switches, filters, and other things).</p>
<ul>
<li>[1] <a href="http://doc.coker.com.au/environment/computer-related-power-use/">http://doc.coker.com.au/environment/computer-related-power-use/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/environment/computer-power-use/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Free Short Stories</title>
		<link>http://doc.coker.com.au/fiction/free-short-stories/</link>
		<comments>http://doc.coker.com.au/fiction/free-short-stories/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 23:35:18 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Fiction]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/?p=45</guid>
		<description><![CDATA[Here are some free short science-fiction stories that I enjoyed reading: Maneki Neko by Bruce Sterling is an interesting story about a networked gift economy, I&#8217;d like to join such a network! The Exterminator&#8217;s Want Ad by Bruce Sterling is another good story about the gift economy, not as positive as Maneki Neki though. Barge [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some free short science-fiction stories that I enjoyed reading:</p>
<ul>
<li><a href="http://tqft.net/wiki/Maneki_Neko">Maneki Neko by Bruce Sterling is an interesting story about a networked gift economy</a>, I&#8217;d like to join such a network!</li>
<li><a href="http://shareable.net/blog/the-exterminators-want-ad">The Exterminator&#8217;s Want Ad by Bruce Sterling is another good story about the gift economy</a>, not as positive as Maneki Neki though.</li>
<li><a href="http://www.infinitematrix.net/stories/shorts/barge-over-black-water.html">Barge Over Black Water</a> &#8211; strange</li>
<li><a href="http://www.infinitematrix.net/stories/shorts/dr_nefario.html">The Death Trap of Dr Nefario</a> &#8211; amusing</li>
<li><a href="http://dir.salon.com/story/tech/feature/2004/11/15/andas_game/print.html">Anda&#8217;s Game by Cory Doctorow</a></li>
<li><a href="http://www.archive.org/details/CoryDoctorowsFuturisticTalesOfTheHereAndNow">Futuristic Tales of the Here and Now by Cory Doctorow</a> &#8211; in comic book form, download the CBZ file as the CBR file seems corrupt.</li>
<li><a href="http://www.infinitematrix.net/stories/shorts/i-robot.html">I Robot by Cory Doctorow</a></li>
<li><a href="http://www.infinitematrix.net/stories/shorts/appeals_court.html">Appeals Court by Cory Doctorow and Charles Stross</a> &#8211; unusual Christian sexual references</li>
<li><a href="http://www.tor.com/index.php?option=com_content&#038;view=story&#038;id=2993">The Things that Make Me Weak and Strange Get Engineered Away by Cory Doctorow</a> &#8211; I didn&#8217;t like the ending but it has some good concepts</li>
<li><a href="http://shareable.net/blog/the-jammie-dodgers-and-the-adventure-of-the-leicester-square-screening">The Jammie Dodgers and the Adventure of the Leicester Square Screening by Cory Doctorow</a>, an amusing story of art in a dystopia</li>
<li><a href="http://www.overcomingbias.com/2009/01/failed-utopia-42.html">Failed Utopia 42 from OvercomingBias.com</a></li>
<li><a href="http://www.infinityplus.co.uk/stories/under.htm">Understand by Ted Chiang</a> &#8211; interesting concept about brain improvement.</li>
<li><a href="http://www.archive.org/details/TrueNames">True Names by Benjamin Rosenbaum and Cory Doctorow, about two galactic-scale hive organisms</a>.</li>
<li><a href="http://www.tor.com/index.php?option=com_content&#038;view=story&#038;id=61">Down on the Farm by Charles Stross &#8211; one of his &#8220;Laundry&#8221; sci-fi-fantasy stories set in a Lovecroftian universe</a></li>
</ul>
<p><a href="http://en.wikipedia.org/wiki/Robert_Reed_(author)">Robert Reed has released enough great free sci-fi stories that he deserves his own section</a>:</p>
<ul>
<li><a href="http://www.asimovs.com/_issue_0406/hexagons.shtml">Hexagons</a> &#8211; interesting ideas about simulating social development, if someone was developing such a program I would contribute some code</li>
<li><a href="http://www.scifi.com/scifiction/originals/originals_archive/reed7/index.html">Man for the Job</a> &#8211; bit of a surprise ending</li>
<li><a href="http://www.scifi.com/scifiction/originals/originals_archive/reed6/">Hidden Paradise</a></li>
<li><a href="http://www.scifi.com/scifiction/originals/originals_archive/reed5/">The Dragons of Summer Gulch</a></li>
<li><a href="http://www.scifi.com/scifiction/originals/originals_archive/reed4/reed41.html">Like, Need, Deserve</a> &#8211; interesting ideas about soul creation</li>
<li><a href="http://www.scifi.com/scifiction/originals/originals_archive/reed3/reed31.html">Melodies Played upon Cold, Dark Worlds</a></li>
<li><a href="http://www.scifi.com/scifiction/originals/originals_archive/reed2/reed21.html">The Children&#8217;s Crusade</a> &#8211; that might be a viable concept, maybe children could pay for scientific research</li>
<li><a href="http://www.scifi.com/scifiction/originals/originals_archive/reed/reed1.html">Birdy Girl</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/fiction/free-short-stories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SE Linux Terminology</title>
		<link>http://doc.coker.com.au/computers/se-linux-terminology/</link>
		<comments>http://doc.coker.com.au/computers/se-linux-terminology/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 06:52:44 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Computers]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/?p=153</guid>
		<description><![CDATA[Security Context is the SE Linux label for a process, file, or other resource. Each process or object that a process may access has exactly one security context. It has four main parts separated by colons: User:Role:Domain/Type:Sensitivity Label. Note that the Sensitivity Label is a compile-time option that all distributions enable nowadays. User in terms [...]]]></description>
			<content:encoded><![CDATA[<p><b>Security Context</b> is the SE Linux label for a process, file, or other resource.  Each process or object that a process may access has exactly one security context.  It has four main parts separated by colons: <b>User:Role:Domain/Type:Sensitivity Label</b>.  Note that the Sensitivity Label is a compile-time option that all distributions enable nowadays.</p>
<p><b>User</b> in terms of SE Linux is also known as the <b>Identity</b>.  The program <b>semanage</b> can be used to add new identities and to change the roles and sensitivities assigned to them.  System users often end in &#8220;<b>_u</b>&#8221; (EG <b>user_u</b>, <b>unconfined_u</b>, and <b>system_u</b>) but this is just a convention used to distinguish system users from users that associate directly with Unix accounts &#8211; which are typically the same as the name of the account.  So the user with Unix account <b>john</b> might have a SE Linux user/identity of <b>john</b>.  Note that as the local sysadmin can change the user names with semanage you can&#8217;t make any strong assumptions about a naming convention.  When a process creates a resource (such as a file on disk) then by default the resource will have the same user as the process.</p>
<p><b>Role</b> for a process determines the set of domains that may be used for running a child process.  Through <b>semanage</b> you can configure which roles may be entered by each user.  The default policy has the roles <b>user_r</b>, <b>staff_r</b>, <b>sysadm_r</b>, and <b>system_r</b>.  Adding new roles requires recompiling the policy which is something that most sysadmins don&#8217;t do.  So you can expect that all role names end in &#8220;<b>_r</b>&#8220;.</p>
<p><b>Object Class</b> refers to the object that is to be accessed, there are 82 object classes in the latest policy, many of which are related to things such as the X server.  Some object classes are <b>file</b>, <b>dir</b>, <b>chr_file</b>, are <b>blk_file</b>.  The reason for having an object class is so that access can be granted to one object with a given type label but not be granted to another object of a different object class.</p>
<p><b>Type</b> is the primary label for the Domain/Type or Type-Enforcement model of access control, by tradition a type name ends in &#8220;<b>_t</b>&#8220;.  There is no strong difference between a domain and a type, a domain is the type of a process.  In the DT model there are a set of rules which specify what happens when a domain tries to access an object of a certain object class for a particular access (read, write, etc).</p>
<p><b>MLS</b> stands for <a href="http://en.wikipedia.org/wiki/Multilevel_security">Multi Level Security</a>, it&#8217;s a hierarchical system for restricting access to sensitive data.  It&#8217;s core principle is that of no write-down and no read-up.  In a MLS system you can only write data to a resource with an equal or higher sensitivity label.</p>
<p><b>MCS</b> stands for Multi Category Security.</p>
<p><b>Sensitivity Level</b> is for a hierarchical level of sensitivity in the MLS policy.  In the default policy there are 16 levels from <b>s0</b> to <b>s15</b>.  The MCS policy uses some of the mechanisms of MLS but not the level, so in MCS the level is always set to <b>s0</b>.  The policy can be recompiled to have different numbers of levels.</p>
<p><b>Category</b> is a primitive for the MCS and MLS policies.  The default policy has 1024 categories from <b>c0</b> to <b>c1023</b>, the policy can be recompiled to have different numbers of categories.</p>
<p><b>Sensitivity Label</b> is for implementing MLS and MCS access controls.  It may be ranged, in which case it has a form &#8220;<b>LOW-HIGH</b>&#8221; where both LOW and HIGH are comprised of a <b>Sensitivity Level</b> and a set of categories separated by a colon &#8211; EG &#8220;<b>s0:c1-s1:c1.c10</b>&#8221; means the range from level <b>s0</b> with category <b>c1</b> to the level <b>s1</b> with the set of categories from <b>c1</b> to <b>c10</b> inclusive.  If it isn&#8217;t ranged then it just has a level and a set of categories separated by a colon.  In a set of categories a dot is used to indicate a range of categories (all categories between the low one and the high one are included) while a comma indicates a discontinuity in the range.  So &#8220;<b>c1.c10,c13</b>&#8221; means the set of all categories between <b>c1</b> and <b>c10</b> inclusive plus the category <b>c13</b>.  The kernel will canonicalise category sets, so if it is passed &#8220;<b>c1,c2,c3</b>&#8221; then it will return &#8220;<b>c1.c3</b>&#8220;.  These raw labels may be translated into a more human readable form by <b>mcstransd</b>.</p>
<p><b>Constraint</b> is a rule that restricts access.  SE Linux is based on the concept of deny by default and the domain-type model uses rules to allow certain actions.  Constraints are used for special cases where access needs to be restricted outside of the domain-type model.  MCS and MLS are implemented using constraints.</p>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/computers/se-linux-terminology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Cheat Sheet</title>
		<link>http://doc.coker.com.au/computers/mysql-cheat-sheet/</link>
		<comments>http://doc.coker.com.au/computers/mysql-cheat-sheet/#comments</comments>
		<pubDate>Thu, 13 May 2010 19:20:58 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Computers]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/?p=77</guid>
		<description><![CDATA[This document is designed to be a cheat-sheet for MySQL. I don&#8217;t plan to cover everything, just most things that a novice MySQL DBA is likely to need often or in a hurry. Configuring mysqld If you are going to provide a database service to other machines edit /etc/mysql/my.cnf and set the bind-address parameter to [...]]]></description>
			<content:encoded><![CDATA[<p>This document is designed to be a cheat-sheet for MySQL.  I don&#8217;t plan to cover everything, just most things that a novice MySQL DBA is likely to need often or in a hurry.</p>
<h1>Configuring mysqld</h1>
<p>If you are going to provide a database service to other machines edit <b>/etc/mysql/my.cnf</b> and set the bind-address parameter to a suitable value.  A value of 0.0.0.0 will cause it to accept connections on any of the server&#8217;s addresses.  I recommend using a private address range (<a href="http://www.rfc-editor.org/rfc/rfc3330.txt">10.0.0.0/8, 192.168.0.0/16, or 172.16.0.0/12</a>) for such database connections and ideally a<br />
back-end VLAN or Ethernet switch that doesn&#8217;t carry any public data.</p>
<p>For the purpose of this post let&#8217;s consider the MySQL server to have a private IP address of 192.168.42.1.  So you want the my.cnf file to have <b>bind-address = 192.168.42.1</b></p>
<p>To start mysql administration use the command <b>mysql -u root</b>.  In Debian the root account has no password by default, on CentOS 5.x starting mysql for the first time gives a message:<br />
<b>PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !<br />
To do so, start the server, then issue the following commands:<br />
/usr/bin/mysqladmin -u root password &#8216;new-password&#8217;<br />
/usr/bin/mysqladmin -u root -h server password &#8216;new-password&#8217;</b></p>
<p>That is wrong, for the second mysqladmin command you need a &#8220;<b>-p</b>&#8221; option (or you can reverse the order of the commands).</p>
<p>There is also the <b>/usr/bin/mysql_secure_installation</b> script that has an interactive dialog for locking down the MySQL database.</p>
<h1>Administrative Password Recovery</h1>
<p>If you lose the administration password the recovery process is as follows:</p>
<ol>
<li>Stop the <b>mysqld</b>, this may require killing the daemon if the password for the system account used for shutdown access is also lost.</li>
<li>Start <b>mysqld</b> with the <b>&#45;-skip-grant-tables</b> option.</li>
<li>Use SQL commands such as &#8220;<b>UPDATE mysql.user SET Password=PASSWORD(&#39;password&#39;) WHERE User=&#39;root&#39;;</b>&#8221; to recover the passwords you need.</li>
<li>Use the SQL command &#8220;<b>FLUSH PRIVILEGES;</b>&#8220;</li>
<li>Restart <b>mysqld</b> in the normal manner.</li>
</ol>
<h1>User Configuration</h1>
<p>For an account to automatically login to mysql you need to create a file named <b>~/.my.cnf</b> with the following contents:<br />
<b>[client]<br />
user=USERNAME<br />
password=PASSWORD<br />
database=DBNAME</b></p>
<p>Replace USERNAME. PASSWORD, and DBNAME with the appropriate values.  They are all optional parameters.  This saves using <b>mysql</b> client parameters <b>-u</b> parameter for the username, &#8220;<b>-p</b> for the password, and specifying the database name on the command line.  Note that using the &#8220;<b>-pPASSWORD</b>&#8221; command-line option to the mysql client is insecure on multi-user systems as (in the absence of any security system such as SE Linux) any user can briefly see the password via <b>ps</b>.</p>
<p>Note that the presence of the <b>database=</b> option in the config file breaks <b>mysqlshow</b> and <b>mysqldump</b> for MySQL 5.1.51 (and presumably earlier versions too).  So it&#8217;s often a bad idea to use it.</p>
<h1>Grants</h1>
<p>To grant all access to a new database:<br />
<b>CREATE DATABASE foo_db;<br />
USE foo_db;<br />
GRANT ALL PRIVILEGES ON foo_db.* to &#39;user&#39;@&#39;10.1.2.3&#39; IDENTIFIED BY &#39;pass&#39;;</b></p>
<p>Where 10.1.2.3 is the client address and <b>pass</b> is the password.  Replace <b>10.1.2.3</b> with <b>%</b> if you want to allow access from any client address.</p>
<p>Note that if you use &#8220;foo_db&#8221; instead of &#8220;foo_db.*&#8221; then you will end up granting access to foo_db.foo_db (a table named foo_db in the foo_db database) which generally is not what you want.</p>
<p>To grant read-only access replace &#8220;<b>ALL PRIVILEGES</b>&#8221; with &#8220;<b>SELECT</b>&#8220;.</p>
<p>To show what is granted to the current user run &#8220;<b>SHOW GRANTS;</b>&#8221; .</p>
<p>To show the privs for a particular user run &#8220;<b>SHOW GRANTS FOR &#8216;user&#8217;@&#8217;10.1.2.3&#8242;;</b>&#8221;</p>
<p>To show all entries in the user table (user-name, password, and hostname):<br />
<b>USE mysql;<br />
SELECT Host,User,Password FROM user;</b></p>
<p>To do the same thing at the command-line:<br />
<b>echo &#8220;SELECT Host,User,Password FROM user;&#8221; | mysql mysql</b></p>
<p>To revoke access:<br />
<b>REVOKE ALL PRIVILEGES ON foo_db.* FROM user@10.1.2.3 IDENTIFIED BY &#8216;pass&#8217;;</b></p>
<p>To test a user&#8217;s access connect as the user with a command such as the following:<br />
<b>mysql -u user -h 10.1.2.4 -p foo_db</b></p>
<p>Then test that the user can create tables with the following mysql commands:<br />
<b>CREATE TABLE test (id INT);<br />
DROP TABLE test;</b></p>
<h1>Listing the Databases</h1>
<p>To list all databases that are active on the selected server run &#8220;<b>mysqlshow</b>&#8220;, it uses the same methods of determining the username and password as the <b>mysql</b> client program.</p>
<p>To list all tables in a database run &#8220;<b>SHOW TABLES;</b>&#8221; .  For more detail select from INFORMATION_SCHEMA.TABLES or run &#8220;<b>SHOW TABLE STATUS;</b>&#8221;</p>
<p>For example to see the engine that is used for each table you can use the command <b>echo &#8220;SELECT table_schema, table_name, engine FROM INFORMATION_SCHEMA.TABLES;&#8221; |mysql</b>.</p>
<p>But INFORMATION_SCHEMA.TABLES is only in Mysql 5 and above, for prior versions you can use <b>mysqldump -d</b> to get the schema, or &#8220;<b>SHOW CREATE TABLE table_name;</b>&#8221; at the command-line.</p>
<p>Also the <b>mysqldump</b> program can be used to display the tables in a database via &#8220;<b>mysqlshow database</b>&#8221; or the columns in a table via &#8220;<b>mysqlshow database table</b>&#8220;.</p>
<p>To list active connections: &#8220;SHOW PROCESSLIST;&#8221;</p>
<h1>Database backup</h1>
<p>The program <b>mysqldump</b> is used to make a SQL dump of the database.  EG: &#8220;<b>mysqldump mysql</b>&#8221; to dump the system tables.  The data compresses well (being plain text of a regular format) so piping it through &#8220;gzip -9&#8243; is a good idea.  To backup the system database you could run &#8220;<b>mysqldump mysql | gzip -9 &gt; mysql.sql.gz</b>&#8220;.  To restore simply run &#8220;<b>mysql -u user database &lt; file</b>&#8220;, in the case of the previous example &#8220;<b>zcat mysql.sql.gz | mysql -u root database</b>&#8220;.</p>
<p>To dump only selected tables you can run &#8220;<b>mysqldump database table1 [table2]</b>&#8220;.</p>
<p>The option <b>&#45;-skip-extended-insert</b> means that a single <b>INSERT</b> statement will be used for each row.  This gives a bigger dump file but allows running <b>diff</b> on multiple dump files.</p>
<p>The option <b>-&#45;all-databases</b> or <b>-A</b> dumps all databases.</p>
<p>The option <b>-&#45;add-locks</b> causes the tables to be locked on insert and improves performance.</p>
<p>Note that <b>mysqldump</b> blocks other database write operations so don&#8217;t pipe it through <b>less</b> or any other process that won&#8217;t read all the data in a small amount of time.</p>
<p><b>mysqldump -d DB_NAME</b> dumps the schema.</p>
<p>The option <b>&#45;-single-transaction</b> causes mysqldump to use a transaction for the dump (so that the database can be used in the mean time).  This only works with INNODB.  To convert a table to INNODB the following command can be used:<br />
<b>ALTER TABLE tablename ENGINE = INNODB;</b></p>
<p>To create a slave run mysqldump with the <b>-&#45;master-data=1</b>.</p>
<p>When a master has it&#8217;s binary logs get too big a command such as &#8220;<b>PURGE MASTER LOGS BEFORE &#8217;2008-12-02 22:46:26&#8242;;</b>&#8221; will purge the old logs.  An alternate version is of the form &#8220;<b>PURGE MASTER LOGS TO &#8216;mysql-bin.010&#8242;;</b>&#8220;.  <a href="http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html">The MySQL documentation describes how to view the slave status to make sure that this doesn&#8217;t break replication</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/computers/mysql-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Portslave</title>
		<link>http://doc.coker.com.au/projects/portslave/</link>
		<comments>http://doc.coker.com.au/projects/portslave/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 21:20:46 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Projects]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/?p=142</guid>
		<description><![CDATA[Portslave is a getty replacement that is designed to talk to a modem and spawn PPP or SLIP when the modem connects. It authenticates the connection via RADIUS. Portslave version 2010.04.19 source Portslave version 2010.03.30 source]]></description>
			<content:encoded><![CDATA[<p>Portslave is a getty replacement that is designed to talk to a modem and spawn PPP or SLIP when the modem connects.  It authenticates the connection via RADIUS.</p>
<ul>
<li><a href="http://www.coker.com.au/portslave/portslave_2010.04.19.tar.gz">Portslave version 2010.04.19 source</a></li>
<li><a href="http://www.coker.com.au/portslave/portslave_2010.03.30.tar.gz">Portslave version 2010.03.30 source</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/projects/portslave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RAM Speed according to Memtest86+</title>
		<link>http://doc.coker.com.au/computers/ram-speed-memtest86/</link>
		<comments>http://doc.coker.com.au/computers/ram-speed-memtest86/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 01:10:04 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Computers]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/?p=20</guid>
		<description><![CDATA[Here are some speed results for RAM according to Memtest86+ on some machines that I have run. Note that the reported speed varies between runs by a few percent. Thinkpad 600e PentiumII 400Mhz PC-66 RAM (2 DIMMs) 174MB/s Compaq Athlon 1GHz PC133 RAM (3 DIMMs) 219MB/s Compaq P3-800MHz PC133 RAM (1 DIMM) 270MB/s Compaq P3-800MHz [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some speed results for RAM according to Memtest86+ on some machines that I have run.  Note that the reported speed varies between runs by  a few percent.</p>
<table border="1">
<tr>
<td>Thinkpad 600e PentiumII 400Mhz PC-66 RAM (2 DIMMs)</td>
<td>174MB/s</td>
</tr>
<tr>
<td>Compaq Athlon 1GHz PC133 RAM (3 DIMMs)</td>
<td>219MB/s</td>
</tr>
<tr>
<td>Compaq P3-800MHz PC133 RAM (1 DIMM)</td>
<td>270MB/s</td>
</tr>
<tr>
<td>Compaq P3-800MHz PC133 RAM (3 DIMMs, 2*128 + 256)</td>
<td>240MB/s</td>
</tr>
<tr>
<td>Compaq P4 1.5GHz PC133 RAM (3 DIMMs)</td>
<td>486MB/s</td>
</tr>
<tr>
<td>Compaq P4 1.5GHz PC133 RAM (1 or 2 DIMMs)</td>
<td>490MB/s</td>
</tr>
<tr>
<td>EeePC 701, DDR2-665 PC2-5300 running at DDR2-333 speed</td>
<td>798MB/s</td>
</tr>
<tr>
<td>HP Celeron 1.8GHz PC2100/DDR266 (1 DIMM)</td>
<td>824MB/s</td>
</tr>
<tr>
<td>HP Celeron 2.4GHz PC2100/DDR266 RAM (2 DIMMs)</td>
<td>984MB/s</td>
</tr>
<tr>
<td>Celeron D (32bit) 2.93GHz  PC2400/DDR300 PC3200 RAM</td>
<td>1,140MB/s</td>
</tr>
<tr>
<td>HP Celeron 2.4GHz PC2700/DDR333 RAM (2 DIMMs)</td>
<td>1,027MB/s</td>
</tr>
<tr>
<td>HP Celeron 2.4GHz PC2700/DDR333 RAM (2 DIMMs)</td>
<td>1,375MB/s</td>
</tr>
<tr>
<td>Dell PowerEdge T105 Dual-core Opteron 1212 (2GHz) single DDR2-667 ECC RAM</td>
<td>1,670MB/s</td>
</tr>
<tr>
<td>Dell PowerEdge T105 Dual-core Opteron 1212 (2GHz) pair of DDR2-667 ECC RAM</td>
<td>1,826MB/s</td>
</tr>
<tr>
<td>NEC Pentium E2160 1.8GHz DDR663 (two mismatched DIMMs)</td>
<td>2,307MB/s</td>
</tr>
<tr>
<td>IBM Pentium E2160 1.8GHz DDR2-667 PC2-5400 (single DIMM)</td>
<td>2,371MB/s</td>
</tr>
<tr>
<td>NEC Pentium D 2.8GHz  DDR 533 (unpaired DIMMS)</td>
<td>1,600MB/s</td>
</tr>
<tr>
<td>NEC Pentium D 2.8GHz DDR 533 (paired DIMMS)</td>
<td>2,600MB/s</td>
</tr>
<tr>
<td>Thinkpad T61 DDR2-665 PC2-5300 (single DIMM)</td>
<td>2,023MB/s</td>
</tr>
<tr>
<td>Thinkpad T61 DDR2-665 PC2-5300 (paired or mismatched DIMMs)</td>
<td>2,823MB/s</td>
</tr>
</table>
<p>The <a href="http://en.wikipedia.org/wiki/SDRAM">Wikipedia page on SDRAM lists the theoretical speeds and the various names of the different types of DDR RAM (each type seems to have at least two names)</a>.</p>
<p>DDR266 theoretically can do 2100MB/s, but I&#8217;ve only seen it do 984MB/s (with two DIMMs).</p>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/computers/ram-speed-memtest86/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Debug SMTP with TLS(SSL) and AUTH</title>
		<link>http://doc.coker.com.au/internet/how-to-debug-smtp-with-tlsssl-and-auth/</link>
		<comments>http://doc.coker.com.au/internet/how-to-debug-smtp-with-tlsssl-and-auth/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 22:28:19 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Internet]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/?p=55</guid>
		<description><![CDATA[The first thing to test is a TLS (aka SSL) connection. The stunnel program has special code for this, the command &#8220;stunnel -n smtp -c -r mail.example.com:25&#8221; will connect to the server via SMTP and negotiate SSL. Once that is done and you will receive a 220 message acknowledging the connection (which is the same [...]]]></description>
			<content:encoded><![CDATA[<p>The first thing to test is a TLS (aka SSL) connection.  The <b>stunnel</b> program has special code for this, the command &#8220;<b>stunnel -n smtp -c -r mail.example.com:25</b>&#8221; will connect to the server via SMTP and negotiate SSL.</p>
<p>Once that is done and you will receive a <b>220</b> message acknowledging the connection (which is the same as if you had just connected without TLS).  If you want to test the TLS certificate then use the &#8220;<b>-v</b>&#8221; option to stunnel.  Note that if the certificate is not verified successfully then stunnel will exit and log via syslog the reason why.  While stunnel seems more convenient for actually using a protocol, the <b>openssl</b> utility is a much better program for actually testing out the SSL functionality.  The command &#8220;<b>openssl s_client -CApath /etc/ssl/certs/ -starttls smtp -connect mail.example.com:25</b>&#8221; will dump a lot of diagnostic information about the SSL protocol.  Note that the location of the SSL certificates varies by distribution, <b>/etc/ssl/certs</b> is the location used on Debian.</p>
<p>Then enter the command &#8220;<b>ehlo hostname.example.com</b>&#8221; (the hostname is generally not checked for the case of mail relaying so any text that vaguely resembles a real host DNS name will do).</p>
<p>The response to that command will be something like the following:<br />
250-mail.example.com Hello hostname.example.com [10.10.10.10], pleased to meet you<br />
250-ENHANCEDSTATUSCODES<br />
250-PIPELINING<br />
250-8BITMIME<br />
250-SIZE<br />
250-DSN<br />
250-AUTH LOGIN PLAIN<br />
250-DELIVERBY<br />
250 HELP</p>
<p>The important thing to note is the <b>250-AUTH</b> message which indicates that you may authenticate, it tells us that you can use the <b>LOGIN</b> and <b>PLAIN</b> methods of authentication.  All the further communication for the login will be <b>base64</b> encoded, the best utilities that I know of in Debian/Etch for encoding and decoding base64 are <b>/usr/share/fml/bin/base64encode.pl</b> and <b>/usr/share/fml/bin/base64decode.pl</b> which are in the <b>fml</b> package.  Debian/Lenny and newer have <b>base64</b> as part of the <b>coreutils</b> package.</p>
<p>The command <b>auth login</b> will typically give the response &#8220;<b>334 VXNlcm5hbWU6</b>&#8220;, the command &#8220;<b>echo VXNlcm5hbWU6|/usr/share/fml/bin/base64decode.pl</b>&#8221; shows that it is requesting the &#8220;<b>Username:</b>&#8220;.</p>
<p>To generate a response to the Username prompt run the command &#8220;<b>echo -n user@example.com | /usr/share/fml/bin/base64encode.pl</b>&#8221; (or whatever your user-name is) and you will receive an encoded message such as &#8220;<b>dXNlckBleGFtcGxlLmNvbQ==</b>&#8220;.  Enter that to the mail server and you will get a response with another 334 code similar to &#8220;<b>334 UGFzc3dvcmQ6</b>&#8220;, again if you decode the part after the space you will br prompted for the &#8220;<b>Password:</b>&#8220;.  The command &#8220;<b>echo -n mypass | /usr/share/fml/bin/base64encode.pl</b>&#8221; will give a response that you can give to that prompt.  If all goes well that will give a <b>235</b> message to tell you that you are authenticated.  Then you can relay mail!</p>
<p>When relaying mail after authenticating using SASL, if the mail is authenticated then you can use the <b>auth</b> parameter.  This means that instead of using the SMTP command &#8220;<b>mail from: &lt;user@example.com&gt;</b>&#8221; you use the command &#8220;<b>mail from: &lt;user@example.com&gt; auth=&lt;user@example.com&gt;</b>&#8220;.</p>
<p>Normally this will all be done by your MUA, but if something goes wrong and you don&#8217;t know why then manually running through the steps can reveal the source of the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/internet/how-to-debug-smtp-with-tlsssl-and-auth/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Memlockd</title>
		<link>http://doc.coker.com.au/projects/memlockd/</link>
		<comments>http://doc.coker.com.au/projects/memlockd/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 01:50:42 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Projects]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/?p=137</guid>
		<description><![CDATA[Memlockd is a daemon that locks files into memory. Then if a machine starts paging heavily the chance of being able to login successfully is significantly increased. The default configuration will lock all the files needed for login to a Debian GNU/Linux system via the console or via ssh. memlockd_0.05.tar.gz memlockd_0.04.tar.gz memlockd_0.03.tar.gz memlockd_0.02.tar.gz memlockd_0.01.tar.gz]]></description>
			<content:encoded><![CDATA[<p>Memlockd is a daemon that locks files into memory. Then if a machine starts paging heavily the chance of being able to login successfully is significantly increased. The default configuration will lock all the files needed for login to a Debian GNU/Linux system via the console or via ssh.</p>
<ul>
<li><a href="http://www.coker.com.au/memlockd/memlockd_0.05.tar.gz">memlockd_0.05.tar.gz</a></li>
<li><a href="http://www.coker.com.au/memlockd/memlockd_0.04.tar.gz">memlockd_0.04.tar.gz</a></li>
<li><a href="http://www.coker.com.au/memlockd/memlockd_0.03.tar.gz">memlockd_0.03.tar.gz</a></li>
<li><a href="http://www.coker.com.au/memlockd/memlockd_0.02.tar.gz">memlockd_0.02.tar.gz</a></li>
<li><a href="http://www.coker.com.au/memlockd/memlockd_0.01.tar.gz">memlockd_0.01.tar.gz</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/projects/memlockd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Books</title>
		<link>http://doc.coker.com.au/fiction/free-books/</link>
		<comments>http://doc.coker.com.au/fiction/free-books/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 09:01:13 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Fiction]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/fiction/free-books/</guid>
		<description><![CDATA[Here are some free books that I have downloaded and read: Cory Doctorow&#8217;s book Eastern Standard Tribe was the first novel I read on my computer. His other novels are linked here. The novelette A Colder War by Charles Stross is really good. The novel Accelerando by Charles Stross is very well written and has [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some free books that I have downloaded and read:</p>
<ul>
<li>Cory Doctorow&#8217;s book <a href="http://craphound.com/est/">Eastern Standard Tribe</a> was the first novel I read on my computer.  <a href="http://www.craphound.com/index.php?cat=5">His other novels are linked here</a>.</li>
<li>The novelette <a href="http://www.infinityplus.co.uk/stories/colderwar.htm">A Colder War by Charles Stross</a> is really good.</li>
<li>The novel <a href="http://www.antipope.org/charlie/accelerando/">Accelerando by Charles Stross</a> is very well written and has some interesting ideas about the singularity.  It&#8217;s reasonably scientifically accurate too.</li>
<li>Julian Dibbell wrote a book about the LambdaMoo online rape.  He has recently released it freely, <a href="http://juliandibbell.com/news/2008_01_15_mtl_is_free.html">he writes about the difficulty in freely releasing a book at this link</a> and <a href="http://www.lulu.com/content/1070691">the free book <b>My Tiny Life</b> is available at this link</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/fiction/free-books/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>thanks.txt on my Play Machine</title>
		<link>http://doc.coker.com.au/computers/thankstxt-on-my-play-machine/</link>
		<comments>http://doc.coker.com.au/computers/thankstxt-on-my-play-machine/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 03:31:42 +0000</pubDate>
		<dc:creator>etbe</dc:creator>
				<category><![CDATA[Computers]]></category>
		<guid isPermaLink="false">http://doc.coker.com.au/?p=67</guid>
		<description><![CDATA[On my SE Linux Play Machine I have a file in the root home directory named thanks.txt_append_only_dont_edit_with_vi which users can append random comments to. It kept slowly growing from the time of Fedora Core 2 to today, here is the text. Any text within brackets is my response to a question. you can send messages [...]]]></description>
			<content:encoded><![CDATA[<p>On my <a href="http://www.coker.com.au/selinux/play.html">SE Linux Play Machine</a> I have a file in the root home directory named <b>thanks.txt_append_only_dont_edit_with_vi</b> which users can append random comments to.  It kept slowly growing from the time of Fedora Core 2 to today, here is the text.  Any text within brackets is my response to a question.</p>
<p>you can send messages to the owner through this file<br />
should I be able to see dmesg output?<br />
Lon was here<br />
Is this a virtual machine? [at that time it wasn't, it is now]<br />
kermit!</p>
<p>nice toy here :)<br />
cool stuff &#8211; will you be posting instructions on how to lock down a machine like this? [yes]</p>
<p>Had fun poking around<br />
Impressive stuff, though I&#8217;m not exactly a security expert ;)</p>
<p>heheheh<br />
I guess it&#8217;s a bit better than LIDS. I&#8217;ll give it a try<br />
Does there even have to be a root user? could it have been a &#8216;John&#8217; instead with no impact on the fedora system? [the user name was never an issue, changing a Unix system to have "John" map to UID 0 is no big deal]<br />
nice toy&#8230;<br />
This is my first look at SElinux, very secure but seems broken from a desktop usability standpoint. Is FC2&#8242;s policy to be more liberal than this? [SE Linux has been continually improving]<br />
Out of curiosity are you running exec-shield as well [sometimes yes, sometimes no, depends on the distro]</p>
<p>This machine is a little bit more permissive than the Gentoo machine,<br />
I can actually read the security policy files! [by design, you can look and learn]<br />
.<br />
Thanx and have a nice day<br />
I was able to coredump bash and read some history enries. see ./coredumptest Is this expected behaviour? kenny @ jevv.priv.at [you could have just read ~/.bash_history or run the "history" command]<br />
exec-shield what is that? When I ran this command It gives a error: -bash: exec-shield: command not found [exec-shield is a kernel patch to prevent some application exploits which rely on writable and executable memory]<br />
Where are the security policy files? Excelent job here! Thank you for the public root account ;-p </p>
<p>Very interesting.<br />
Russel ! Thank You for work, Thank You for this box. SELinux Rulz ! [s/Russel/Russell/ :-)]<br />
I was able to fill up the filesystem to 100% (/tmp) and I was able to terminate the shells of other root users<br />
[Filling the root fs is a DOS attack, read the MOTD.]<br />
[Killing the shells of other users is expected behavior, they are all using the same account as you!]</p>
<p>The tar program sure gets upset. I untar something that was originally tarred up as UID 1000, and it gets changed to that.  Then I try to untar a second portion of the data, and I get all sorts of errors. Had the UID change been blocked, the errors wouldn&#8217;t happen when the second tar tries to write to the directories again. Errors look like this:</p>
<p>tar: procps-3.2.1/test/ps/thread-nosort-L/header: Cannot open: No such file or directory<br />
tar: procps-3.2.1/test/ps/thread-nosort-default: Cannot mkdir: No such file or directory<br />
tar: procps-3.2.1/test/ps/thread-nosort-default/setup: Cannot open: No such file or direc</p>
<p>You&#8217;re seriously short on RAM. Only about 9 MB are free.  Nothing I can view is eating it. Programs are crashing due to lack of memory. [you don't have permission to see most processes]</p>
<p>can&#8217;t wait for fedora core 2.  this is one sweet security setup.  hopefully a howto will come out, plus maybe a gui for the windows folks.</p>
<p>thanks. you&#8217;ve inspired me to install fedora. cool stuff.</p>
<p>Thanks very much for setting this box up. It is a great learning tool</p>
<p>I note that I can&#8217;t ping, traceroute or telnet off the box.  Is this intentional? Is this part of the lockdown to show me that I can&#8217;t do things I expect to be able to do with uid 0? My initial impression is that without those functions it is not very useful to have a system. [in the early days I allowed such things, but they were abused too often]</p>
<p>###########<br />
Have you updated the kernel with the information in this</p>
<p>http://groups.google.com/groups?hl=en&#038;lr=&#038;ie=UTF-8&#038;oe=UTF-8&#038;c2coff=1&#038;safe=off&#038;threadm=1Jw1G-551-7%40gated-at.bofh.it&#038;rnum=3&#038;prev=/groups%3Fq%3Dluto%2Bgroup:linux.kernel%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26group%3Dlinux.kernel%26c2coff%3D1%26safe%3Doff%26scoring%3Dd%26selm%3D1Jw1G-551-7%2540gated-at.bofh.it%26rnum%3D3</p>
<p>post?  Have you tried whether that might be a real exploitable vulnerability?<br />
Sorry about the formatting of the url. [there are kernel vulnerabilities all the time, I keep updating it to the latest kernel]<br />
###########<br />
Its very interesting. Thank you.<br />
bagus juga pengamanan boxnya. salam dari indonesia<br />
##\n thanks from me too\n##<br />
##/nD&#8217;oh&#8217;/n thanks from a Windows Luser too/n##<br />
hello althepcman was here<br />
Thanks very much for setting this box up. I&#8217;ll try the SELinux on Fedora Core 2.<br />
#######<br />
ichtus<br />
thank your for your great job, Fedora is great<br />
######<br />
thanks, from argentina, i really dont like fedora&#8230;in fact im a debian or gentoo user&#8230;but i think that fedora its kind a cool thing<br />
-=-=-=-=-=-<br />
nice small server with fine security patch. thx for the try-out. greetings from hannover/germany</p>
<p>Thanks from Brazil. I&#8217;m studying selinux and ids integration and probably I&#8217;m gonna come back here. marciorg at gmail.com<br />
#####################################################<br />
-=-=-=-=-=-=-=-<br />
hi<br />
is it correctly that root can sudo ?</p>
<p>-bash-3.00# ps auxw<br />
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND<br />
root     20860  0.0  0.5  5576 1432 pts/42   Ss+  07:44   0:00 -bash<br />
root     20910  0.0  0.5  4852 1296 pts/43   Ss+  08:02   0:00 bash -i<br />
root     21033  0.0  0.5  5092 1436 pts/45   Ss+  08:29   0:00 -bash<br />
root     21105  0.0  0.5  4860 1460 pts/46   Ss   08:39   0:00 -bash<br />
root     21219  0.0  0.2  2708  756 pts/46   R+   08:55   0:00 ps auxw<br />
-bash-3.00# sudo -u mysql ps auxw<br />
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND<br />
root     20860  0.0  0.5  5576 1432 pts/42   Ss+  07:44   0:00 -bash<br />
root     20910  0.0  0.5  4852 1296 pts/43   Ss+  08:02   0:00 bash -i<br />
root     21033  0.0  0.5  5092 1436 pts/45   Ss+  08:29   0:00 -bash<br />
root     21105  0.0  0.5  4860 1460 pts/46   Ss   08:39   0:00 -bash<br />
mysql    21220  0.0  0.0  2476  252 pts/46   R+   08:56   0:00 sesh /bin/ps auxw<br />
mysql    21221  0.0  0.2  3844  752 pts/46   R+   08:56   0:00 /bin/ps auxw<br />
-bash-3.00#</p>
<p>and is it realy sudo? AFAIK mysqld was started on this system, but sudo -u mysql ps auxw doesn&#8217;t show me other mysql processes&#8230;<br />
[sudo doesn't change to the mysqld_t domain...]</p>
<p>-=-=-=-=-=-=-=-</p>
<p>i&#8217;ve written kill_rjc.pl script: i tried to kill hidden pids from /proc using sudo -u rjc kill -9 $pid.<br />
does rjc has 2 roles ? why i couldn&#8217;t kill his shell ?<br />
[rjc has 2 roles, neither of which is user_r, so neither of them has the domain user_t that you can kill]</p>
<p>-=-=-=-=-=-=-=-</p>
<p>thx in advance :)<br />
#####################################################</p>
<p>##############<br />
rjc, check this out: /root/ls_rjc_home_:)<br />
[fixed - thanks for that, it was due to a bug in locate]<br />
and don&#8217;t forget about sudo plz :)<br />
##############<br />
Thanks for the effort to let us experiment with SELinux/Fedora<br />
################################<br />
whatever<br />
Thanks alot for this publicly accessible machine! I recenly snagged a RH-specific file for my Debian GNU/Linux-based server :)<br />
thanks for this nice playbox :) </p>
<p>That&#8217;s great! I&#8217;ve just typed rm -rf / under root and nothing happened! Fantastic! Still can&#8217;t believe it!<br />
Thanks for the opportunity to let Linux enthusiasts learn SELINux hands-on!<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Very cool! Good work!<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Now Thats Cool stuff man. (masud.sp at gmail.com)<br />
COOL! thanks for your work :)<br />
Great service, thanks<br />
Nice :)<br />
Thanks!<br />
test</p>
<p>Excelent\!I will try this at home.</p>
<p>Nice demo, I&#8217;ll pass this on to the secuity team to show the concepts<br />
I have been pushing for more SE Linux deployments but policy managment is a big cost<br />
sbrunaso</p>
<p>Nice works\!<br />
SELinux is interesting.<br />
Dear Russell Coker,</p>
<p>Thanks to providing Play machine, this concept is mind blowing.</p>
<p>This will help community to grow.</p>
<p>Thanks again with regards,</p>
<p>Deepak Mahajan<br />
Head &#8211; Internet<br />
Jain Irrigation Systems Ltd.<br />
Jalgaon &#8211; India<br />
www.jains.com<br />
email: internet@jaindrip.com<br />
thanks<br />
thanks<br />
thanks &#8211; very interesting &#8211; perfect to get a first look at the selinux features<br />
COOL<br />
Thanks for the demo system, very cool!<br />
This is just cool&#8230;.Great wok Russell &#8230;&#8230;&#8230;. anspuli anspuli@gmail.com</p>
<p>very good!<br />
thanks. my work have a new possibilit now!</p>
<p>thanks for the access &#8211; rgds rhp<br />
killroy was here<br />
this really is amazing.  thanks for the demo. &#8211; db<br />
how do you do normal root admin stuff on a selinux system with strict policies in force? [you do it as sysadm_r:sysadm_t]<br />
Thanks for the access.<br />
thank you &#8212; a brave man indead !<br />
Nice box.<br />
Thanks for sharing it with us!<br />
&#8212;-[ The OOM Killer ]&#8212;-<br />
root can still eat up all memory and the next process that requests memory will be killed by the kernel.  that could be something important like apache on a server, or the &#8220;top&#8221; of the admin trying to figure out what&#8217;s going on, etc<br />
:-/<br />
memory usage should be limited<br />
[Limiting the number of processes root can use is impossible, therefore trying to limit memory use is not going to be very productive.  So I just make the conditions of use include that DOS attacks are not acceptable.  For real servers don't give the root account to hostile users and use SE Linux to help prevent hostile users getting root.]<br />
mcgrof: how about limiting number of open binds maybe?<br />
mcgrof: anyway, thanks , this is cool<br />
mcgrof: I logged out and the listening ports are still here<br />
mcgrof: I killed them for you<br />
[Again, SE Linux isn't about resource limitation.  Note that you can't bind to a port that's reserved for some other purpose.]</p>
<p>&#8212;<br />
this server sucks, cant even do a simple rm -rf / :)<br />
&#8212;<br />
mcgrof: re: binds &#8212; yeah, makes sense, thanks anyway, this is great</p>
<p>&#8212;-</p>
<p>Nice to have a hands-on SE Linux demo available! What has been bugging me for a long time: How does SE Linux compare to RSBAC? I read the mailing list discussions^H^H^Hflamewars, but didn&#8217;t get any useful information out of it.</p>
<p>Neat\!<br />
 HOW-TO make demo SeLinux machine?DmA@admin.tstu.ru Tambov ,Russia<br />
Hallo Welt<br />
Nice Try<br />
Test<br />
test<br />
Hallo<br />
Saluton<br />
Thanks for this test system.  I just copied the thanks.txt_append_only_dont_edit_with_vi file to a different name, which it allowed me to do. It appeared to have the same permissions as the original file. ["ls -lZ" shows the SE Linux contexts of files, the file you copied had a different "type"]  I couldn&#8217;t delete the original file, but it allowed me to delete the copy.  I also tried to shutdown the system and was denied.  Good demonstration of SELinux.</p>
<p>thanks, very cool</p>
<p>sweet! with the help of your configuration I managed to set up my Debian box; didn&#8217;t try to break it though, looks pretty hopeless concerning my security background. i&#8217;ll be back to learn more; thanks</p>
<p>I&#8217;m Sorry.I&#8217;ve executed it programming continuousness fork.But It&#8217;s not being malicious.Sorry really [don't worry, that happens all the time]<br />
Very impressive, thanks for the demonstration<br />
Thanks Russell, xor007 from South Africa<br />
thanks for showing off your excellent work ~Alicia<br />
helo<br />
Kool. a very intrestig demo<br />
iCanMakeAFile in my home directory.<br />
good that root can still do this.<br />
pretty wacky, see what else is around here for me to try to muck up.<br />
Ooh, root can make files in its homedir.</p>
<p>thx! linio</p>
<p>quack</p>
<p>&#8212;&#8211;<br />
Thanks for setting up a machine like this! Are there any newer packages installed than what comes with Debian Etch? Or can I build myself a machine like this using nothing but the etch packages? [during Etch I had my own repository for updated packages, now I'm doing the same for Lenny]</p>
<p>Rik<br />
&#8212;&#8211;<br />
neat. &#8211; folken from CH<br />
eat meat<br />
Thanks&#8230; &#8212; Philipp Kern ()(DD)</p>
<p>Nice one Russ.</p>
<p>mlh 2007 11 05  13:48</p>
<p>Very cool. Thanks a lot<br />
From Russia with Fun! Thx u. skynerve<br />
16 nov 2007<br />
&#8212;-<br />
Funny to allow strangers root access to your computer, but still be safe. :-)<br />
Still I think a little more documentation for SELinux-newbies could be very useful&#8230;<br />
&#8212;-</p>
<p>Test</p>
<p>great. just fucking great. russel FTW\!\!\!11one<br />
&#8212;<br />
That&#8217;s pretty cool.</p>
<p>&#8212;<br />
something<br />
Thanks<br />
cool do you have an apparmor play machine too? [it would be possible to run an apparmor Play Machine, but no-one bothered]<br />
Thanks for this nice setup, i&#8217;m not a security expert but the few things I tried where not allowed ;), way to go<br />
The fact that you feel secure even after giving out the root password has motivated me to finally dive into SELinux &#8211; thanks!<br />
Nice to meet you! I am  from a university of China.<br />
It&#8217;s strange playing on a machine in the future; I&#8217;m on the other side of<br />
the international dateline.<br />
amazing do i can do it on my debian too?:)<br />
i will try second time with selinux maybe is not too diffcult for me.<br />
Kelaz was herels</p>
<p>cool! gonna install this on my laptop. ^.^<br />
			-dcbunny</p>
<p>Hello Mon Jan 21 15:32:59 EST 2008<br />
r0b3r7<br />
nice&#8230; having an open box like this is a ballsy move i really respect that.<br />
if you don&#8217;t see the fnords they can&#8217;t eat you<br />
nice, you can&#8217;t even ls /etc/shadow ;)<br />
Nice one</p>
<p>&#8212;&#8212;</p>
<p>Hi there,</p>
<p>Thanks for the server, the best I can do so far is to have the box connect to itself continuously through ssh port so no one can log in.</p>
<p>Cheers,</p>
<p>Billy<br />
ohls -lsa! i can change passwordls -lsals -lsa [I stuffed up there]<br />
HACKED!<br />
This is pretty cool. Unfortunately, this is only the second time I&#8217;m logging into a remote shell so I&#8217;m just basking in the novelty and not really contributing anything of worth -George<br />
neat!<br />
something<br />
PRRV-Test from Austria<br />
well, thanx ;) .. i&#8217;ll read and learn about selinux i come back ;) .. bodik civ zcu cz<br />
I not able to delete /root/.ssh/authorized_keys, but was able to overwrite it.  Should this have been allowed? [no]<br />
sorry for the forkbombs!!!!<br />
~rb<br />
Thanks for the peek inside!<br />
I noticed some crashes in the last logins, what caused the crash?<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
I am internet famousls &#8211; Murray.<br />
Would be internet famous if I could spell<br />
[crashes are usually caused by DOS attacks]<br />
i was here<br />
Pretty neat! Thanks Russel<br />
root:user_r:user_t:-s0:c0.c100@play:~# hostname test<br />
hostname: you must be root to change the host name<br />
Nice :)<br />
Mon Jul  7 05:48:55 EST 2008<br />
Thanks for giving me the opportunity to test this machine<br />
SELINUX student from INDIA<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Hi there!</p>
<p>Nice security. This convinces me to have a beter look at SELinux</p>
<p>Thanks!</p>
<p>JL Lacroix from Belgium<br />
Wed Jul 23 16:15:35 EST 2008<br />
Hi,</p>
<p>SELINUX is really enormous!<br />
pretty cool setup / Henrik<br />
Thx, nice demo!<br />
format:c dont work, maybe a bug<br />
Thanks for the really amusing demo! -e</p>
<p>thanks for this stuff. it is a good starting point for SELINUX. spallares@itsyx.com.<br />
thanks a lot for the opportunity to try this. a big THX from MDQ, Argentina ;) &#8230;.zer0<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Thanks for a great demo\nMichel van Deventer, Netherlands\nmichel@het.grote.net</p>
<p>&#8212;-<br />
Interesting. I&#8217;ve always had reservations about SE Linux, because it introduces another security layer on top of the standard posix model &#8211; even with the &#8220;normal&#8221; model you can sometimes accidentally miss things. I&#8217;d be interested to hear how SE Linux has an impact on the daily life of an administrator.</p>
<p>Anyways, thanks.</p>
<p>&#8211; Random person from Belgium</p>
<p>Someone wrote &#8220;very impressive&#8221; in banner art.</p>
<p>##############################</p>
<p>Thanks for the demostration\!\!<br />
I really need to learn more about SELinux<br />
Great job\!<br />
######################################################</p>
<p>Hi!<br />
My name is Alexandre Stefani<br />
What you do is really cool. I_m learning SELinux and will install it on my Debian<br />
Thanks a lot. I_ll purchase a T-Shirt soon.</p>
<p>Thanks for the demo.<br />
please install iptraf and mc. it would be real fun. thanks!<br />
Hello. Leave your handle here:<br />
Malformation &#8211; 27/10/08<br />
I don&#8217;t remember writing that! -Malformation</p>
<p>Hello from SELinux course from Austria<br />
reerzrzr<br />
SO, root is no more the boss now, \n but you do have a boss i.e SE admin \n root is a normal handicap user on this machine</p>
<p>Ahoy from around the world!  This is an amazing demonstration!  Are the files in /selinux supposed to be world readable (even though the parent directory restricts access)?  Seems to me that a tiny privacy issue exists with concurrent play users and their /proc/${SESSIONPROCNUM}/environ file.  Then again, I am a newb&#8230;. Thanks &#038; feel free to reply to my comments at vulariter-selinuxplay@yahoo.com! [When two users login with the same UID and context then they can mess with each other, the privacy issue of the environ file is just the tip of the iceberg.]</p>
<p>&#8230;. what I meant to say was world-writable&#8230; lol.. later -peritus</p>
<p>Cool.Best regards!<br />
best regards from Poland:) Nice work here. When will be the demo how to create this kind of machine? ^_^<br />
Greetings from Chicago, i&#8217;m very much interested inlearning SELinux.  Thanks for kindly providing this resource<br />
robwuzhere<br />
Thanks from pl.<br />
thank you for providing this. I really want to learn selinux.</p>
<p>Thanks Russell.</p>
<p>[update Oct 2009]<br />
It would be nice if you explained how to setup such a play machine.<br />
[that's on my todo list]<br />
 when i grow up ill build such mashines for educational puropses. Necessary docs, tutorials, and an ability to tune the system during one paticular session. And of course &#8211; tests: are you sucsessfull. Such a system could be a wonderful alternative to e.g. LPI exams: show me. Communications inside one particular computer system. When i grow up &#8211; i&#8217;ll know English better =)<br />
hallo<br />
seLinux is fun.<br />
Hi, All.<br />
test<br />
the point is to break the machine?<br />
[the point is to discover security flaws]<br />
Interesting, going to read up on this and maybe set up a VM&#8230; sounds like fun! Thanks :)<br />
Hola. Archivo de pruebas.<br />
nice setup<br />
hi??<br />
hi all<br />
oru kundhoom nadakkunnilla<br />
Thanks for making this available &#8211; I&#8217;m just starting to look into SELinux in the hopes that it offers a usably simple security model&#8230;<br />
I am fascinated by the fact that I can append to this file, but not remo<br />
ve or truncate it. I like the fine-grained opermissions!<br />
bla bla bla<br />
selinux looks very cool. thank you for providing this.<br />
enhorabuena<br />
Hello &lt;3 selinux<br />
win, or WIN.<br />
all your base are belong to us<br />
[Section 2 of the MOTD clearly says that DOS attacks are out of scope]<br />
======================================================<br />
Hello Kind Sir,<br />
I am Dr. Adamu Salaam, the the bank manager of bank of africa (BOA) Burkina Faso West<br />
I am sending you this message about the $3.14159 million dollars in bank<br />
account number 2718281828450945.  I will give you this money in exchange<br />
for the password to the &#8216;bofh&#8217; account.<br />
======================================================<br />
[Thanks for the amusing offer.  I've been offered stolen credit cards and other<br />
junk for the password, Pi million dollars in the account numbered "e" is a<br />
refreshing change.]<br />
Can you recommend any textbooks that teach selinux? Presumably targeted at a Linux SA.<br />
weird stuff this. doesn&#8217;t feel like being root :)<br />
Why no /proc/mtrr ? I want to run exploit!<br />
[/proc/mtrr doesn't exist in a Xen DomU, there wouldn't be much point in it]<br />
muahahahah<br />
&#8212;-TONE WAS HERE &#8212;-<br />
; DROP DATABASE &#8211;<br />
SQL injection doesn&#8217;t work on flat files<br />
Hello, boys! :)<br />
Really good<br />
pretty cool&#8230;gonna be learning this reall soon. &#8212; Glitch<br />
good job! Is this a custom build of selinux policy? wright.keith@gmail.com<br />
[Custom configuration, but the main policy package is the same one that everyone else should be using]<br />
Great setup, Mr Coker. :)<br />
Cool. Thanks for the opportunity to play with this.<br />
good job SELINUX is really great :)<br />
congratulations Sir it&#8217;s really good fun to play with Your server.. SELINUX rules cat thanks.txt_append_only_dont_edit_with_vi ! ~kawooem<br />
seems untouchable&#8230; please post your SELinux recepies<br />
 -Jack<br />
Also thanks for this Testmachine, i could test my ISP if he was allowing ssh over cable network.<br />
Greets JacksOn<br />
thanks&#8230; interesting<br />
thanks.. interesting CANARIS<br />
@ CANARIS: Yes, just what I was going to say :) ~gmatht<br />
mmm4m5m: Nice. Thanks. I was here.<br />
Managed to get the server to reboot with your tight selinux &#8230; ;)<br />
 18:56:43 up 1 min,  1 user,  load average: 0.08, 0.06, 0.02<br />
[That was the watchdog responding to your DOS attack.  NB DOS attacks are out of scope.]<br />
 Cheers<br />
 David Jacobson<br />
From South Africa &#8211; Down under! [jakes@leet.org]<br />
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0<br />
I&#8217;m curious about malicious commands, i.e. do you consider malicious commands such as:<br />
rm -rf / or using mkfs on / or using a fork bomb liek :(){:|:&#038;};: is considered a security flaw or a type of DOS, didn&#8217;t want to try them just incase.<br />
[A fork bomb is a DOS attack, rm -rf and mkfs are legitimate tests of the<br />
security of the system.  I encourage you to use rm and mkfs to test the system.]<br />
I&#8217;m also curious, if you log on to the console, not ssh, but physical, as root, are the SEL restrestrictions lifted?<br />
[No, the restrictions are based on the context not the terminal.  It is<br />
possible to have pam restrict which accounts can login via various methods, so<br />
accounts that allow higher levels of access could be denied ssh logins.<br />
Also there is a boolean to determine whether the administrator can login via<br />
ssh, I have that turned on but for best security you would turn it off.]<br />
Thanks for letting us play on this box. It is a good demo. Perhaps I should not discount SELinux as just a pain in the butt like I traditionally have.<br />
impressive indeed. -reablettoz<br />
This is really cool stuff, thanks for the demo! Gotta say, the real<br />
&#8220;wow&#8221; moment for me was when I ran top and couldn&#8217;t see any procs but my own.<br />
BTW ssh is a bit laggy for me when logged into this box, moreso that most<br />
machines I ssh into. Would selinux have anything to do with this, or have I<br />
just ended up with a slow/laggy link?<br />
&#8211; Daniel Gnoutcheff &lt;gnoutchd@union.edu&gt;<br />
Sun Jul 19 23:24:51 UTC 2009<br />
[I was in the middle of doing a big file transfer when you logged in.  But even if I wasn't the link is a SOHO grade connection so you don't expect the same quality as a proper data-center.]<br />
Nice, I&#8217;ll have to look into this. Thanks for the demo\!<br />
Herro people :3<br />
nice one<br />
Sorry bout the fork-bomb yesterday :3<br />
you know it works when your instinct is to rerun with sudo before realizeing youralready root lol<br />
test test<br />
Wow, this is cool! SELinux rules! I got to try this on my own machine<br />
BENSON WAS HERE<br />
Hello from Russia<br />
=====================================================<br />
Hello from San Juan, Puerto Rico!<br />
I just found out about this server by reading the SELinux book from O&#8217;Reilly.  The book is pretty old (2004) and I&#8217;m glad to know the URL provided on the book still works!<br />
All the best,<br />
=====================================================<br />
 22:09:47 up 21:34,  1 user,  load average: 0.00, 0.00, 0.00<br />
Great job with this one, i&#8217;ve tried a number of things -<br />
  attemtping to get cron to run the files as bofh (no luck, cron transitions to the context im in)<br />
  attempting to put hard links in /root so that it relabels key files (no luck, /root is on a different partition)<br />
  attempting to mknod a block device (no luck, nodev is set in the mount options and there isnt many places I can write to anyway)<br />
  attempting to signal a coredump of &#8220;chage&#8221; (which doesnt complain when i run it by the way!) so I can read shadow.<br />
  attempting to perform sigstop on chage so i can ouput the file descriptor (no luck, chage transitions, i cant read its proc entry nor can i signal it anyway)<br />
  attempting to chroot a new environment (no luck, no chroot process privilege)<br />
I think the closest i got was trying to manipulate chage, but i was far far off then. That or being able to write to bofh crontab.<br />
The most effective way to get around the selinux restrictuions would probably be to get read access to /dev/hdc then run debugfs on it to dump the shadow file. But I spent too long on this now anyway!<br />
Great work!<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Matthew</p>
]]></content:encoded>
			<wfw:commentRss>http://doc.coker.com.au/computers/thankstxt-on-my-play-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
