<?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>Smakynet</title>
	<atom:link href="http://www.smakynet.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smakynet.com</link>
	<description>A view of the web</description>
	<lastBuildDate>Tue, 25 Oct 2011 15:58:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>FreeBSD:  Using the Ports Collection</title>
		<link>http://www.smakynet.com/2011/10/freebsd-using-the-ports-collection/</link>
		<comments>http://www.smakynet.com/2011/10/freebsd-using-the-ports-collection/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 03:27:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.smakynet.com/?p=13</guid>
		<description><![CDATA[One of the most useful and unique features of FreeBSD compared to most Linux distros is the Ports Collection. It can be found under /usr/ports and contains the Makefiles for a vast amount of software. Getting the ports collection If you did not choose to install the ports collection during the FreeBSD installation then you [...]]]></description>
			<content:encoded><![CDATA[<h1></h1>
<p>One of the most useful and unique features of FreeBSD compared to most Linux distros is the Ports Collection. It can be found under /usr/ports and contains the Makefiles for a vast amount of software.</p>
<h2>Getting the ports collection</h2>
<p>If you did not choose to install the ports collection during the FreeBSD installation then you will need to get it through Cvsup.</p>
<p>The ports collection can also be accessed by ftp using</p>
<blockquote><p># /stand/sysinstall</p></blockquote>
<p>Once you are in the FreeBSD configuration tool go to Configure and then Packages. Here you will want to choose FTP. Select the packages you wish to install and go to Install at the end and FreeBSD will use the pkg_add tool on each one to quickly add it.</p>
<h2>Finding a Port</h2>
<p>With so many ports it can be hard to find the one you are looking for. The easiest way to find a port is to use the ports directory on the <a href="http://www.freebsd.org/ports/">FreeBSD website</a>.</p>
<p>To search locally on your machine you can use the locate command if you know a word in the name of the package</p>
<blockquote><p># locate ‹package› | grep distinfo</p></blockquote>
<p>The &#8220;grep distinfo&#8221; filters out other files in the port directory so each port that comes up is only shown once.</p>
<h2>Files in the port directories</h2>
<p>&nbsp;</p>
<div>Makefile</div>
<p>- This is the main file that tells where the files for the port are located and the options to build with. If you wish to install the port with certain options it is a good idea to look through this file and see what is available.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div>distinfo</div>
<p>- Gives the version number of the package</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div>pkg-message</div>
<p>- This is displayed after the port is installed giving information on how to finish setting it up, or security warnings. If you get the port installed and can&#8217;t figure out how to start it, or where the config files are you should look back at the message.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div>pkg-plist</div>
<p>- A list of files in the package.</p>
<p>&nbsp;</p>
<h2>Installing a port</h2>
<p>To install a port change to its directory and do a &#8220;make install&#8221;. For example, if we were to install the dns server bind9 it would look like this</p>
<blockquote><p># cd /usr/ports/dns/bind9<br />
# make install</p></blockquote>
<p>To delete the tar file that was downloaded to install bind9 once the install was complete simply append the command &#8220;distclean&#8221; after install like this</p>
<blockquote><p># cd /usr/ports/dns/bind9<br />
# make install distclean</p></blockquote>
<p>To clean out compiled files from the make use &#8220;make clean&#8221; in the port&#8217;s directory</p>
<blockquote><p># make clean</p></blockquote>
<p>If you wished to uninstall bind9 you could do so with the following</p>
<blockquote><p># cd /usr/ports/dns/bind9<br />
# make deinstall</p></blockquote>
<p>Many ports give a menu during the install asking you to choose certain options. If you wish to skip these menus &#8220;all&#8221; may be appended after &#8220;make install&#8221; to install the port more forcefully</p>
<blockquote><p># make install all</p></blockquote>
<h2>Removing a saved configuration</h2>
<p>Ports that give a menu with installation options after starting the make save your choices and this saved config needs to be manually removed if you want to rebuild the port later and want different options. To delete a saved config go to port&#8217;s directory and run</p>
<blockquote><p># make rmconfig</p></blockquote>
<h2>Viewing installed packages and removing them</h2>
<p>A list of all installed packages on the machine can be viewed with &#8220;pkg_info&#8221;</p>
<blockquote><p># pkg_info<br />
autoconf-2.53_3<br />
autoconf-2.59_2<br />
automake-1.5_2,1</p></blockquote>
<p>Deleting a package can be done with &#8220;pkg_delete&#8221;</p>
<blockquote><p># pkg_delete -f autoconf-2.53_3</p></blockquote>
<p>The -f flag forces the package to be deinstalled even if other packages depend on it.</p>
<h2>Cleaning up the ports</h2>
<p>FreeBSD saves all files downloaded to install the ports to /usr/ports/distfiles</p>
<blockquote><p># rm -r /usr/ports/distfiles/*</p></blockquote>
<p>Removes all of these files, but not the files created during the build. To get rid of these you must run</p>
<blockquote><p># portsclean -CD</p></blockquote>
<p>The -CD flags will remove all files in the work directories within the ports tree and any unreferenced distfiles.</p>
<h2>Upgrading a port</h2>
<p>A port can be upgraded with the port /usr/ports/sysutils/portupgrade</p>
<blockquote><p># portupgrade autoconf-X.XX</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smakynet.com/2011/10/freebsd-using-the-ports-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to tar/untar</title>
		<link>http://www.smakynet.com/2011/10/how-to-taruntar/</link>
		<comments>http://www.smakynet.com/2011/10/how-to-taruntar/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 03:20:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Archive]]></category>

		<guid isPermaLink="false">http://www.smakynet.com/?p=8</guid>
		<description><![CDATA[tar is used to create a Tape ARchive. The resulting file is known as a tarball. It's pretty much the same concept as a ZIP file, if you know what they are, but without the compression. To get the files out of a tarball, you can use the following commands: tar xvf something.tar If the [...]]]></description>
			<content:encoded><![CDATA[<pre>tar is used to create a Tape ARchive.  The resulting file is known as a tarball.  It's pretty much the same concept as a ZIP file, if you know what they are, but without the compression.  To get the files out of a tarball, you can use the following commands:

   <strong> tar xvf something.tar </strong>
If the tarball has also been gzipped (compressed), you can use the following command:

  <strong> tar xvfz something.tar.gz</strong>

If you only want certain directories from the tarball, do this:

 <strong> tar xvzf something.tar.gz */dir.you.want/*</strong>

If you have a .tar.bz2 file, then you need bzip2 installed (/usr/ports/archivers/bzip2), and you issue this command:

<strong> tar yxf something.tar.bz2 </strong>
To tar up *.db in the current directory into a tarball called blah.tar.gz, issue this command:

    <strong>tar cfz blah.tar.gz *.db</strong>

The z option compresses.
listing the contents
To see a list of the files within a tarball, issue the following command:

   <strong> tar -tzf blah.tar.gz</strong>

The -t provides a list.  the -z indicates that the tarball is compressed.   The -f identifies the tarball.

<strong>Here's an example: </strong>
    # tar -tzf makeworld.991126.tgz
    etc/
    etc/protocols
    etc/aliases
    etc/services
    etc/hosts</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.smakynet.com/2011/10/how-to-taruntar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

