<?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"
	>

<channel>
	<title>Mark Sanborn . net</title>
	<atom:link href="http://www.marksanborn.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marksanborn.net</link>
	<description>...</description>
	<pubDate>Fri, 09 May 2008 20:01:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Duplicate Content Causes SEO Problems in Wordpress</title>
		<link>http://www.marksanborn.net/seo/duplicate-content-causes-seo-problems-in-wordpress/</link>
		<comments>http://www.marksanborn.net/seo/duplicate-content-causes-seo-problems-in-wordpress/#comments</comments>
		<pubDate>Fri, 09 May 2008 09:01:11 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[SEO]]></category>

		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=149</guid>
		<description><![CDATA[Wordpress by default is very un-search engine friendly.  There are many places where content is the same yet the URL is different.  Google recognizes this as duplicate content.
Modern search engines like Google penalize for duplicate content.  They do this because they want to give credit to the original author and keep spammers [...]]]></description>
			<content:encoded><![CDATA[<p>Wordpress by default is very un-search engine friendly.  There are many places where content is the same yet the URL is different.  Google recognizes this as duplicate content.</p>
<p>Modern search engines like Google penalize for duplicate content.  They do this because they want to give credit to the original author and keep spammers or copiers from getting page rank.  They also do this to separate actual content and navigation/sidebar/ and other text that is not ranked as higher value.  This all helps Google provide better search results.<span id="more-149"></span></p>
<h3>So whats the big deal?</h3>
<p>&nbsp;<br />
Here is a direct quote from Google&#8217;s FAQ: <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=40349&#038;ctx=related">How can I create a Google-friendly site?</a></p>
<blockquote><p>Don&#8217;t create multiple copies of a page under different URLs. Many sites offer text-only or printer-friendly versions of pages that contain the same content as the corresponding graphic-rich pages. To ensure that your preferred page is included in our search results, you&#8217;ll need to block duplicates from our spiders using a robots.txt file.</p></blockquote>
<p>The problem is that your Wordpress blog by default will not rank well in Google&#8217;s search engines because of the duplication problem.  Fortunately Google and other search engines have provided us with a tool to inform their search engine spiders to ignore specific content.</p>
<p>Let me give you a few examples of where Wordpress contains the same content throughout multiple URLs.</p>
<p>1.  <strong>www.yourblog.com</strong> has by default that last 10 or so posts.  The &#8220;original content&#8221; maybe in this URL: http://www.yourblog.com/2008/04/title-of-story , but is also on your home page.</p>
<p>2.  <strong>http://www.yourblog.com/2008/04/</strong> - Your archive pages contain the same content as your main page with a date range.</p>
<p>3.  <strong>http://www.yourblog.com/category/category-name/ </strong>- The same thing goes for your category pages.  Every post in the category-name category will be duplicated within this URL.</p>
<p>4.  <strong>http://www.yourblog.com/feed</strong> - All articles in their entirety are duplicated in all of the Wordpress default feeds.</p>
<p>5.  <strong>http://www.yourblog.com/search</strong> - Of course all search results will also be duplicated content.</p>
<p>As you can see these URLs are all different but contain the exact same content.  If you don&#8217;t want to be penalized by google you need to create a file at the root directory of your blog called, &#8216;<strong>robots.txt</strong>&#8216;.  This is the file that search engine spiders will be looking for and this is where you specify the rules you want them to follow.</p>
<h3>Robots.txt</h3>
<p>&nbsp;<br />
The following robots.txt file will pretty much restrict search engine spiders from most of the duplication problems I can think of.</p>
<p><code>User-agent: *<br />
Disallow: /wp-<br />
Disallow: /search<br />
Disallow: /feed<br />
Disallow: /comments/feed<br />
Disallow: /feed/$<br />
Disallow: /*/feed/$<br />
Disallow: /*/feed/rss/$<br />
Disallow: /*/trackback/$<br />
Disallow: /*/*/feed/$<br />
Disallow: /*/*/feed/rss/$<br />
Disallow: /*/*/trackback/$<br />
Disallow: /*/*/*/feed/$<br />
Disallow: /*/*/*/feed/rss/$<br />
Disallow: /*/*/*/trackback/$</code></p>
<p>Since we want the bots to follow links in our category, archive pages and certainly the home page we will have to treat them differently.  We want search engine spiders to follow the links on these pages yet we don&#8217;t want the actual content indexed due to the duplication penalties.</p>
<p>This code will tell the bots to follow links and ignore content.  Place this html code in your archive and category pages.</p>
<p><code>&#60;meta name=&#34;robots&#34; content=&#34;noindex,follow&#34; /&#62;</code></p>
<p>Another line of defense for fighting against duplication on these pages is to use the Wordpress &#8216;<strong>more</strong>&#8216; function.  When you add the more function in your posts Wordpress will cut the article off at that point and offer the reader a &#8220;read more&#8221; link.  Not only does this help with duplication issues it will make navigating through articles much easier for your users.</p>
<p>The more function:</p>
<p><code>&#60;!-- more --&#62;</code></p>
<p>Of course Google has many ways to determine page rank and how pages are indexed.  We can never be sure how Google weighs them and what other factors determine a page&#8217;s quality content.  So you may find a piece of content that is duplicated all over the internet but the original is still ranked high because of link popularity or other factors.</p>
<p>Your entire website may also be a duplicate.  <a href="http://www.marksanborn.net/seo/duplicate-content-www-vs-non-www-canonical-problems/">Check out, Duplicate Content www vs. non-www Canonical Problems</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/seo/duplicate-content-causes-seo-problems-in-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Paypal Security Key for Multi-Factor Authentication</title>
		<link>http://www.marksanborn.net/uncategorized/paypal-security-key-for-multi-factor-authentication/</link>
		<comments>http://www.marksanborn.net/uncategorized/paypal-security-key-for-multi-factor-authentication/#comments</comments>
		<pubDate>Tue, 06 May 2008 04:19:22 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Multi-factor Authentication]]></category>

		<category><![CDATA[Paypal]]></category>

		<category><![CDATA[Verisign]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=155</guid>
		<description><![CDATA[After listening to an episode of the Security Now Podcast I was fascinated by the idea of multi-factor authentication.  In the perfect paper password episode they discussed using one time passwords that were written on a credit card sized piece of paper.  Each time you log in you would have to supply both [...]]]></description>
			<content:encoded><![CDATA[<p>After listening to an episode of the <a href="http://www.grc.com/securitynow.htm">Security Now Podcast</a> I was fascinated by the idea of multi-factor authentication.  In the perfect paper password episode they discussed using one time passwords that were written on a credit card sized piece of paper.  Each time you log in you would have to supply both your password and a pseudo-random one time use password that is on your credit sized perfect paper password card.  The next time you logged in you would have to supply the next one time password from the card.  When all the passwords are used up you would print another card and start the process over.<span id="more-155"></span></p>
<p>The strength in this lies in the fact that someone listening to authentication process knowing every detail about the process would not be able to utilize a replay attack.  That is, they would not be able to authenticate if they typed in your password and one time key.  This is because the key is exactly how it is written, one time use.</p>
<p><img src="http://www.marksanborn.net/wp-content/uploads/2008/05/landinggraphic2.jpg" alt="Verisign Paypal Key" title="footballkey" style="float:right; margin: 0px, 0px, 4px, 8px;"/>If someone were to find your paper with one time keys they would still not be able to log in because they do not have knowledge of your password.</p>
<p>Although Steve Gibson from Security Now has a more secure implementation and full documentation on how to implement it, Verisign/Paypal have a similar proprietary system in place.  One of the major differences in their system is they don&#8217;t use a piece of paper but rather a digital device with keys that change based on time.  They are synced with the server and display a different key based on the current date and time.</p>
<p>With security these days and the number of vulnerabilities I was excited to find out that Paypal offers the device for only $5.00.  These devices purchased directly from Verisign are $30.00 for the football shaped one and $48.00 for the credit card style.  The Paypal device is the exact same for a fraction of the price and worth every penny.  The best part of the whole thing is that the device can be used for all online services that use OpenID Authentication.</p>
<p>Let me reiterate how cool this thing is.  Someone can have full knowledge of your password but still have no access without having this physical device in their hands.  On the flip side if you lose the device it is meaningless without knowledge of the account&#8217;s username and password.</p>
<p>They only thing draw back is having to carry around the key chain size device around.  They do have a credit card style device but it is $48.00.  This would be much more convenient though because you can carry it in our wallet and most people carry their wallets around.</p>
<h3>Create your own</h3>
<p>&nbsp;<br />
If you are interested in creating your own one-time multi-factor authentication system using paper instead of an electronic device you can check out, <a href="https://www.grc.com/ppp">perfect paper passwords</a>.  Open source applications have already been implemented.  Someone has already written a PAM plugin for Linux so you can authenticate SSH sessions with this method.  There is even a PHP function for creating secure web logins.  The method described is even more secure than Verisign but you do have to print out paper cards every 100 or so logins.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/uncategorized/paypal-security-key-for-multi-factor-authentication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekend Link Roundup: Week 6</title>
		<link>http://www.marksanborn.net/links/weekend-link-roundup-week-6/</link>
		<comments>http://www.marksanborn.net/links/weekend-link-roundup-week-6/#comments</comments>
		<pubDate>Sat, 03 May 2008 15:00:22 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=151</guid>
		<description><![CDATA[Server Environment Discovery Tool - This is an sweet time saver for knowing what services a server offers.
Feds: We will search through your laptop files at the border - Well this seems crazy to me.  If you are traveling abroad you may be subject to search and seizure of your laptop/cellphone data.  I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.jeremymartin.name/2008/04/know-your-environment-php-server-module.html">Server Environment Discovery Tool</a> - This is an sweet time saver for knowing what services a server offers.</p>
<p><a href="http://tech.yahoo.com/blogs/null/90325">Feds: We will search through your laptop files at the border</a> - Well this seems crazy to me.  If you are traveling abroad you may be subject to search and seizure of your laptop/cellphone data.  I&#8217;ll quote good ol&#8217; Ben Franklin, &#8220;They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.&#8221;  I recommend using a program like <a href="http://www.truecrypt.org/">truecrypt</a> for whole drive encryption.  I think it would also be fun to write over the &#8220;blank spots&#8221; of your hard drive with Rick Astley videos.<span id="more-151"></span></p>
<p><a href="http://seattletimes.nwsource.com/html/microsoft/2004379751_msftlaw29.html">Microsoft device helps police pluck evidence from cyberscene of crime</a> - Microsoft apprently made a USB device that allows law enforcement to quickly decrypt passwords and perform other forensic tasks.  I am guessing it will decrypt Windows passwords easily since this has <a href="http://www.marksanborn.net/security/crack-windows-xp-and-vista-passwords-in-seconds/">already been done</a>, but what good is it for people that operating systems with real encryption and authentication methods?</p>
<p><img src="http://www.marksanborn.net/wp-content/uploads/2008/04/opera-logo.png" style="float:right; margin: 0px, 0px, 4px, 8px;" /><a href="http://arstechnica.com/news.ars/post/20080428-hands-on-opera-9-5-beta-2-improves-speed-adds-features.html">Opera 9.5 beta 2 improves speed, adds features</a> - The author of this artcile does his own tests and finds Opera is much faster than Firefox and the new beta version of Firefox.  I have always liked Opera for many reasons and always knew opera was lighter and faster than other browsers. The artcile is a well written review of the newest version.</p>
<p><a href="http://support.microsoft.com/kb/276304">Error Message: Your Password Must Be at Least 18770 Characters and Cannot Repeat Any of Your Previous 30689 Passwords</a> - An actual error in Microsoft Windows with resolution.  Unbelievable!</p>
<p><a href="http://www.washingtonpost.com/wp-dyn/content/article/2008/04/26/AR2008042600260.html">Hackers Focus Efforts on Firefox, Safari</a> - An intersting article about hackers targeting the ever popular Firefox and Safari internet browsers.  I suspect hackers will be targeting Firefox even more in the future.</p>
<p><a href="http://tombuntu.com/index.php/2008/04/25/10-tips-for-after-you-install-or-upgrade-ubuntu/">10 Tips for After You Install or Upgrade Ubuntu</a> - If you are new to Linux you are probably using Ubuntu.  If you are new to Ubuntu you should probably check this article out. <img src='http://www.marksanborn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.ibm.com/developerworks/library/x-youtubeapi/index.html?ca=drs-">Use the YouTube API with PHP</a> - A neat in depth article about using Youtube&#8217;s API with PHP.  I havn&#8217;t thought of a way to use this yet, but very cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/links/weekend-link-roundup-week-6/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adsense Split Testing Results for 250&#215;250 vs 300&#215;250</title>
		<link>http://www.marksanborn.net/php/adsense-split-testing-results-for-250x250-vs-300x250/</link>
		<comments>http://www.marksanborn.net/php/adsense-split-testing-results-for-250x250-vs-300x250/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 16:43:01 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Adsense]]></category>

		<category><![CDATA[Split testing]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=153</guid>
		<description><![CDATA[If you remember back to the post I wrote, Using PHP to Determine Which Adsense Ad Works Best, we explored ways to split test the performance of Adsense with the help of PHP.  I had also promised to share the results of my testing for the month of April.  Below are my results.
I [...]]]></description>
			<content:encoded><![CDATA[<p>If you remember back to the post I wrote, <a href="http://www.marksanborn.net/php/using-php-to-determine-which-adsense-ad-works-best/">Using PHP to Determine Which Adsense Ad Works Best</a>, we explored ways to split test the performance of Adsense with the help of PHP.  I had also promised to share the results of my testing for the month of April.  Below are my results.<span id="more-153"></span></p>
<p>I was surprised to find that on my particular blog the smaller Adsense ad was significantly more effective than the larger 300&#215;250 ad.  This is great news for you since there will be less ad space and more content.</p>
<p>Here are my results for the split testing of the two ad mediums.</p>
<h3>250&#215;250</h3>
<p>&nbsp;<br />
48.27% of the clicks<br />
.59 CTR<br />
eCPM was 171% higher than 300&#215;250 resulting in 73.03% of the revenue.</p>
<h3>300&#215;250</h3>
<p>&nbsp;<br />
51.72% of the clicks<br />
.64 CTR<br />
eCPM resulted in 26.97% of the revenue.</p>
<p>Although the 300&#215;250 ad had a slightly higher click through rate, the 250&#215;250 ad out performed the other ad in terms of net revenues.</p>
<p>Have you split tested your ads?  If so please share your results.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/php/adsense-split-testing-results-for-250x250-vs-300x250/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Creating Useful Bash Aliases</title>
		<link>http://www.marksanborn.net/linux/creating-useful-bash-aliases/</link>
		<comments>http://www.marksanborn.net/linux/creating-useful-bash-aliases/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 05:36:28 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Alias]]></category>

		<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=152</guid>
		<description><![CDATA[Bash can be configured to recognize any word you want and link it to a command.  This is called an alias.  This is can be used for many reasons.  For instance, you could assign a short word like dvdbackupnow to execute a very long command that you don&#8217;t want to memorize each [...]]]></description>
			<content:encoded><![CDATA[<p>Bash can be configured to recognize any word you want and link it to a command.  This is called an alias.  This is can be used for many reasons.  For instance, you could assign a short word like dvdbackupnow to execute a very long command that you don&#8217;t want to memorize each time you want to back up a DVD.  We will explore a few useful aliases and how to add them to bash.<span id="more-152"></span></p>
<p>To create an alias you need to modify &#8216;<strong>/home/user/.bashrc</strong>&#8216;.  Towards the bottom of the file you can add lines for aliases.  Most people will find that they already have at least one default alias.  Usually the &#8216;<strong>ls</strong>&#8216; command is mapped to &#8216;<strong>ls -G</strong>&#8216;.  The &#8216;<strong>-G&#8217;</strong> flag tells the program to print directories in color.</p>
<p>Once the &#8216;<strong>.bashrc</strong>&#8216; file is modified you will have to re-login to that shell for the settings to take effect.</p>
<h3>Example Aliases</h3>
<p>&nbsp;<br />
Lets say you maintain multiple servers using ssh with different IP addresses and varying user names.  You could use aliases to minimize typing and having to memorize IP addresses and names.</p>
<p><code>alias server1='ssh 192.168.1.102 -l pete'<br />
alias server2='ssh 192.168.1.103 -l larry'<br />
alias server3='ssh www.myremoteserver.com -l bob'</code></p>
<p>You could make <a href="http://www.marksanborn.net/howto/use-rsync-for-daily-weekly-and-full-monthly-backups/">a system backup script</a> and whenever you feel like you need to make a quick unscheduled backup you could use:</p>
<p><code>alias backupNow='sh /path/to/my/backupscript.sh'</code></p>
<p>You could make an alias to show open ports in your system.</p>
<p><code>alias openports='netstat -nape --inet'</code></p>
<p>It is often helpful to make an alias for really long directories that you navigate to a lot.</p>
<p><code>alias g2path='cd /go/to/this/path/that/is/really/long/and/annoying/to/type; ls'</code></p>
<p>For the ultra paranoid you can set up an alias to <a href="http://www.marksanborn.net/howto/wiping-a-hard-drive-with-dd/">wipe your hard drive</a>.</p>
<p><code>alias wipenow='dd if=/dev/urandom of=/dev/hda'</code></p>
<h3>Using aliases with variables</h3>
<p>&nbsp;</p>
<p>You can use variables in aliases if you want to get more use out of them.</p>
<p><code>alias psx="ps -auxw ¦ grep $1"</code></p>
<p>This will except a variable in the alias.  For example you could type this command:</p>
<p><code>$ psx ssh</code></p>
<p>This will print out detailed information about the ssh process.</p>
<p>By setting variables into your alias you can make your alias have multiple uses.  For example our <strong>&#8216;psx</strong>&#8216; alias can be used to find all the processes started by user, &#8216;<strong>mark</strong>&#8216;.</p>
<p><code>$psx mark</code></p>
<p>If you have a long command that you type frequently consider putting it in as an alias.  If you think of any useful alias ideas let us know in the comments below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/linux/creating-useful-bash-aliases/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Encrypt a File on Linux or FreeBSD with GnuPG</title>
		<link>http://www.marksanborn.net/security/encrypt-a-file-on-linux-or-freebsd-with-gnupg/</link>
		<comments>http://www.marksanborn.net/security/encrypt-a-file-on-linux-or-freebsd-with-gnupg/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 16:07:18 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[Enryption]]></category>

		<category><![CDATA[GnuPG]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=140</guid>
		<description><![CDATA[If you ever wanted to quickly encrypt a file in Linux or FreeBSD without complicated keyrings and key files this is the post for you.  In this guide we will use gnupg to quickly encrypt any file in Linux or FreeBSD.  We will keep it simple and easy and leave out public/private key [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever wanted to quickly encrypt a file in Linux or FreeBSD without complicated keyrings and key files this is the post for you.  In this guide we will use gnupg to quickly encrypt any file in Linux or FreeBSD.  We will keep it simple and easy and leave out public/private key ring authentication and stick with simple password phrase encryption.  Unlike password protection in zip files and other weak security implementation, PGP or GnuPG is a very secure way of encrypting files.  It is pretty easy to set up so lets get going.<span id="more-140"></span></p>
<h3>Linux</h3>
<p>&nbsp;<br />
Start by installing gnupg<br />
For Debian and Ubuntu systems use:</p>
<p><code># apt-get install gnupg</code></p>
<h3>Installing GnuPG on FreeBSD</h3>
<p>&nbsp;<br />
To install GnuPG with FreeBSD&#8217;s ports package management system use:</p>
<p><code># cd /usr/ports/security/gnupg<br />
# make install clean</code></p>
<p>You also need to install pinentry.  This is the program gnupg uses to create password phrases.</p>
<p><code># cd /usr/local/ports/security/pinentry<br />
# make install clean</code></p>
<p>If you don&#8217;t install this you will get an error when you run gnupg like this:</p>
<p><code>gpg-agent[13068]: can’t connect server: `ERR 67109133 can’t exec `/usr/local/bin/pinentry’: No such file or directory’<br />
gpg-agent[13068]: can’t connect to the PIN entry module: IPC connect call failed<br />
gpg-agent[13068]: command get_passphrase failed: No pinentry<br />
gpg: problem with the agent: No pinentry</code></p>
<p>I am not sure why FreeBSD doesn&#8217;t mark this as a dependency.</p>
<h3>Encrypting the File</h3>
<p>&nbsp;<br />
To encrypt the file all you have to do is:</p>
<p><code>gpg -c someFile.txt</code></p>
<p>To decrypt you can use:</p>
<p><code>gpg someFile.gpg</code></p>
<p>You will probably want to destroy the original unencrypted file.  You can <a href="http://www.marksanborn.net/security/securely-wipe-a-file-with-dd/">Securely Wipe a File with DD</a>.  By wiping the file with DD the original file will not be easily retrievable on your hard drive.  This step is usually necessary because simply deleting doesn&#8217;t actually destroy the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/security/encrypt-a-file-on-linux-or-freebsd-with-gnupg/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Numbering Each Line in a Text File</title>
		<link>http://www.marksanborn.net/linux/numbering-each-line-in-a-text-file/</link>
		<comments>http://www.marksanborn.net/linux/numbering-each-line-in-a-text-file/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 17:25:50 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=150</guid>
		<description><![CDATA[Sometimes we are given an error message that references a line number in a text file.  We can number each line so we can find the error message right a way.  In fact, we can print out the exact line that contains the error.  This is often useful for finding errors in [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we are given an error message that references a line number in a text file.  We can number each line so we can find the error message right a way.  In fact, we can print out the exact line that contains the error.  This is often useful for finding errors in PHP.  If there is an error in the syntax of PHP it will give you the line number it is on.  Often times I don&#8217;t work in an environment that shows line numbers and I am not about to count each line by hand.<span id="more-150"></span></p>
<p>To print out the exact line with cat you can use:</p>
<p><code>$ cat -n someFile.txt | grep -w 500</code></p>
<p>This would print out the 500th line.</p>
<h3>Command Breakdown</h3>
<p>&nbsp;<br />
<strong>cat</strong> - this command will concatenate (print) text.<br />
<strong>-n</strong> - the &#8216;n&#8217; switch tells cat to add line numbers.<br />
<strong>|</strong> - the | or AKA pipe will take the results from &#8216;cat -n&#8217; and pipe them to grep<br />
<strong>grep</strong> - this is a text search program.  This will look for certain strings<br />
<strong>-w</strong> - the w command tells grep to only match whole words<br />
<strong>500</strong> - this is the &#8220;word&#8221; we are looking for.</p>
<h3>Adding Line Numbers to Vim</h3>
<p>&nbsp;<br />
Open the file with Vim:</p>
<p><code>$ vim someFile.txt</code></p>
<p>Then add the show line numbers option by typing the following:</p>
<p><code>:set number</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/linux/numbering-each-line-in-a-text-file/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekend Link Roundup: Week 5</title>
		<link>http://www.marksanborn.net/links/weekend-link-roundup-week-5/</link>
		<comments>http://www.marksanborn.net/links/weekend-link-roundup-week-5/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 15:00:57 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=144</guid>
		<description><![CDATA[BSDTalk - A cool podcast that discusses FreeBSD.  They interview many FreeBSD developers and have some interesting discussion.
The 7 Habits of Highly Effective Linux Users - An interesting article with 7 great tips for beginners learning Linux.  Although the advice the author gives is very basic and common knowledge, he explains his advice [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bsdtalk.blogspot.com/">BSDTalk</a> - A cool podcast that discusses FreeBSD.  They interview many FreeBSD developers and have some interesting discussion.</p>
<p><a href="http://hehe2.net/linux-general/the-7-habits-of-highly-effective-linux-users/">The 7 Habits of Highly Effective Linux Users</a> - An interesting article with 7 great tips for beginners learning Linux.  Although the advice the author gives is very basic and common knowledge, he explains his advice very well.  I think Linux beginners would get a lot of value out of reading this.<span id="more-144"></span></p>
<p><a href="http://taosecurity.blogspot.com/">TaoSecurity</a> - This is a cool blog I found that discusses various security topics.</p>
<p><img src="http://www.marksanborn.net/wp-content/uploads/2008/04/lighttpd.gif" style="float:right; margin: 0px, 0px, 4px, 8px;" /><a href="http://www.lighttpd.net/">Lighttpd</a> - Although I have yet to try this web server it looks very promising.  It is supposed to be a lot lighter weight and faster than apache.  I might use this on my test server.</p>
<p><a href="http://davidwalsh.name/">David Walsh Blog</a> - If you are into web development with PHP and starting to implement AJAX this site is great.  It is updated daily with lots of neat tips and how tos.</p>
<p><a href="http://www.sandboxie.com/">Sandboxie</a> - If you haven&#8217;t tried this program yet you should.  It is a program that runs in windows that allows you to open programs in a &#8220;sandbox&#8221; or a virtual environment that does not have access to your hard drive.  In other words you could open a virus with this program.  After you close the sandbox the virus is like it was never there.  This is useful if you want to try demo programs without the risk.</p>
<p><a href="http://www.chkrootkit.org/">chkrootkit</a> - This is program is pretty much essential if you are looking for root kits.</p>
<p><a href="http://www.subnet mask.info/">Network Calculators</a> - If you are setting up a new router or firewall rules and you forget the binary structure of an IP address this site will help you calculate subnet masks and how many nodes are available in the network.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/links/weekend-link-roundup-week-5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Finding Ports to Install in FreeBSD</title>
		<link>http://www.marksanborn.net/freebsd/finding-ports-to-install-in-freebsd/</link>
		<comments>http://www.marksanborn.net/freebsd/finding-ports-to-install-in-freebsd/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 15:00:12 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Ports]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=148</guid>
		<description><![CDATA[FreeBSD is founded on the idea that compiling is faster/better than using pre-made packages.  To make compiling easy FreeBSD uses a &#8220;package management&#8221; system called ports; however, it is difficult to find the port to compile since FreeBSD&#8217;s package management system is really just empty directories with build instructions.  These directories are categorized [...]]]></description>
			<content:encoded><![CDATA[<p>FreeBSD is founded on the idea that compiling is faster/better than using pre-made packages.  To make compiling easy FreeBSD uses a &#8220;package management&#8221; system called ports; however, it is difficult to find the port to compile since FreeBSD&#8217;s package management system is really just empty directories with build instructions.  These directories are categorized by the package application so that you can browse them, but it is difficult sometimes to find a package.<span id="more-148"></span></p>
<p>One way to find ports is by using the echo command and some wild cards.  This is my favorite method.  For example if we were looking to install the Apache web server we could use this command:</p>
<p><code># echo /usr/ports/*/*apache*</code></p>
<p>If you are feeling lucky you can even use the change directory command to go right into the port&#8217;s directory.</p>
<p><code># cd /usr/ports/*/*portupgrade*</code></p>
<p>An alternative way to find ports would be to use ports built in search feature.</p>
<p><code># cd /usr/ports<br />
# make search name=apache</code></p>
<p>You could also visit <a href="http://www.freebsd.org/ports/">FreeBSD&#8217;s online ports search</a>.</p>
<p>To stay updated with new ports you can check out <a href="http://www.freebsd.org/ports/">FreshPorts</a>.  FreshPorts offers a service that will email you anytime there is a new version or change to a specific port.  This is really helpful if you are running a production server that has a mission critical port on it, like an Apache web server.</p>
<p>Using one of these methods you are sure to find what you are looking for.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/freebsd/finding-ports-to-install-in-freebsd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First Time Upgrading FreeBSD</title>
		<link>http://www.marksanborn.net/freebsd/first-time-upgrading-freebsd/</link>
		<comments>http://www.marksanborn.net/freebsd/first-time-upgrading-freebsd/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 18:02:19 +0000</pubDate>
		<dc:creator>Mark Sanborn</dc:creator>
		
		<category><![CDATA[FreeBSD]]></category>

		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://www.marksanborn.net/?p=143</guid>
		<description><![CDATA[If you remember from my post on my Initial Impression of FreeBSD 7.0 I am fairly new at using FreeBSD.  After my recent Wordpress SQL Injection Attack I went around updating everything that I could get my hands on.  A FreeBSD server happened to be one of those things that need updating.
Fortunately FreeBSD [...]]]></description>
			<content:encoded><![CDATA[<p>If you remember from my post on my <a href="http://www.marksanborn.net/freebsd/initial-impression-of-freebsd-70/">Initial Impression of FreeBSD 7.0</a> I am fairly new at using FreeBSD.  After my recent <a href="http://www.marksanborn.net/security/sql-injection-attack-and-updating-wordpress/">Wordpress SQL Injection Attack</a> I went around updating everything that I could get my hands on.  A FreeBSD server happened to be one of those things that need updating.<span id="more-143"></span></p>
<p>Fortunately FreeBSD has a great utility to keep everything updated.  It&#8217;s called portupgrade.  If you don&#8217;t already have it installed you can install it through ports.</p>
<p><code># /usr/ports/ports-mgmt/portupgrade</code></p>
<p>Now before you start the portupgrade process lets find out what ports actually need updating.  This way if we find any programs that we would rather have the old version we exclude it.  Another reason we want to know which programs need updating is to find applications that may require special updating instructions.</p>
<p>To find the programs that are out of date run:</p>
<p><code># pkg_version -v</code></p>
<p>This is also a good time to watch the list and find packages that you may no longer need.</p>
<p>To update all ports use:</p>
<p><code># portupgrade -a</code></p>
<p>If you want portupgrade to ask you each time before updating you can use <strong>interactive mode</strong>.</p>
<p><code># portupgrade -ai</code></p>
<p>Maybe you ran a portaudit and only one of the programs needs a security upgrade and you just want to upgrade that one for now.</p>
<p><code># portupgrade -R firefox</code></p>
<p>That is about all there is to updating your entire FreeBSD system.  I sure wish I could update every program in Windows with one simple command.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marksanborn.net/freebsd/first-time-upgrading-freebsd/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.600 seconds -->
