<?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>Hacktopia</title>
	<atom:link href="http://www.hacktopia.net/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hacktopia.net/wp</link>
	<description>The zen of hacking</description>
	<lastBuildDate>Tue, 15 Jun 2010 17:40:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Easiest way to relay mail through GMail using Postfix and Debian</title>
		<link>http://www.hacktopia.net/wp/easiest-way-torelay-mail-through-gmail-using-postfix-and-debian/</link>
		<comments>http://www.hacktopia.net/wp/easiest-way-torelay-mail-through-gmail-using-postfix-and-debian/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 21:41:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=188</guid>
		<description><![CDATA[There are times when you need need to send E-Mail from your Linux server.  The reason that I had to set up E-Mail was because I had a php script that E-Mailed me once some one filled out their information on the website.  The easiest way to get your server sending mail is using GMail [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you need need to send E-Mail from your Linux server.  The reason that I had to set up E-Mail was because I had a php script that E-Mailed me once some one filled out their information on the website.  The easiest way to get your server sending mail is using GMail to send the mail.  This tutorial will describe how to set it up on Ubuntu / Debian.</p>
<blockquote><p><code>sudo aptitude install postfix libsasl2 ca-certificate libsasl2-modules</code></p></blockquote>
<p>You want to add the fowling lines to your /etc/postfix/main.cf</p>
<blockquote><p><code>relayhost = [smtp.gmail.com]:587<br />
smtp_sasl_auth_enable = yes<br />
smtp_sasl_password_maps = hash:/etc/postfix/</code>gmail_passwd<br />
<code> smtp_sasl_security_options = noanonymous<br />
smtp_tls_CAfile = /etc/postfix/cacert.pem<br />
smtp_use_tls = yes</code></p></blockquote>
<p>You need to edit <code>/etc/postfix/</code>gmail_passwd and add the fowling information below, edit it to fit your needs.</p>
<blockquote><p>[smtp.gmail.com]:587    UserMame@gmail.com:PassWord</p></blockquote>
<p>Next you need to turn the gmai_passwd file into something that postfix can understand, you can use the command below to accomplish that.</p>
<blockquote><p><code>sudo chmod 400 /etc/postfix/sasl_passwd<br />
sudo postmap /etc/postfix/sasl_passwd</code></p></blockquote>
<p>Now you can restart postfix but it will complain about not being able to authenticate the certificate.  In order to fix the problem we will use the ca-certificate package we installed earlier to tell it where it can validate the certificate.</p>
<blockquote><p><code>cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem</code></p></blockquote>
<p>Now restart postfix for the final time.</p>
<blockquote><p>/etc/init.d/postfix</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/easiest-way-torelay-mail-through-gmail-using-postfix-and-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to mirror ZFS root disk on a sparc system.</title>
		<link>http://www.hacktopia.net/wp/how-to-mirror-zfs-root-disk-on-a-sparc-system/</link>
		<comments>http://www.hacktopia.net/wp/how-to-mirror-zfs-root-disk-on-a-sparc-system/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:43:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Solaris 10]]></category>
		<category><![CDATA[Solaris Sparc]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=121</guid>
		<description><![CDATA[First we look to see that everything looks good on our current drive that we are booted off of.  I would also like to note that there is no UFS on this system at all.  We are booting entirely off of the ZFS pool rpool. # zpool status pool: rpool state: ONLINE scrub: none requested [...]]]></description>
			<content:encoded><![CDATA[<p>First we look to see that everything looks good on our current drive that we are booted off of.  I would also like to note that there is no UFS on this system at all.  We are booting entirely off of the ZFS pool rpool.</p>
<blockquote><p># zpool status<br />
pool: rpool<br />
state: ONLINE<br />
scrub: none requested<br />
config:</p>
<p>NAME        STATE     READ WRITE CKSUM<br />
rpool       ONLINE       0     0     0<br />
c0t0d0s0  ONLINE       0     0     0</p>
<p>errors: No known data errors</p></blockquote>
<p>Now verify that the two disks that you want to mirror looks the same at the slave level.</p>
<blockquote><p># format<br />
Searching for disks&#8230;done</p>
<p>AVAILABLE DISK SELECTIONS:<br />
0. c0t0d0 &lt;ST320011A cyl 38790 alt 2 hd 16 sec 63&gt;<br />
/pci@1f,0/ide@d/dad@0,0<br />
1. c0t2d0 &lt;DEFAULT cyl 38790 alt 2 hd 16 sec 63&gt;<br />
/pci@1f,0/ide@d/dad@2,0<br />
Specify disk (enter its number): 0<br />
selecting c0t0d0<br />
[disk formatted, no defect list found]<br />
/dev/dsk/c0t0d0s0 is part of active ZFS pool rpool. Please see zpool(1M).<br />
/dev/dsk/c0t0d0s2 is part of active ZFS pool rpool. Please see zpool(1M).</p>
<p>FORMAT MENU:<br />
disk       &#8211; select a disk<br />
type       &#8211; select (define) a disk type<br />
partition  &#8211; select (define) a partition table<br />
current    &#8211; describe the current disk<br />
format     &#8211; format and analyze the disk<br />
repair     &#8211; repair a defective sector<br />
show       &#8211; translate a disk address<br />
label      &#8211; write label to the disk<br />
analyze    &#8211; surface analysis<br />
defect     &#8211; defect list management<br />
backup     &#8211; search for backup labels<br />
verify     &#8211; read and display labels<br />
save       &#8211; save new disk/partition definitions<br />
volname    &#8211; set 8-character volume name<br />
!&lt;cmd&gt;     &#8211; execute &lt;cmd&gt;, then return<br />
quit<br />
format&gt; ver</p>
<p>Primary label contents:</p>
<p>Volume name = &lt;        &gt;<br />
ascii name  = &lt;ST320011A cyl 38790 alt 2 hd 16 sec 63&gt;<br />
pcyl        = 38792<br />
ncyl        = 38790<br />
acyl        =    2<br />
nhead       =   16<br />
nsect       =   63<br />
Part      Tag    Flag     Cylinders         Size            Blocks<br />
0       root    wm       0 &#8211; 38789       18.64GB    (38790/0/0) 39100320<br />
1 unassigned    wm       0                0         (0/0/0)            0<br />
2     backup    wm       0 &#8211; 38789       18.64GB    (38790/0/0) 39100320<br />
3 unassigned    wm       0                0         (0/0/0)            0<br />
4 unassigned    wm       0                0         (0/0/0)            0<br />
5 unassigned    wm       0                0         (0/0/0)            0<br />
6 unassigned    wm       0                0         (0/0/0)            0<br />
7 unassigned    wm       0                0         (0/0/0)            0</p>
<p>format&gt; disk 1<br />
selecting c0t2d0<br />
[disk formatted, no defect list found]<br />
format&gt;</p></blockquote>
<p>Notice that both disks have 0 &#8211; 38789 Cylinders.  So the disks look good, now we can attach the second disk.</p>
<blockquote><p># zpool attach rpool c0t0d0s0 c0t2d0s0<br />
#<br />
# zpool status<br />
pool: rpool<br />
state: ONLINE<br />
status: One or more devices is currently being resilvered.  The pool will<br />
continue to function, possibly in a degraded state.<br />
action: Wait for the resilver to complete.<br />
scrub: resilver in progress for 0h0m, 3.28% done, 0h24m to go<br />
config:</p>
<p>NAME          STATE     READ WRITE CKSUM<br />
rpool         ONLINE       0     0     0<br />
mirror      ONLINE       0     0     0<br />
c0t0d0s0  ONLINE       0     0     0<br />
c0t2d0s0  ONLINE       0     0     0</p>
<p>errors: No known data errors</p></blockquote>
<p>WoW that was easy to mirror two disks with ZFS.  No need to set up data stores or anything like that.  The fact that the zpool status output specify &#8220;mirror&#8221; means the disks are mirrored and not striped.  If you have multiple zfs pools you can specify zpool status POOLNAME.</p>
<p>Now to try to distroy the disk, ha, ha, ha!</p>
<blockquote><p># dd if=/dev/random of=/dev/rdsk/c0t2d0s0<br />
969+0 records in<br />
969+0 records out</p></blockquote>
<p>Now if that disk was on a normal RAID utility stuch as solstice disk suite SDS or even hardware raid then both disks would be destroyed because they operate at the block level, and will copy the random blocks back do c0t0d0s0</p>
<blockquote><p># zpool status<br />
pool: rpool<br />
state: DEGRADED<br />
status: One or more devices could not be opened.  Sufficient replicas exist for<br />
the pool to continue functioning in a degraded state.<br />
action: Attach the missing device and online it using &#8216;zpool online&#8217;.<br />
see: http://www.sun.com/msg/ZFS-8000-2Q<br />
scrub: resilver in progress for 0h1m, 10.52% done, 0h12m to go<br />
config:</p>
<p>NAME          STATE     READ WRITE CKSUM<br />
rpool         DEGRADED     0     0     0<br />
mirror      DEGRADED     0     0     0<br />
c0t0d0s0  ONLINE       0     0     0<br />
c0t2d0s0  UNAVAIL      0     0     0  cannot open</p>
<p>errors: No known data errors</p></blockquote>
<p>Oha happy ZFS is already working on fixing or resilvering the disk that was written to with random data.</p>
<blockquote><p># zpool status<br />
pool: rpool<br />
state: DEGRADED<br />
status: One or more devices could not be opened.  Sufficient replicas exist for<br />
the pool to continue functioning in a degraded state.<br />
action: Attach the missing device and online it using &#8216;zpool online&#8217;.<br />
see: http://www.sun.com/msg/ZFS-8000-2Q<br />
scrub: resilver completed after 0h0m with 0 errors on Tue Apr 14 12:55:48 2009<br />
config:</p>
<p>NAME          STATE     READ WRITE CKSUM<br />
rpool         DEGRADED     0     0     0<br />
mirror      DEGRADED     0     0     0<br />
c0t0d0s0  ONLINE       0     0     0<br />
c0t2d0s0  UNAVAIL      0     0     0  cannot open</p>
<p>errors: No known data errors</p></blockquote>
<p>Now ZFS is angry because we wrote random data to the disk.</p>
<blockquote><p># zpool online  rpool  c0t2d0s0</p>
<p># installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t2d0s0</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/how-to-mirror-zfs-root-disk-on-a-sparc-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>force dhcpd to log to it&#8217;s own file with syslog-ng</title>
		<link>http://www.hacktopia.net/wp/force-dhcpd-to-log-to-its-own-file-with-syslog-mg/</link>
		<comments>http://www.hacktopia.net/wp/force-dhcpd-to-log-to-its-own-file-with-syslog-mg/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:33:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=174</guid>
		<description><![CDATA[So I did not want my dhcpd messages to be lumped in with all the other /var/log/syslog messages.  I am running Debian 5 with comes running with syslog-ng.  While syslog-ng is much more customizable then plain syslog, it can also be very confusing.  Below is a example of all that I had to add to [...]]]></description>
			<content:encoded><![CDATA[<p>So I did not want my dhcpd messages to be lumped in with all the other /var/log/syslog messages.  I am running Debian 5 with comes running with syslog-ng.  While syslog-ng is much more customizable then plain syslog, it can also be very confusing.  Below is a example of all that I had to add to make syslog send all dhcpd messages to /var/log/dhcpd.log.  All I had to do was add those lines to the end of the /etc/syslog-ng/syslog-ng.conf configuration file, and then restart syslog-ng with /etc/init.d/syslog-ng  restart.  Did not even have to touch /var/log/dhcpd.log, syslog-ng took care of creating that while writing the first log entry.</p>
<blockquote><p>filter f_daemon     {facility(daemon); };<br />
filter f_dhcpd       {match(&#8220;dhcpd&#8221;); };<br />
destination dhcpmessages { file(&#8220;/var/log/dhcpd.log&#8221;); };<br />
log { source(s_all); filter(f_daemon);  filter(f_dhcpd); destination(dhcpmessages); };</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/force-dhcpd-to-log-to-its-own-file-with-syslog-mg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google sign in error, err I mean youtube</title>
		<link>http://www.hacktopia.net/wp/google-sign-in-error-err-i-mean-youtube/</link>
		<comments>http://www.hacktopia.net/wp/google-sign-in-error-err-i-mean-youtube/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 18:21:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=164</guid>
		<description><![CDATA[I received this error after I tried to sign into google.com.  Thought everyone might be interested in seeing what a google error looks like since google works most of the time.]]></description>
			<content:encoded><![CDATA[<p>I received this error after I tried to sign into google.com.  Thought everyone might be interested in seeing what a google error looks like since google works most of the time.</p>
<p><a href="http://www.hacktopia.net/wp/wp-content/uploads/2010/03/signin.jpg"><img class="alignleft size-medium wp-image-165" title="Google sign in error" src="http://www.hacktopia.net/wp/wp-content/uploads/2010/03/signin-300x186.jpg" alt="" width="300" height="186" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/google-sign-in-error-err-i-mean-youtube/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>remove passowrd from Apache SSL Certificate</title>
		<link>http://www.hacktopia.net/wp/remove-passowrd-from-apache-ssl-certificate/</link>
		<comments>http://www.hacktopia.net/wp/remove-passowrd-from-apache-ssl-certificate/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 13:51:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hacktopia.net/wp/?p=161</guid>
		<description><![CDATA[So you need to restart Apache that has a SSL certificate, but you don&#8217;t want to give the other admins the password, or for other reasons.  My reason for taking it out was that logrotate wants to restart Apache after log rotation.  Well with Apache sitting waiting for a password, it screws everything up, because [...]]]></description>
			<content:encoded><![CDATA[<p>So you need to restart Apache that has a SSL certificate, but you don&#8217;t want to give the other admins the password, or for other reasons.  My reason for taking it out was that logrotate wants to restart Apache after log rotation.  Well with Apache sitting waiting for a password, it screws everything up, because it sits and waits for a password that is never entered.</p>
<blockquote><p>server:/etc/apache2/keys# openssl rsa -in website.key  -out website.key.nopass<br />
Enter pass phrase for website.key:<br />
writing RSA key</p></blockquote>
<p>Make sure you edit /etc/apache2/sites-enabled/000-default or where ever you set up SSL on apache to make it use the new website.key.nopass key.  Look how wonderfully it restarts apache with out bothering you for a password now.</p>
<p>So it now looks like</p>
<blockquote><p>SSLCertificateKeyFile /etc/apache2/keys/roadwarriorvpn.key.nopass</p></blockquote>
<p>Yaha it restarted with out having to enter a password.</p>
<blockquote><p>front:/etc/apache2# /etc/init.d/apache2ssl  restart<br />
Restarting web server: apache2 &#8230; waiting .<br />
front:/etc/apache2#</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hacktopia.net/wp/remove-passowrd-from-apache-ssl-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
