<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>IONCANNON</title>
	
	<link>http://www.ioncannon.net</link>
	<description>What are you building?</description>
	<pubDate>Mon, 07 Jul 2008 12:41:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/ioncannon" type="application/rss+xml" /><item>
		<title>FreeRADIUS with Oracle</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/328847819/</link>
		<comments>http://www.ioncannon.net/system-administration/136/freeradius-with-oracle/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 12:41:51 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/?p=136</guid>
		<description>I recently needed to find a RADIUS server for use in a project where I could stick profile data into Oracle. I remembered seeing FreeRADIUS a while back so I checked to see if it was active and supported Oracle. Sure enough it did. It was a little tricky to set up because some of [...]</description>
			<content:encoded><![CDATA[<p>I recently needed to find a RADIUS server for use in a project where I could stick profile data into Oracle. I remembered seeing <a href="http://freeradius.org/" onclick="javascript:urchinTracker ('/outbound/article/freeradius.org');">FreeRADIUS</a> a while back so I checked to see if it was active and supported Oracle. Sure enough it did. It was a little tricky to set up because some of the documentation is out of sync with the latest version so here is what you need to know to get it working.</p>
<p><span id="more-136"></span></p>
<p>I&#039;m using FreeRADIUS version 2.0.3 so some of these issues may be fixed down the road. The first thing you should do is compile FreeRADIUS and get it working using the normal users file. After you have done that and successfully tested queries to the server you can recompile to build Oracle in. </p>
<p>I used the <a href="http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html" onclick="javascript:urchinTracker ('/outbound/article/www.oracle.com');">Oracle Instant client</a> again. I&#039;ve used the Oracle instant client a number of times now and I can&#039;t believe it took them so long to release their SDK in this type of paired down package.</p>
<p>This should be all you need to add to the configure command to enable the Oracle driver:</p>
<div class="codesnip-container" >
<div class="codesnip">./configure --with-oracle-home-dir=&lt;path to oracle instant client&gt;</div>
</div>
<p>However that didn&#039;t work for me. Instead I had to go into the RLM Oracle driver directory and run the configure command from there:</p>
<div class="codesnip-container" >
<div class="codesnip">cd freeradius-server-<span class="nu0">2</span>.<span class="nu0">0</span>.<span class="nu0">3</span>/src/modules/rlm_sql/drivers/rlm_sql_oracle<br />
ORACLE_HOME=&lt;path to oracle instant client&gt; CFLAGS=-I&lt;path to oracle instant client&gt;/sdk/include/ LDFLAGS=-L&lt;path to oracle instant client&gt; ./configure</div>
</div>
<p>This created the Makefile but then that still wasn&#039;t correct. I had to modify the includes and libraries so they matched the correct location:</p>
<div class="codesnip-container" >
<div class="codesnip">RLM_SQL_CFLAGS =&nbsp; &nbsp; $<span class="br0">&#40;</span>INCLTDL<span class="br0">&#41;</span> -I&lt;path to oracle instant client&gt;/sdk/include/<br />
RLM_SQL_LIBS&nbsp; &nbsp;=&nbsp; -L&lt;path to oracle instant client&gt; -lclntsh -lm</div>
</div>
<p>After making these changes I could then do a make and make install. You can verify that the module is installed by looking for the module file named rlm_sql_oracle.a in your lib directory (in my case /usr/local/lib/). After you have verified that the module is compiled and in place you are ready to move on to the configuration.</p>
<p>The first thing to do is load the provided Oracle schema. That schema can be found in: freeradius-server-2.0.3/raddb/sql/oracle</p>
<p>Next read over the <a href="http://wiki.freeradius.org/Rlm_sql" onclick="javascript:urchinTracker ('/outbound/article/wiki.freeradius.org');">RLM SQL configuration</a> information to get a general idea of what is going on in the configuration files and how FreeRADIUS uses the queries to find the correct information for a given request. </p>
<p>The following steps are needed to configure the Oracle access and have FreeRADIUS use that configuration for data (I assume that you have installed with a base of /usr/local):</p>
<ol>
<li>Edit /usr/local/etc/raddb/sql.conf set database = &#034;oracle&#034;, set the server, login, password, and radius_db values. The following is an example of the connection information needed:
<div class="codesnip-container" >
<div class="codesnip"># Connection info:<br />
server = &quot;<span class="nu0">127</span>.<span class="nu0">0</span>.<span class="nu0">0</span>.<span class="nu0">1</span>&quot;<br />
login = &quot;username&quot;<br />
password = &quot;password&quot;</p>
<p># Database table configuration for everything except Oracle<br />
#radius_db = &quot;radius&quot;<br />
# If you are using Oracle then use this instead<br />
radius_db = &quot;<span class="br0">&#40;</span>DESCRIPTION=<span class="br0">&#40;</span>ADDRESS=<span class="br0">&#40;</span>PROTOCOL=TCP<span class="br0">&#41;</span><span class="br0">&#40;</span>HOST=<span class="nu0">127</span>.<span class="nu0">0</span>.<span class="nu0">0</span>.<span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#40;</span>PORT=<span class="nu0">1521</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#40;</span>CONNECT_DATA=<span class="br0">&#40;</span>SID=MYDB01<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>&quot;</div>
</div>
</li>
<li>Search for the following and uncomment the SQL load line in the file /usr/local/etc/raddb/sites-enabled/default as follows:
<div class="codesnip-container" >
<div class="codesnip"># See &quot;Authorization Queries&quot; in sql.conf<br />
&nbsp; sql</div>
</div>
<p>Note: This is something that I didn&#039;t find in the documentation. I believe that is due to the documentation being for an older version and this being a new requirement.</p>
<li>Load sample data into the database:
<div class="codesnip-container" >
<div class="codesnip"><span class="kw1">INSERT</span> <span class="kw1">INTO</span> radusergroup <span class="kw1">VALUES</span><span class="br0">&#40;</span>radusergroup_seq.<span class="kw1">NEXTVAL</span>, <span class="st0">&#039;dynamic&#039;</span>, <span class="st0">&#039;fredf&#039;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">INSERT</span> <span class="kw1">INTO</span> radcheck <span class="kw1">VALUES</span><span class="br0">&#40;</span>radcheck_seq.<span class="kw1">NEXTVAL</span>, <span class="st0">&#039;fredf&#039;</span>, <span class="st0">&#039;Cleartext-Password&#039;</span>, <span class="st0">&#039;:=&#039;</span>, <span class="st0">&#039;wilma&#039;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">INSERT</span> <span class="kw1">INTO</span> radreply <span class="kw1">VALUES</span><span class="br0">&#40;</span>radreply_seq.<span class="kw1">NEXTVAL</span>, <span class="st0">&#039;fredf&#039;</span>, <span class="st0">&#039;Framed-IP-Address&#039;</span>, <span class="st0">&#039;:=&#039;</span>, <span class="st0">&#039;1.2.3.4&#039;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">INSERT</span> <span class="kw1">INTO</span> radgroupreply <span class="kw1">VALUES</span><span class="br0">&#40;</span>radgroupreply_seq.<span class="kw1">NEXTVAL</span>, <span class="st0">&#039;dynamic&#039;</span>, <span class="st0">&#039;Framed-Compression&#039;</span>, <span class="st0">&#039;:=&#039;</span>, <span class="st0">&#039;Van-Jacobsen-TCP-IP&#039;</span><span class="br0">&#41;</span>;</div>
</div>
</li>
<li>Start the daemon in debug mode:
<div class="codesnip-container" >
<div class="codesnip">radius -X</div>
</div>
<p>If you don&#039;t have the oracle libraries in your path you will need to start radius with the correct LD path entry like this:</p>
<div class="codesnip-container" >
<div class="codesnip">LD_LIBRARY_PATH=&lt;path to oracle instant client&gt; radiusd -X</div>
</div>
<li>Send a test query:
<div class="codesnip-container" >
<div class="codesnip">radtest fredf wilma localhost <span class="nu0">0</span> radpassword</div>
</div>
<p>On the console for radius -X you will see debug and you should receive a valid response from the test that looks like this:</p>
<div class="codesnip-container" >
<div class="codesnip">User-Name = &quot;fredf&quot;<br />
User-Password = &quot;wilma&quot;<br />
NAS-IP-Address = <span class="nu0">127</span>.<span class="nu0">0</span>.<span class="nu0">0</span>.<span class="nu0">1</span><br />
NAS-Port = <span class="nu0">0</span><br />
Framed-IP-Address = <span class="nu0">1</span>.<span class="nu0">2</span>.<span class="nu0">3</span>.<span class="nu0">4</span></div>
</div>
</li>
<p>At this point you are ready to load your data into FreeRADIUS via Oracle.</p>
<p>Other Notes:</p>
<p>Depending on how large your configuration values are the provided schema may not give you enough room to store everything. You may need to alter the tables to increase the space available for values like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw1">ALTER</span> <span class="kw1">TABLE</span> radreply <span class="kw1">MODIFY</span> value varchar<span class="br0">&#40;</span><span class="nu0">128</span><span class="br0">&#41;</span>;</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=L6XuTJ"><img src="http://feeds.feedburner.com/~f/ioncannon?i=L6XuTJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=K9CwrJ"><img src="http://feeds.feedburner.com/~f/ioncannon?i=K9CwrJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/328847819" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/system-administration/136/freeradius-with-oracle/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/system-administration/136/freeradius-with-oracle/</feedburner:origLink></item>
		<item>
		<title>Spiffing up JFreeChart charts</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/314783950/</link>
		<comments>http://www.ioncannon.net/java/139/spiffing-up-jfreechart-charts/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 17:52:36 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/?p=139</guid>
		<description>I recently was given a copy of ChartFX for Java to evaluate as a charting solution for a Java project. After using it for a while it seemed nice despite having some odd ways of doing things that I think come from it originally being a C# and VB product. After playing with it for [...]</description>
			<content:encoded><![CDATA[<p>I recently was given a copy of <a href="http://www.softwarefx.com/SFXJavaProducts/CFXforJava/" onclick="javascript:urchinTracker ('/outbound/article/www.softwarefx.com');">ChartFX for Java</a> to evaluate as a charting solution for a Java project. After using it for a while it seemed nice despite having some odd ways of doing things that I think come from it originally being a C# and VB product. After playing with it for a while I decided to see if I could get <a href="http://www.jfree.org/jfreechart/" onclick="javascript:urchinTracker ('/outbound/article/www.jfree.org');">JFreeChart</a> charts to look the same way. As it turns out it wasn&#039;t that hard.</p>
<p><span id="more-139"></span></p>
<p>There isn&#039;t much difference between the charts but the one that stands out the most is that the ChartFX charts have a fancy border. This also happens to be something that JFreeChart can&#039;t do out of the box with all the other changes that need to be made are just settings that can be done in JFreeChart. So here is how I went about fixing it so that a JFreeChart has the fancy background.</p>
<p>The first thing you need is to be able to generate the chart as an image using JFreeChart.createBufferedImage. This will give you back a BufferedImage that you can then merge with the background you create.</p>
<p>The next thing you need is the background. In this case it is made with rounded edges, a gradient, and a drop shadow. The rounded edges and gradient are easy enough to make since they are just normal Java2D options (see the following code example for details). The real trick is the drop shadow. For that I looked around and found the following two articles: <a href="http://www.curious-creature.org/2005/07/07/fast-or-good-drop-shadows/" onclick="javascript:urchinTracker ('/outbound/article/www.curious-creature.org');">fast or good drop shadows</a> and <a href="http://www.curious-creature.org/2005/07/06/non-rectangular-shadow/" onclick="javascript:urchinTracker ('/outbound/article/www.curious-creature.org');">non-rectangular drop shadows</a>. These weren&#039;t exactly what I needed because I already know the shape of the object every time but they gave me what I needed to create the shadow easily. </p>
<p>To generate the drop shadow I first draw the rounded edged rectangle with a gradient fill. Then I use the a convolve operation described in the above articles to add a nice fuzzy blur. The last thing I do is offset the blurred image a little and then overlay the original on top of it.</p>
<p>Here is all the code to create an example:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">public</span> <span class="kw2">static</span> <a href="http://www.google.com/search?q=allinurl%3AConvolveOp+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ConvolveOp</span></a> getLinearBlurOp<span class="br0">&#40;</span><span class="kw4">int</span> width, <span class="kw4">int</span> height<span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw4">float</span><span class="br0">&#91;</span><span class="br0">&#93;</span> data = <span class="kw2">new</span> <span class="kw4">float</span><span class="br0">&#91;</span>width * height<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="kw4">float</span> value = <span class="nu0">1</span>.0f / <span class="br0">&#40;</span><span class="kw4">float</span><span class="br0">&#41;</span> <span class="br0">&#40;</span>width * height<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i = <span class="nu0">0</span>; i &lt; data.<span class="me1">length</span>; i++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; data<span class="br0">&#91;</span>i<span class="br0">&#93;</span> = value;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AConvolveOp+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ConvolveOp</span></a><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AKernel+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Kernel</span></a><span class="br0">&#40;</span>width, height, data<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; <span class="kw2">public</span> <span class="kw2">static</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> buildChartDropShadow<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> chartImage, <span class="kw4">int</span> padding<span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw2">return</span> buildChartDropShadow<span class="br0">&#40;</span>chartImage, padding, <span class="kw2">null</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; <span class="kw2">public</span> <span class="kw2">static</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> buildChartDropShadow<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> chartImage, <span class="kw4">int</span> padding, <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a> backgroundColor<span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> shadow = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a><span class="br0">&#40;</span>chartImage.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span>, chartImage.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span>, <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a>.<span class="me1">TYPE_INT_ARGB</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AGraphics2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Graphics2D</span></a> shadowCanvas = <span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AGraphics2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Graphics2D</span></a><span class="br0">&#41;</span> shadow.<span class="me1">getGraphics</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; shadowCanvas.<span class="me1">setRenderingHint</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ARenderingHints+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">RenderingHints</span></a>.<span class="me1">KEY_ANTIALIASING</span>, <a href="http://www.google.com/search?q=allinurl%3ARenderingHints+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">RenderingHints</span></a>.<span class="me1">VALUE_ANTIALIAS_ON</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; shadowCanvas.<span class="me1">setColor</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a>.<span class="me1">white</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; shadowCanvas.<span class="me1">fillRect</span><span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, chartImage.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span>, chartImage.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; shadowCanvas.<span class="me1">setPaint</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a>.<span class="me1">black</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; shadowCanvas.<span class="me1">fillRoundRect</span><span class="br0">&#40;</span>padding, padding, chartImage.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, chartImage.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="nu0">20</span>, <span class="nu0">20</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; shadowCanvas.<span class="me1">dispose</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> finalImage = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a><span class="br0">&#40;</span>chartImage.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span>, chartImage.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span>, <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a>.<span class="me1">TYPE_INT_ARGB</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AGraphics2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Graphics2D</span></a> finalCanvas = <span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AGraphics2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Graphics2D</span></a><span class="br0">&#41;</span> finalImage.<span class="me1">getGraphics</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; finalCanvas.<span class="me1">setRenderingHint</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ARenderingHints+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">RenderingHints</span></a>.<span class="me1">KEY_ANTIALIASING</span>, <a href="http://www.google.com/search?q=allinurl%3ARenderingHints+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">RenderingHints</span></a>.<span class="me1">VALUE_ANTIALIAS_ON</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; finalCanvas.<span class="me1">setColor</span><span class="br0">&#40;</span>backgroundColor == <span class="kw2">null</span> ? <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a>.<span class="me1">white</span> :&nbsp; backgroundColor<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; finalCanvas.<span class="me1">fillRect</span><span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, chartImage.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span>, chartImage.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; finalCanvas.<span class="me1">drawImage</span><span class="br0">&#40;</span>shadow, getLinearBlurOp<span class="br0">&#40;</span><span class="nu0">10</span>, <span class="nu0">10</span><span class="br0">&#41;</span>, <span class="nu0">2</span>, <span class="nu0">2</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; finalCanvas.<span class="me1">setPaint</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AGradientPaint+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">GradientPaint</span></a><span class="br0">&#40;</span><span class="nu0">0</span>.0f, <span class="nu0">0</span>.0f, <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a><span class="br0">&#40;</span>0xdc, 0xe5, 0xf4<span class="br0">&#41;</span>, <span class="nu0">0</span>.0f, chartImage.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span> * <span class="nu0">0</span>.2f, <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a><span class="br0">&#40;</span>0xff, 0xff, 0xff<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; finalCanvas.<span class="me1">fillRoundRect</span><span class="br0">&#40;</span>padding, padding, chartImage.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, chartImage.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="nu0">20</span>, <span class="nu0">20</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; finalCanvas.<span class="me1">drawImage</span><span class="br0">&#40;</span>chartImage, <span class="kw2">null</span>, padding, padding<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; finalCanvas.<span class="me1">dispose</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw2">return</span> finalImage;<br />
&nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp;* Testing area<br />
&nbsp; &nbsp;*<br />
&nbsp; &nbsp;* @param args<br />
&nbsp; &nbsp;* @throws Exception<br />
&nbsp; &nbsp;*/</span><br />
&nbsp; <span class="kw2">public</span> <span class="kw2">static</span> <span class="kw4">void</span> main<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">String</span></a><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Exception</span></a><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; DefaultCategoryDataset dataset = <span class="kw2">new</span> DefaultCategoryDataset<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; JFreeChart jFreeChart = ChartFactory.<span class="me1">createBarChart</span><span class="br0">&#40;</span><span class="kw2">null</span>, <span class="kw2">null</span>, <span class="st0">&#034;Test&#034;</span>, dataset, PlotOrientation.<span class="me1">VERTICAL</span>, <span class="kw2">true</span>, <span class="kw2">false</span>, <span class="kw2">false</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; jFreeChart.<span class="me1">setBackgroundPaint</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a><span class="br0">&#40;</span><span class="nu0">255</span>,<span class="nu0">255</span>,<span class="nu0">255</span>,<span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; jFreeChart.<span class="me1">setPadding</span><span class="br0">&#40;</span><span class="kw2">new</span> RectangleInsets<span class="br0">&#40;</span><span class="nu0">10</span>, <span class="nu0">5</span>, <span class="nu0">5</span>, <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; CategoryPlot plot = <span class="br0">&#40;</span>CategoryPlot<span class="br0">&#41;</span> jFreeChart.<span class="me1">getPlot</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; BarRenderer renderer = <span class="br0">&#40;</span>BarRenderer<span class="br0">&#41;</span> plot.<span class="me1">getRenderer</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; renderer.<span class="me1">setDrawBarOutline</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; renderer.<span class="me1">setSeriesPaint</span><span class="br0">&#40;</span><span class="nu0">0</span>, <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a><span class="br0">&#40;</span>0&#215;25, 0&#215;64, 0xc1<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; renderer.<span class="me1">setSeriesPaint</span><span class="br0">&#40;</span><span class="nu0">1</span>, <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a><span class="br0">&#40;</span>0xc7, 0&#215;38, 0&#215;00<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; renderer.<span class="me1">setSeriesPaint</span><span class="br0">&#40;</span><span class="nu0">2</span>, <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a><span class="br0">&#40;</span>0&#215;46, 0xb1, 0xc2<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; renderer.<span class="me1">setSeriesPaint</span><span class="br0">&#40;</span><span class="nu0">3</span>, <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a><span class="br0">&#40;</span>0&#215;76, 0xc8, 0&#215;2d<span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; NumberAxis numberaxis = <span class="br0">&#40;</span>NumberAxis<span class="br0">&#41;</span>plot.<span class="me1">getRangeAxis</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ADecimalFormat+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">DecimalFormat</span></a> currencyFormat = <span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ADecimalFormat+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">DecimalFormat</span></a><span class="br0">&#41;</span> <a href="http://www.google.com/search?q=allinurl%3ANumberFormat+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">NumberFormat</span></a>.<span class="me1">getCurrencyInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; currencyFormat.<span class="me1">setMaximumFractionDigits</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; numberaxis.<span class="me1">setNumberFormatOverride</span><span class="br0">&#40;</span>currencyFormat<span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; jFreeChart.<span class="me1">getLegend</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setHorizontalAlignment</span><span class="br0">&#40;</span>HorizontalAlignment.<span class="me1">LEFT</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; jFreeChart.<span class="me1">getLegend</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setPosition</span><span class="br0">&#40;</span>RectangleEdge.<span class="me1">RIGHT</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; jFreeChart.<span class="me1">getLegend</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setBorder</span><span class="br0">&#40;</span><span class="nu0">0</span>.<span class="nu0">0</span>, <span class="nu0">0</span>.<span class="nu0">0</span>, <span class="nu0">0</span>.<span class="nu0">0</span>, <span class="nu0">0</span>.<span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; jFreeChart.<span class="me1">getLegend</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setBackgroundPaint</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a><span class="br0">&#40;</span><span class="nu0">255</span>,<span class="nu0">255</span>,<span class="nu0">255</span>,<span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; dataset.<span class="me1">addValue</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABigDecimal+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BigDecimal</span></a><span class="br0">&#40;</span><span class="nu0">10</span>.<span class="nu0">0</span><span class="br0">&#41;</span>, <span class="st0">&#034;Value1&#034;</span>, <span class="st0">&#034;Sample&#034;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; dataset.<span class="me1">addValue</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABigDecimal+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BigDecimal</span></a><span class="br0">&#40;</span><span class="nu0">13</span>.<span class="nu0">0</span><span class="br0">&#41;</span>, <span class="st0">&#034;Value2&#034;</span>, <span class="st0">&#034;Sample&#034;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; dataset.<span class="me1">addValue</span><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABigDecimal+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BigDecimal</span></a><span class="br0">&#40;</span><span class="nu0">18</span>.<span class="nu0">0</span><span class="br0">&#41;</span>, <span class="st0">&#034;Value3&#034;</span>, <span class="st0">&#034;Sample&#034;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw2">try</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw4">int</span> padding = <span class="nu0">10</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw4">int</span> width = <span class="nu0">500</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw4">int</span> height = <span class="nu0">300</span>;<br />
&nbsp; &nbsp; &nbsp; ImageIO.<span class="me1">write</span><span class="br0">&#40;</span>GraphicsUtil.<span class="me1">buildChartDropShadow</span><span class="br0">&#40;</span>jFreeChart.<span class="me1">createBufferedImage</span><span class="br0">&#40;</span>width-<span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span>, height-<span class="br0">&#40;</span>padding*<span class="nu0">2</span><span class="br0">&#41;</span><span class="br0">&#41;</span>, padding<span class="br0">&#41;</span>, <span class="st0">&#034;png&#034;</span>, <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AFileOutputStream+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">FileOutputStream</span></a><span class="br0">&#40;</span><span class="st0">&#034;/tmp/test.png&#034;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw2">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a> e<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">throw</span> <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ASystemException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">SystemException</span></a><span class="br0">&#40;</span>e.<span class="me1">getMessage</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, e<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>Here are the resulting graph differences. As you can see there aren&#039;t many and those that are still there could even be removed with a little more work.</p>
<p>ChartFX for Java:<br />
<img src="http://www.ioncannon.net/wp-content/uploads/2008/06/jfxchart.png"/></p>
<p>JFreeChart:<br />
<img src="http://www.ioncannon.net/wp-content/uploads/2008/06/jfreechart.png"/></p>
<p>Tags: <a href="http://technorati.com/tag/jfreechart" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">jfreechart</a>, <a href="http://technorati.com/tag/chart" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> chart</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=18AqDI"><img src="http://feeds.feedburner.com/~f/ioncannon?i=18AqDI" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=QSPg9I"><img src="http://feeds.feedburner.com/~f/ioncannon?i=QSPg9I" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/314783950" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/java/139/spiffing-up-jfreechart-charts/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/java/139/spiffing-up-jfreechart-charts/</feedburner:origLink></item>
		<item>
		<title>Upgrading from Fedora 8 to Fedora 9 with yum</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/290099338/</link>
		<comments>http://www.ioncannon.net/system-administration/138/upgrading-from-fedora-8-to-fedora-9-with-yum/#comments</comments>
		<pubDate>Wed, 14 May 2008 01:52:51 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/?p=138</guid>
		<description>A new release of Fedora is out again so it is time to check out the upgrade. This time it is the Fedora 9 release. The upgrade from Fedora 8 to Fedora 9 is almost exactly like the upgrade to Fedora 8. Here are the steps you need to do the upgrade from Fedora 8 [...]</description>
			<content:encoded><![CDATA[<p>A new release of Fedora is out again so it is time to check out the upgrade. This time it is the <a href="http://docs.fedoraproject.org/release-notes/" onclick="javascript:urchinTracker ('/outbound/article/docs.fedoraproject.org');">Fedora 9 release</a>. The upgrade from Fedora 8 to Fedora 9 is almost exactly like the <a href="http://www.ioncannon.net/system-administration/133/upgrading-from-fedora-7-to-fedora-8-with-yum/" >upgrade to Fedora 8</a>. Here are the steps you need to do the upgrade from Fedora 8 to Fedora 9:</p>
<p><span id="more-138"></span></p>
<p>As someone points out in the comments there is a new facility to do upgrades that you can install. See the following wiki entry about the <a href="http://fedoraproject.org/wiki/Features/PreUpgrade" onclick="javascript:urchinTracker ('/outbound/article/fedoraproject.org');">PreUpgrade</a>. I tried to use PreUpgrade but it didn&#039;t install the update boot option for some reason but maybe others will have better luck.</p>
<ol>
<li>yum update</li>
<li>yum clean all</li>
<li>I like to repeated update and clean all a second time to make sure everything got updated</li>
<li>Run the following command to update the yum repo on your box:
<div class="codesnip-container" >
<div class="codesnip">rpm -Uhv http://mirror.liberty.edu/pub/fedora/linux/releases/<span class="nu0">9</span>/Fedora/i386/os/Packages/fedora-release-<span class="nu0">9</span>-<span class="nu0">2</span>.noarch.rpm http://mirror.liberty.edu/pub/fedora/linux/releases/<span class="nu0">9</span>/Fedora/i386/os/Packages/fedora-release-notes-<span class="nu0">9</span>.<span class="nu0">0</span>.<span class="nu0">0</span>-<span class="nu0">1</span>.noarch.rpm</div>
</div>
</li>
<li>Next I had to do a &#034;yum clean all&#034; again before it picked up the change</li>
<li>Next do a yum -y update</li>
<li>As in the past, a few packages had to be removed to get the dependencies to work out. In this case I had to remove the beryl-manager, VirtualBox and cups. In the case of cups I noted what got removed so I could re-install it later.</li>
<li>The packages have grown a little and this time I had to wait for 1.4G of packages to download and install. After an hour or so it was ready for a reboot.</li>
<li>After a reboot I had problems getting my NVIDIA driver to load. I ended up having to download the latest beta version of the driver per this forum post: http://www.nvnews.net/vbulletin/showthread.php?t=111460</li>
<li>I recompiled my NVIDIA driver and then added the flag for X suggested in the forum. GDM wouldn&#039;t start because the flag was set there but I can live with that.</li>
<li>Now I have X but I&#039;ve run into a number of issues getting apps to run correctly. For example firefox won&#039;t start without the --sync option. At this point I think it will just be a matter of time before things get worked out, until then I&#039;m just going to wait it out. At least it boots and mostly works.</li>
</ol>
<p>Update: I think I may have found one of the issues with X and that is the fonts changed in Fedora 9. See <a href="http://fedoraproject.org/wiki/Releases/9/ReleaseSummary#head-f96ff8f24487c77aba8e45738bbe2dfb4aa52ac5" onclick="javascript:urchinTracker ('/outbound/article/fedoraproject.org');">Fedora 9 Fonts</a>. I re-added the old fonts and now apps are starting correctly.</p>
<p>Tags: <a href="http://technorati.com/tag/linux" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">linux</a>, <a href="http://technorati.com/tag/fedora" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> fedora</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=qGMEEH"><img src="http://feeds.feedburner.com/~f/ioncannon?i=qGMEEH" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=I2ndwH"><img src="http://feeds.feedburner.com/~f/ioncannon?i=I2ndwH" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/290099338" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/system-administration/138/upgrading-from-fedora-8-to-fedora-9-with-yum/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/system-administration/138/upgrading-from-fedora-8-to-fedora-9-with-yum/</feedburner:origLink></item>
		<item>
		<title>Examples of why netcat is still useful</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/276896609/</link>
		<comments>http://www.ioncannon.net/system-administration/134/netcat-examples/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 13:18:41 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[system administration]]></category>

		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/?p=134</guid>
		<description>I recently got a new work PC and was worried that stuck somewhere in the 40G hard drive of the old PC was something I would one day need. The new PC had 300G of space so I figured I would just copy the entire drive over and keep it forever. This isn&amp;#039;t the most [...]</description>
			<content:encoded><![CDATA[<p>I recently got a new work PC and was worried that stuck somewhere in the 40G hard drive of the old PC was something I would one day need. The new PC had 300G of space so I figured I would just copy the entire drive over and keep it forever. This isn&#039;t the most difficult task in the world and I actually started out using ssh to transfer the image.</p>
<p><span id="more-134"></span></p>
<p>To transfer the drive using ssh I was using the following command from the new PC:</p>
<div class="codesnip-container" >
<div class="codesnip">ssh -c blowfish old-pc-ip <span class="st0">&#034;dd if=/dev/hda&#034;</span> &gt; dd <span class="re2">of=</span>old-pc.hda</div>
</div>
<p>This worked fine but the old PC seemed to be having a hard time keeping up. I did some adjusting to the block size of the transfers using dd but that didn&#039;t seem to help. That is when I decided to give netcat a try.</p>
<p>On the old PC side I ran:</p>
<div class="codesnip-container" >
<div class="codesnip">dd <span class="re2">if=</span>/dev/hda | nc -l <span class="nu0">10001</span></div>
</div>
<p>and on the new PC side I ran:</p>
<div class="codesnip-container" >
<div class="codesnip">nc old-pc-ip <span class="nu0">10001</span> | dd <span class="re2">of=</span>old-pc.hda</div>
</div>
<p>This worked like a charm and transfered the drive about twice as fast as ssh using blowfish encryption.</p>
<p>Just for reference I was using dd here to give myself more control over block sizes, skip any read errors, and at times I was actually trying to just transfer parts of the drive instead of the entire thing using the seek and count options. Another useful trick with dd is that you can find out the current amount transfered and rate by sending it a USR1 signal with kill. After poking around I actually found another nice utility that you can stick in the stream call <a href="http://www.ivarch.com/programs/pv.shtml" onclick="javascript:urchinTracker ('/outbound/article/www.ivarch.com');">pipe viewer</a> that is able to give you a nice display of the count instead of having to send signals to dd.</p>
<p>Another great use for netcat that I ran into recently was setting up a ppp tunnel between two machines. Again at first I started by using ssh:</p>
<div class="codesnip-container" >
<div class="codesnip">pppd updetach noauth passive pty <span class="st0">&#034;ssh remote-host-ip -lroot -o Batchmode=yes pppd nodetach notty noauth&#034;</span> ipparam vpn <span class="nu0">192</span>.<span class="nu0">168</span>.<span class="nu0">77</span>.<span class="nu0">1</span>:<span class="nu0">192</span>.<span class="nu0">168</span>.<span class="nu0">77</span>.<span class="nu0">2</span></div>
</div>
<p>This worked between two machines that were already connected by a network but my real goal was build the tunnel over a device that wouldn&#039;t work with ssh traffic. I turned to netcat again.</p>
<p>On the initiating side I ran this:</p>
<div class="codesnip-container" >
<div class="codesnip">/usr/sbin/pppd connect-delay <span class="nu0">30000</span> updetach noauth passive pty <span class="st0">&#034;echo connect-585 | nc device-ip 2000&#034;</span> ipparam root <span class="nu0">192</span>.<span class="nu0">168</span>.<span class="nu0">77</span>.<span class="nu0">1</span>:<span class="nu0">192</span>.<span class="nu0">168</span>.<span class="nu0">77</span>.<span class="nu0">2</span></div>
</div>
<p>Here I send the traffic to a device in between that forms a connection over a non-network link to the end point machine. I don&#039;t need netcat on the endpoint because the communication channel is not a network. On the end point I run this:</p>
<div class="codesnip-container" >
<div class="codesnip">/usr/sbin/pppd nodetach notty noauth</div>
</div>
<p>In this case netcat saved me from having to write some intermediate code that would communicate with the device and just pipe the bits through.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=WVT6CAG"><img src="http://feeds.feedburner.com/~f/ioncannon?i=WVT6CAG" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=fpcjsnG"><img src="http://feeds.feedburner.com/~f/ioncannon?i=fpcjsnG" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/276896609" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/system-administration/134/netcat-examples/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/system-administration/134/netcat-examples/</feedburner:origLink></item>
		<item>
		<title>Java GIF Adventure</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/247397872/</link>
		<comments>http://www.ioncannon.net/php/79/java-gif-adventure/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 14:14:29 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/php/79/java-gif-adventure/</guid>
		<description>I was recently working on a project that generated PNGs using Java from a Java2D canvas. Along the way someone wanted to change the graphics to have transparent backgrounds and because they were needed for display on the web I knew this would become an issue because IE doesn&amp;#039;t support transparency in PNGs out of [...]</description>
			<content:encoded><![CDATA[<p>I was recently working on a project that generated PNGs using Java from a Java2D canvas. Along the way someone wanted to change the graphics to have transparent backgrounds and because they were needed for display on the web I knew this would become an issue because <a href="http://blogs.msdn.com/dmassy/archive/2004/08/05/209428.aspx" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">IE doesn&#039;t support transparency in PNGs</a> out of the box. And so my journey started.</p>
<p><span id="more-79"></span></p>
<p>I decided to start by making the PNGs I was generating transparent just to verify that it wasn&#039;t that difficult to do. It turned out to be very easy. I&#039;m using the standard ImageIO libraries and wanted to stick to using them. Here is an example of making the background of an image transparent:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">public</span> <span class="kw2">class</span> Test<br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw2">public</span> <span class="kw2">static</span> <span class="kw4">void</span> main<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">String</span></a><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Exception</span></a><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> image = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a><span class="br0">&#40;</span><span class="nu0">100</span>, <span class="nu0">100</span>, <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a>.<span class="me1">TYPE_INT_ARGB</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AGraphics2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Graphics2D</span></a> canvas = <span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AGraphics2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Graphics2D</span></a><span class="br0">&#41;</span> image.<span class="me1">getGraphics</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; canvas.<span class="me1">setRenderingHint</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ARenderingHints+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">RenderingHints</span></a>.<span class="me1">KEY_ANTIALIASING</span>, <a href="http://www.google.com/search?q=allinurl%3ARenderingHints+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">RenderingHints</span></a>.<span class="me1">VALUE_ANTIALIAS_ON</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; canvas.<span class="me1">setColor</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a>.<span class="me1">white</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; canvas.<span class="me1">setBackground</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a>.<span class="me1">white</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; canvas.<span class="me1">setComposite</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AAlphaComposite+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">AlphaComposite</span></a>.<span class="me1">getInstance</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AAlphaComposite+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">AlphaComposite</span></a>.<span class="me1">SRC_OVER</span>, <span class="nu0">0</span>.0f<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; canvas.<span class="me1">fillRect</span><span class="br0">&#40;</span><span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">100</span>, <span class="nu0">100</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; canvas.<span class="me1">setComposite</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AAlphaComposite+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">AlphaComposite</span></a>.<span class="me1">getInstance</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AAlphaComposite+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">AlphaComposite</span></a>.<span class="me1">SRC_OVER</span>, <span class="nu0">1</span>.0f<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; canvas.<span class="me1">setColor</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a>.<span class="me1">black</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; canvas.<span class="me1">drawLine</span><span class="br0">&#40;</span><span class="nu0">10</span>, <span class="nu0">10</span>, <span class="nu0">20</span>, <span class="nu0">20</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; canvas.<span class="me1">dispose</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AOutputStream+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">OutputStream</span></a> ostream = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AFileOutputStream+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">FileOutputStream</span></a><span class="br0">&#40;</span><span class="st0">&#034;test.png&#034;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; ImageIO.<span class="me1">write</span><span class="br0">&#40;</span>image, <span class="st0">&#034;png&#034;</span>, ostream<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; ostream.<span class="me1">flush</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>The next thing I did was try to just change the format that was being saved from &#034;png&#034; to &#034;gif&#034; thinking that because I had a recent version of Java 1.5 this might just work. However it appears that <a href="http://forum.java.sun.com/thread.jspa?threadID=770668&#038;messageID=4391702" onclick="javascript:urchinTracker ('/outbound/article/forum.java.sun.com');">writting GIFs is not supported until Java 1.6</a> so I was out of luck.</p>
<p>As it turns out though I did some more searching and found that there is actually a <a href="https://gif-plugin.dev.java.net/" onclick="javascript:urchinTracker ('/outbound/article/gif-plugin.dev.java.net');">plugin for GIFs</a> that was made for the ImageIO system. It was very easy to install, just download the jar and put it into the classpath. After that changing &#034;png&#034; to &#034;gif&#034; worked. However, the plugin doesn&#039;t support alpha or doesn&#039;t support it in the same way as the PNG writer. I then tried to change the transparency around a number of ways but nothing worked and in some cases the GIF generated was broken. The most promising hack I tried was to change the alpha flag on the background color using a BufferedImageOp filter like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><a href="http://www.google.com/search?q=allinurl%3ABufferedImageOp+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImageOp</span></a> filter = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImageOp+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImageOp</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> filter<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> src, <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> dest<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>dest == <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dest = createCompatibleDestImage<span class="br0">&#40;</span>src, <span class="kw2">null</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> width = src.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> height = src.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> y = <span class="nu0">0</span>; y &lt; height; y++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> x = <span class="nu0">0</span>; x &lt; width; x++<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span> src.<span class="me1">getRGB</span><span class="br0">&#40;</span>x, y<span class="br0">&#41;</span> == <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a>.<span class="me1">white</span>.<span class="me1">getRGB</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dest.<span class="me1">setRGB</span><span class="br0">&#40;</span>x, y, 0&#215;00FFFFFF &amp; <a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Color</span></a>.<span class="me1">white</span>.<span class="me1">getRGB</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> dest;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3ARectangle2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Rectangle2D</span></a> getBounds2D<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> src<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> src.<span class="me1">getRaster</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getBounds</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> createCompatibleDestImage<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a> src, <a href="http://www.google.com/search?q=allinurl%3AColorModel+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ColorModel</span></a> destCM<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>destCM == <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destCM = src.<span class="me1">getColorModel</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> width = src.<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> height = src.<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedImage+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedImage</span></a><span class="br0">&#40;</span>destCM, destCM.<span class="me1">createCompatibleWritableRaster</span><span class="br0">&#40;</span>width, height<span class="br0">&#41;</span>, destCM.<span class="me1">isAlphaPremultiplied</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="kw2">null</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3APoint2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Point2D</span></a> getPoint2D<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3APoint2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Point2D</span></a> srcPt, <a href="http://www.google.com/search?q=allinurl%3APoint2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Point2D</span></a> dstPt<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>dstPt == <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dstPt = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3APoint2D+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Point2D</span></a>.<a href="http://www.google.com/search?q=allinurl%3AFloat+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Float</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; dstPt.<span class="me1">setLocation</span><span class="br0">&#40;</span>srcPt.<span class="me1">getX</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, srcPt.<span class="me1">getY</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> dstPt;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3ARenderingHints+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">RenderingHints</span></a> getRenderingHints<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">null</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span>;</div>
</div>
<p>The problem with this approach is that the anti-aliasing caused the borders to stand out. While this was close it also wasn&#039;t good enough to use.</p>
<p>In the end I gave up and went back to PNGs. I fixed my issues with IE by using the <a href="http://www.twinhelix.com/css/iepngfix/" onclick="javascript:urchinTracker ('/outbound/article/www.twinhelix.com');">IE AlphaImageLoader fix</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=tbjmdMF"><img src="http://feeds.feedburner.com/~f/ioncannon?i=tbjmdMF" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=JBcF0vF"><img src="http://feeds.feedburner.com/~f/ioncannon?i=JBcF0vF" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/247397872" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/php/79/java-gif-adventure/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/php/79/java-gif-adventure/</feedburner:origLink></item>
		<item>
		<title>Upgrading from Fedora 7 to Fedora 8 with yum</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/181855437/</link>
		<comments>http://www.ioncannon.net/system-administration/133/upgrading-from-fedora-7-to-fedora-8-with-yum/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 21:51:08 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<category><![CDATA[system administration]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/system-administration/133/upgrading-from-fedora-7-to-fedora-8-with-yum/</guid>
		<description>Fedora 8 has been released so it is time to upgrade once again. First you should go back and upgrade to Fedora 7 if you haven&amp;#039;t already. From there it is even easier this time to upgrade. Here are the steps you need to do the upgrade from Fedora 7 to Fedora 8:

yum update
yum clean [...]</description>
			<content:encoded><![CDATA[<p>Fedora 8 has been <a href="http://docs.fedoraproject.org/release-notes/" onclick="javascript:urchinTracker ('/outbound/article/docs.fedoraproject.org');">released</a> so it is time to upgrade once again. First you should go back and <a href="http://www.ioncannon.net/linux/68/upgrading-from-fc6-to-fedora7-with-yum/" >upgrade to Fedora 7</a> if you haven&#039;t already. From there it is even easier this time to upgrade. Here are the steps you need to do the upgrade from Fedora 7 to Fedora 8:</p>
<ol>
<li>yum update</li>
<li>yum clean all</li>
<li>I like to repeated update and clean all a second time to make sure everything got updated</li>
<li>Run the following command to update the yum repo on your box:
<div class="codesnip-container" >
<div class="codesnip">rpm -Uhv http://mirror.anl.gov/pub/fedora/linux/releases/<span class="nu0">8</span>/Fedora/i386/os/Packages/fedora-release-<span class="nu0">8</span>-<span class="nu0">3</span>.noarch.rpm&nbsp; http://mirror.anl.gov/pub/fedora/linux/releases/<span class="nu0">8</span>/Fedora/i386/os/Packages/fedora-release-notes-<span class="nu0">8</span>.<span class="nu0">0</span>.<span class="nu0">0</span>-<span class="nu0">3</span>.noarch.rpm</div>
</div>
</li>
<li>Next do a yum -y update</li>
<li>I needed to remove a couple packages to get the dependencies to work out. This seems to be a normal need now when upgrading but isn&#039;t usually a big deal. In this case I had to remove the heliodor and beryl-settings that both had to do with beryl.</li>
<li>In my case the total set of packages it needed to download was 1.2G so it took about an hour to download and install. Now it was time for a reboot.</li>
<li>The reboot went so fast I almost didn&#039;t believe it rebooted. This was the smoothest upgrade I have had so far.</li>
</ol>
<p>Tags: <a href="http://technorati.com/tag/linux" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">linux</a>, <a href="http://technorati.com/tag/fedora" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> fedora</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=abissgB"><img src="http://feeds.feedburner.com/~f/ioncannon?i=abissgB" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=d4WUeIB"><img src="http://feeds.feedburner.com/~f/ioncannon?i=d4WUeIB" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/181855437" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/system-administration/133/upgrading-from-fedora-7-to-fedora-8-with-yum/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/system-administration/133/upgrading-from-fedora-7-to-fedora-8-with-yum/</feedburner:origLink></item>
		<item>
		<title>Connection timeouts with the Apache commons TelnetClient</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/136909588/</link>
		<comments>http://www.ioncannon.net/java/132/connection-timeouts-with-the-apache-commons-telnetclient/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 16:13:57 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/java/132/connection-timeouts-with-the-apache-commons-telnetclient/</guid>
		<description>I recently used the Apache commons net package in a project to create a small telnet client that automated a login process. It is hard to find a lot of documentation on TelnetClient but there are some examples. For what I wanted to use the telnet client for I ran into a problem because I [...]</description>
			<content:encoded><![CDATA[<p>I recently used the <a href="http://jakarta.apache.org/commons/net/" onclick="javascript:urchinTracker ('/outbound/article/jakarta.apache.org');">Apache commons net package</a> in a project to create a small telnet client that automated a login process. It is hard to find a lot of documentation on <a href="http://jakarta.apache.org/commons/net/apidocs/org/apache/commons/net/telnet/TelnetClient.html" onclick="javascript:urchinTracker ('/outbound/article/jakarta.apache.org');">TelnetClient</a> but there are some examples. For what I wanted to use the telnet client for I ran into a problem because I needed the connect call to time out. Try as I might I couldn&#039;t get <a href="http://jakarta.apache.org/commons/net/apidocs/org/apache/commons/net/SocketClient.html#setDefaultTimeout(int)" onclick="javascript:urchinTracker ('/outbound/article/jakarta.apache.org');">setDefaultTimeout</a> to work as advertised.</p>
<p><span id="more-132"></span></p>
<p>As it turns out the Apache commons developers are trying to keep the net commons package compatible with java 1.3 for some reason (see <a href="http://issues.apache.org/jira/browse/NET-141" onclick="javascript:urchinTracker ('/outbound/article/issues.apache.org');">this issue in jira</a>). If you want to have your connect request time out you have to implement your own <a href="http://jakarta.apache.org/commons/net/apidocs/org/apache/commons/net/SocketFactory.html" onclick="javascript:urchinTracker ('/outbound/article/jakarta.apache.org');">SocketFactory</a> first. Since there seems to be a lot of confusion on this and the commons net project seems to be idle now I figured it was worth writing about in case other people ever go looking.</p>
<p>Here is an example with a custom SocketFactory that will get the timeouts to work on connect:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">package</span> net.<span class="me1">ioncannon</span>;</p>
<p><span class="co2">import org.apache.commons.net.telnet.TelnetClient;</span><br />
<span class="co2">import org.apache.commons.net.SocketFactory;</span></p>
<p><span class="co2">import java.io.IOException;</span><br />
<span class="co2">import java.io.InputStreamReader;</span><br />
<span class="co2">import java.io.BufferedReader;</span><br />
<span class="co2">import java.net.*;</span></p>
<p><span class="kw2">public</span> <span class="kw2">class</span> TelAllTestMain<br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw2">public</span> <span class="kw2">static</span> <span class="kw4">void</span> main<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">String</span></a><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; TelnetClient telnetClient = <span class="kw2">new</span> TelnetClient<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; telnetClient.<span class="me1">setSocketFactory</span><span class="br0">&#40;</span><span class="kw2">new</span> TimeoutSockectFactory<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; telnetClient.<span class="me1">setDefaultTimeout</span><span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; telnetClient.<span class="me1">connect</span><span class="br0">&#40;</span><span class="st0">&#034;localhost&#034;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; telnetClient.<span class="me1">setSoTimeout</span><span class="br0">&#40;</span><span class="nu0">1000</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; telnetClient.<span class="me1">setSoLinger</span><span class="br0">&#40;</span><span class="kw2">true</span>, <span class="nu0">1000</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ABufferedReader+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedReader</span></a> reader = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ABufferedReader+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">BufferedReader</span></a><span class="br0">&#40;</span><span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AInputStreamReader+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">InputStreamReader</span></a><span class="br0">&#40;</span>telnetClient.<span class="me1">getInputStream</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AStringBuffer+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">StringBuffer</span></a> stringBuffer = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AStringBuffer+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">StringBuffer</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="kw2">try</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw4">char</span> buffer<span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="kw2">new</span> <span class="kw4">char</span><span class="br0">&#91;</span><span class="nu0">1024</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw4">int</span> size = -<span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">while</span><span class="br0">&#40;</span><span class="br0">&#40;</span>size = reader.<span class="me1">read</span><span class="br0">&#40;</span>buffer<span class="br0">&#41;</span><span class="br0">&#41;</span> != -<span class="nu0">1</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; stringBuffer.<span class="me1">append</span><span class="br0">&#40;</span>buffer, <span class="nu0">0</span>, size<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>stringBuffer.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">endsWith</span><span class="br0">&#40;</span><span class="st0">&#034;something&#034;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">System</span></a>.<span class="me1">err</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&#034;Found the string&#8230;&#034;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw2">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Exception</span></a> e<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">System</span></a>.<span class="me1">err</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&#034;Didn&#039;t find the string&#8230;&#034;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span>&nbsp; &nbsp; &nbsp; </p>
<p>&nbsp; &nbsp; telnetClient.<span class="me1">disconnect</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; <span class="kw2">private</span> <span class="kw2">static</span> <span class="kw2">class</span> TimeoutSockectFactory <span class="kw2">implements</span> SocketFactory<br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a> createSocket<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">String</span></a> hostname, <span class="kw4">int</span> port<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a> socket = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; socket.<span class="me1">connect</span><span class="br0">&#40;</span><span class="kw2">new</span> InetSocketAddress<span class="br0">&#40;</span>hostname, port<span class="br0">&#41;</span>, <span class="nu0">1000</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw2">return</span> socket;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a> createSocket<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AInetAddress+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">InetAddress</span></a> hostAddress, <span class="kw4">int</span> port<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a> socket = <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; socket.<span class="me1">connect</span><span class="br0">&#40;</span><span class="kw2">new</span> InetSocketAddress<span class="br0">&#40;</span>hostAddress, port<span class="br0">&#41;</span>, <span class="nu0">1000</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="kw2">return</span> socket;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a> createSocket<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">String</span></a> remoteHost, <span class="kw4">int</span> remotePort, <a href="http://www.google.com/search?q=allinurl%3AInetAddress+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">InetAddress</span></a> localAddress, <span class="kw4">int</span> localPort<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a> createSocket<span class="br0">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AInetAddress+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">InetAddress</span></a> remoteAddress, <span class="kw4">int</span> remotePort, <a href="http://www.google.com/search?q=allinurl%3AInetAddress+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">InetAddress</span></a> localAddress, <span class="kw4">int</span> localPort<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3ASocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">Socket</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3AServerSocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ServerSocket</span></a> createServerSocket<span class="br0">&#40;</span><span class="kw4">int</span> port<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AServerSocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ServerSocket</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3AServerSocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ServerSocket</span></a> createServerSocket<span class="br0">&#40;</span><span class="kw4">int</span> port, <span class="kw4">int</span> backlog<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AServerSocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ServerSocket</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.google.com/search?q=allinurl%3AServerSocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ServerSocket</span></a> createServerSocket<span class="br0">&#40;</span><span class="kw4">int</span> port, <span class="kw4">int</span> backlog, <a href="http://www.google.com/search?q=allinurl%3AInetAddress+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">InetAddress</span></a> bindAddress<span class="br0">&#41;</span> <span class="kw2">throws</span> <a href="http://www.google.com/search?q=allinurl%3AIOException+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">IOException</span></a><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw2">new</span> <a href="http://www.google.com/search?q=allinurl%3AServerSocket+java.sun.com&amp;bntl=1" onclick="javascript:urchinTracker ('/outbound/article/www.google.com');"><span class="kw3">ServerSocket</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>Tags: <a href="http://technorati.com/tag/java" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">java</a>, <a href="http://technorati.com/tag/apache" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> apache</a>, <a href="http://technorati.com/tag/commons" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> commons</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=D0cBGmWa"><img src="http://feeds.feedburner.com/~f/ioncannon?i=D0cBGmWa" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=iUnYDQbf"><img src="http://feeds.feedburner.com/~f/ioncannon?i=iUnYDQbf" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/136909588" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/java/132/connection-timeouts-with-the-apache-commons-telnetclient/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/java/132/connection-timeouts-with-the-apache-commons-telnetclient/</feedburner:origLink></item>
		<item>
		<title>10 Tips For Creating Good Looking Diagrams Using Inkscape</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/132645696/</link>
		<comments>http://www.ioncannon.net/utilities/123/10-tips-for-creating-good-looking-diagrams-using-inkscape/#comments</comments>
		<pubDate>Wed, 11 Jul 2007 13:58:07 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/utilities/123/10-tips-for-creating-good-looking-diagrams-using-inkscape/</guid>
		<description>After multiple attempts to find a good free diagraming application I think I have found a decent solution. I&amp;#039;m not creating enough diagrams to justify buying something expensive and I don&amp;#039;t feel like finding a graphics designer to make Dia diagrams prettier. If you have a Mac you are probably not in as bad a [...]</description>
			<content:encoded><![CDATA[<p>After multiple attempts to find a good free diagraming application I think I have found a decent solution. I&#039;m not creating enough diagrams to justify buying something expensive and I don&#039;t feel like finding a graphics designer to make <a href="http://www.gnome.org/projects/dia/" onclick="javascript:urchinTracker ('/outbound/article/www.gnome.org');">Dia</a> diagrams prettier. If you have a Mac you are probably not in as bad a situation since you can buy <a href="http://www.omnigroup.com/applications/omnigraffle/" onclick="javascript:urchinTracker ('/outbound/article/www.omnigroup.com');">OmniGraffle</a> for $79. But for those of us without a Mac or who are just very cheap I think the best solution starts with <a href="http://www.inkscape.org/" onclick="javascript:urchinTracker ('/outbound/article/www.inkscape.org');">Inkscape</a>. I&#039;ve put together a list of 10 tips that will help make better looking diagrams with Inkscape.</p>
<p><span id="more-123"></span></p>
<p>You will want to <a href="http://www.inkscape.org/download/" onclick="javascript:urchinTracker ('/outbound/article/www.inkscape.org');">download Inkscape</a> first. They have binaries for Linux, Windows and Mac OS X so it should be easy enough to get it installed. After installing Inkscape it is a good idea to browse their tutorials via the help->tutorials menu.</p>
<p><strong>1. Find a good color scheme</strong></p>
<p>
This is one of the most important things you need to do. You don&#039;t want the boring black and white diagrams, you want something that has a little color to it. You can use a <a href="http://wellstyled.com/tools/colorscheme2/index-en.html" onclick="javascript:urchinTracker ('/outbound/article/wellstyled.com');">color picker</a> or you can check out <a href="http://www.colourlovers.com/" onclick="javascript:urchinTracker ('/outbound/article/www.colourlovers.com');">colourlovers.com</a> where people vote on different schemes. I like colourlovers.com because they take items like <a href="http://www.colourlovers.com/blog/2007/07/05/fruit-basket-colors/" onclick="javascript:urchinTracker ('/outbound/article/www.colourlovers.com');">fruit baskets</a> and convert those into schemes.</p>
<p>I&#039;m using the following color scheme for the examples here:</p>
<p><center><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/bowl_of_oranges.png"/></center><br/><br/>
</p>
<p><strong>2. Use all of the space</strong></p>
<p>
Don&#039;t be afraid to use the sides of the screen as a scratch pad. This comes in handy when you want to create smaller images to use in the main drawing area. When you are ready to export you can export just the &#034;page&#034; and you won&#039;t see the outside area in the final result.</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/scratch.jpg"/><br/><br/>
</p>
<p><strong>3. Learn the hot keys</strong></p>
<p>
Learning the hot keys will speed up your drawing. The following hot keys are the ones I use the most:</p>
<ul>
<li>group - Ctrl-G</li>
<li>un-group - Ctrl-Shift-G</li>
<li>create square - F4</li>
<li>create circle - F5</li>
<li>create polygons - *</li>
<li>transform - F1</li>
</ul>
<p><strong>4. Use zoom to work close in then zoom out and scale</strong></p>
<p>
I use the zoom function to find a blank area in the &#034;scratch pad&#034; when I want to assemble a shape that may require fine tuning. Since this is a vector drawing it is easy to resize the item later and place it in the correct place after returning to the normal zoom.
</p>
<p><strong>5. Learn how to using masking to make simple shapes</strong></p>
<p>
You can build complex shapes using different simple shapes with path set operations (see the path menu and the advanced tutorial). Here is an example of what a difference operation can create:</p>
<p>First draw a square:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/shape1.jpg"/><br/><br/></p>
<p>Then draw a circle:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/shape2.jpg"/><br/><br/></p>
<p>Then put the circle over the square:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/shape3.jpg"/><br/><br/></p>
<p>Now highlight both the circle and the square:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/shape4.jpg"/><br/><br/></p>
<p>And finally hit Ctrl--:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/shape5.jpg"/><br/><br/>
</p>
<p><strong>6. Don&#039;t use the connectors tool</strong><br/></p>
<p>
I started out trying to use the connectors tool to connect the objects. I found that the tool didn&#039;t work very well because the connections don&#039;t lay themselves out. If you really want any type of bend you are out of luck. They do bend when you click the layout button but they are almost always too close to the objects.</p>
<p>I found that it wasn&#039;t that hard to just use the polygon tool to draw the lines after I finished laying out the objects. When using the polygon tool don&#039;t add the end markers to the lines however because changing the color of the lines doesn&#039;t change the color of the markers (see step #7). I&#039;ve also found that adjusting the transparency of the lines makes for a better look.
</p>
<p><strong>7. Create your own markers</strong></p>
<p>
As I said in step 6 you will want to create your own markers. For one the <a href="http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Attributes-Stroke.html#Attributes-Stroke-Markers" onclick="javascript:urchinTracker ('/outbound/article/tavmjong.free.fr');">attributes of a line don&#039;t carry over to the marker</a> so you need them to be separate objects. After you create your marker zoom to the end of the line to do the alignment. I found that it isn&#039;t<br />
that hard to align the markers once you have them created. Then use the group function to group the markers with the lines.
</p>
<p><strong>8. Overlay text on a color to go over lines.</strong></p>
<p>
The easiest way I have found to overlay the text on the lines is to first create a box the same color as the background of the drawing. After you create the box you will need to force it down using the <img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/forcedown.jpg"/> button. Now that you have a box create your text and lay it over the box. Adjust the size of the box so the entire text is inside of it and then group the box and the text together as one unit. Now you can just place the resulting unit over the line.</p>
<p><center><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/textoverlay.jpg"/></center><br/><br/>
</p>
<p><strong>9. Outline your objects</strong></p>
<p>
Outlining your objects seems to make them pop a little more. I also reduce the transparency a little to allow any text on top of the object to stand out. You will want to consult your color scheme to figure out what two colors to use for the fill and outline. </p>
<p><center><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/outlined.jpg"/></center><br/><br/>
</p>
<p><strong>10. Import SVG graphics</strong></p>
<p>
I think if I had a pen tablet I could probably draw some more complicated objects but there is no way I could draw everything I might need. Luckily there are a number of sources you can use to get SVG graphics. A number of places sell their art in SVG format and there are a few open source or free sources of clip art/icons. The source I have been using is <a href="http://openclipart.org" onclick="javascript:urchinTracker ('/outbound/article/openclipart.org');">openclipart.org</a> (one note on this site is that they are moving to new equipment and I had to use archive.org to <a href="">download the latest open source clipart archive</a>). Another option is to convert a raster image into SVG and then import it that way. You can then use free icons like the <a href="http://www.famfamfam.com/" onclick="javascript:urchinTracker ('/outbound/article/www.famfamfam.com');">famfamfam icons</a> in your diagrams. Although converting to SVG this way works it is best to find images that are sourced directly to SVG from their drawing.</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/import.jpg"/><br/><br/>
</p>
<p><strong>Bonus Tip - How to add drop shadows</strong></p>
<p>
Someone asked if you could do drop shadows and it looks like you can by using the <a href="http://wiki.inkscape.org/wiki/index.php/ReleaseNotes045#SVG_filters:_Gaussian_blur" onclick="javascript:urchinTracker ('/outbound/article/wiki.inkscape.org');">Gaussian Blur</a>. This can make things look better too but you can&#039;t use transparent objects when you do this. After redoing the example I decided I liked the drop shadows better so I&#039;ve included it here.</p>
<p>The first thing is to copy the object you want to have the drop shadow for:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/drop1.jpg"/><br/><br/></p>
<p>Next you want to change the color of the copy to black and set the blur to 10 or so:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/drop2.jpg"/><br/><br/></p>
<p>Now you send the object to the background:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/drop3.jpg"/><br/><br/></p>
<p>And last you align the object a little bit offset from the original:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/drop4.jpg"/><br/><br/></p>
<p>Here is the final result:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/example-dropshadow.png"/><br/><br/></p>
<p>And another copy of the SVG: <a href="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/example-dropshadow.svg" onclick="javascript:urchinTracker ('/outbound/article/d28nuaxr58rcpu.cloudfront.net');">dropshadow example</a>
</p>
<p>I wanted to see if I could use these tips to create a diagram that looks similar to what is on the OmniGraffle page. Here is the result of that:</p>
<p><img src="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/example.png"/><br/><br/></p>
<p>Good luck and I hope this keeps your next diagram from <a href="http://www.presentationzen.com/presentationzen/2005/10/fema_chart_beco.html" onclick="javascript:urchinTracker ('/outbound/article/www.presentationzen.com');">becoming a joke</a>.</p>
<p>Here are a couple links so you can download the <a href="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/example.svg" onclick="javascript:urchinTracker ('/outbound/article/d28nuaxr58rcpu.cloudfront.net');">example SVG</a> and the <a href="http://d28nuaxr58rcpu.cloudfront.net/inkscape-examples/cloud.svg" onclick="javascript:urchinTracker ('/outbound/article/d28nuaxr58rcpu.cloudfront.net');">cloud SVG</a> if you want.</p>
<p>Tags: <a href="http://technorati.com/tag/inkscape" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">inkscape</a>, <a href="http://technorati.com/tag/diagram" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> diagram</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=r9DozZUb"><img src="http://feeds.feedburner.com/~f/ioncannon?i=r9DozZUb" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=NVXXUpcr"><img src="http://feeds.feedburner.com/~f/ioncannon?i=NVXXUpcr" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/132645696" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/utilities/123/10-tips-for-creating-good-looking-diagrams-using-inkscape/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/utilities/123/10-tips-for-creating-good-looking-diagrams-using-inkscape/</feedburner:origLink></item>
		<item>
		<title>How to create a Fedora 7 Instance for EC2</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/130527368/</link>
		<comments>http://www.ioncannon.net/linux/128/how-to-create-a-fedora-7-instance-for-ec2/#comments</comments>
		<pubDate>Sat, 02 Jun 2007 15:38:34 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[ec2]]></category>

		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/uncategorized/128/how-to-create-a-fedora-7-instance-for-ec2/</guid>
		<description>Now that Fedora 7 is out I figured it was time to update the EC2 instance howto. It is almost exactly the same as creating a FC6 instance so if you want to know the details you can reference that article.

Here is an updated script for creating the AMI the only change between this and [...]</description>
			<content:encoded><![CDATA[<p>Now that Fedora 7 is out I figured it was time to update the EC2 instance howto. It is almost exactly the same as <a href="http://www.ioncannon.net/system-administration/115/creating-your-own-fc6-instance-for-ec2/" >creating a FC6 instance</a> so if you want to know the details you can reference that article.</p>
<p><span id="more-128"></span></p>
<p>Here is an updated script for creating the AMI the only change between this and the one for FC6 is the yum repo and the image name:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">#!/bin/sh</span></p>
<p>dd <span class="re2">if=</span>/dev/zero <span class="re2">of=</span>fedora7-i386.img <span class="re2">bs=</span>1M <span class="re2">count=</span><span class="nu0">1</span> <span class="re2">seek=</span><span class="nu0">1024</span><br />
/sbin/mke2fs -F -j fedora7-i386.img</p>
<p>mount -o loop fedora7-i386.img /mnt</p>
<p>mkdir /mnt/dev<br />
mkdir /mnt/proc<br />
mkdir /mnt/etc<br />
<span class="kw1">for</span> i <span class="kw1">in</span> console null zero ; <span class="kw1">do</span> /sbin/MAKEDEV -d /mnt/dev -x <span class="re1">$i</span> ; <span class="kw1">done</span></p>
<p>cat &lt;&lt;EOL &gt; /mnt/etc/fstab<br />
/dev/sda1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ext3&nbsp; &nbsp; defaults <span class="nu0">1</span> <span class="nu0">1</span><br />
none&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/pts&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; devpts&nbsp; <span class="re2">gid=</span><span class="nu0">5</span>,<span class="re2">mode=</span><span class="nu0">620</span> <span class="nu0">0</span> <span class="nu0">0</span><br />
none&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/shm&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tmpfs&nbsp; &nbsp;defaults <span class="nu0">0</span> <span class="nu0">0</span><br />
none&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /proc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;proc&nbsp; &nbsp; defaults <span class="nu0">0</span> <span class="nu0">0</span><br />
none&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /sys&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sysfs&nbsp; &nbsp;defaults <span class="nu0">0</span> <span class="nu0">0</span><br />
/dev/sda2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/mnt&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ext3&nbsp; &nbsp; defaults <span class="nu0">1</span> <span class="nu0">2</span><br />
/dev/sda3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;swap&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; swap&nbsp; &nbsp; defaults <span class="nu0">0</span> <span class="nu0">0</span><br />
EOL</p>
<p>mount -t proc none /mnt/proc</p>
<p>cat &lt;&lt;EOL &gt; /tmp/yumec2.conf<br />
<span class="br0">&#91;</span>main<span class="br0">&#93;</span><br />
<span class="re2">cachedir=</span>/var/cache/yum<br />
<span class="re2">debuglevel=</span><span class="nu0">2</span><br />
<span class="re2">logfile=</span>/var/log/yum.log<br />
<span class="re2">exclude=</span>*-debuginfo<br />
<span class="re2">gpgcheck=</span><span class="nu0">0</span><br />
<span class="re2">obsoletes=</span><span class="nu0">1</span><br />
<span class="re2">reposdir=</span>/dev/null</p>
<p><span class="br0">&#91;</span>base<span class="br0">&#93;</span><br />
<span class="re2">name=</span>Fedora Core <span class="nu0">6</span> - i386 - Base<br />
<span class="re2">mirrorlist=</span>http://mirrors.fedoraproject.org/mirrorlist?<span class="re2">repo=</span>fedora-<span class="nu0">7</span>&amp;<span class="re2">arch=</span>i386<br />
<span class="re2">enabled=</span><span class="nu0">1</span></p>
<p><span class="br0">&#91;</span>updates-released<span class="br0">&#93;</span><br />
<span class="re2">name=</span>Fedora Core <span class="nu0">6</span> - i386 - Released Updates<br />
<span class="re2">mirrorlist=</span>http://mirrors.fedoraproject.org/mirrorlist?<span class="re2">repo=</span>updates-released-f7&amp;<span class="re2">arch=</span>i386<br />
<span class="re2">enabled=</span><span class="nu0">1</span><br />
EOL</p>
<p>yum -c /tmp/yumec2.conf --<span class="re2">installroot=</span>/mnt -y groupinstall Base</p>
<p>yum -c /tmp/yumec2.conf --<span class="re2">installroot=</span>/mnt -y clean packages</p>
<p>mv /mnt/lib/tls /mnt/lib/tls-disabled</p>
<p>cat &lt;&lt;EOL &gt;&gt; /mnt/etc/rc.<span class="kw3">local</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> ! -d /root/.ssh <span class="br0">&#93;</span> ; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; mkdir -p /root/.ssh<br />
&nbsp; &nbsp; &nbsp; &nbsp; chmod <span class="nu0">700</span> /root/.ssh<br />
<span class="kw1">fi</span><br />
<span class="co1"># Fetch public key using HTTP</span><br />
curl http://<span class="nu0">169</span>.<span class="nu0">254</span>.<span class="nu0">169</span>.<span class="nu0">254</span>/<span class="nu0">1</span>.<span class="nu0">0</span>/meta-data/public-keys/<span class="nu0">0</span>/openssl &gt; /tmp/my-key<br />
<span class="kw1">if</span> <span class="br0">&#91;</span> $? -eq <span class="nu0">0</span> <span class="br0">&#93;</span> ; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; cat /tmp/my-key &gt;&gt; /root/.ssh/authorized_keys<br />
&nbsp; &nbsp; &nbsp; &nbsp; chmod <span class="nu0">600</span> /root/.ssh/authorized_keys<br />
&nbsp; &nbsp; &nbsp; &nbsp; rm /tmp/my-key<br />
<span class="kw1">fi</span><br />
<span class="co1"># or fetch public key using the file in the ephemeral store:</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> -e /mnt/openssh_id.pub <span class="br0">&#93;</span> ; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; cat /mnt/openssh_id.pub &gt;&gt; /root/.ssh/authorized_keys<br />
&nbsp; &nbsp; &nbsp; &nbsp; chmod <span class="nu0">600</span> /root/.ssh/authorized_keys<br />
<span class="kw1">fi</span><br />
EOL</p>
<p>cat &lt;&lt;EOL &gt;&gt; /mnt/etc/ssh/sshd_config<br />
UseDNS&nbsp; no<br />
PermitRootLogin without-password<br />
EOL</p>
<p>cat &lt;&lt;EOL &gt; /mnt/etc/sysconfig/network<br />
<span class="re2">NETWORKING=</span>yes<br />
<span class="re2">HOSTNAME=</span>localhost.localdomain<br />
EOL</p>
<p>cat &lt;&lt;EOL &gt; /mnt/etc/sysconfig/network-scripts/ifcfg-eth0<br />
<span class="re2">ONBOOT=</span>yes<br />
<span class="re2">DEVICE=</span>eth0<br />
<span class="re2">BOOTPROTO=</span>dhcp<br />
EOL</p>
<p>sync<br />
umount /mnt/proc<br />
umount /mnt</div>
</div>
<p>Tags: <a href="http://technorati.com/tag/ec2" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">ec2</a>, <a href="http://technorati.com/tag/fedora+7" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> fedora 7</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=M1EI38XH"><img src="http://feeds.feedburner.com/~f/ioncannon?i=M1EI38XH" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=ncV25KXa"><img src="http://feeds.feedburner.com/~f/ioncannon?i=ncV25KXa" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/130527368" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/linux/128/how-to-create-a-fedora-7-instance-for-ec2/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/linux/128/how-to-create-a-fedora-7-instance-for-ec2/</feedburner:origLink></item>
		<item>
		<title>Upgrading from FC6 to Fedora 7 with yum</title>
		<link>http://feeds.feedburner.com/~r/ioncannon/~3/130527369/</link>
		<comments>http://www.ioncannon.net/linux/68/upgrading-from-fc6-to-fedora7-with-yum/#comments</comments>
		<pubDate>Sat, 02 Jun 2007 10:32:57 +0000</pubDate>
		<dc:creator>carson</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/linux/68/upgrading-from-fc6-to-fc7-with-yum/</guid>
		<description>Now that Fedora 7 has been release it is time to upgrade from that crusty old Fedora Core 6. Note that they have removed the &amp;#034;Core&amp;#034; from the name so a few things have changed with the paths used in yum. Last year I did a post on how to upgrade from FC5 to FC6 [...]</description>
			<content:encoded><![CDATA[<p>Now that Fedora 7 has been release it is time to upgrade from that crusty old Fedora Core 6. Note that they have removed the &#034;Core&#034; from the name so a few things have changed with the paths used in yum. Last year I did a post on how to <a href="http://www.ioncannon.net/system-administration/99/upgrade-fc5-to-fc6-with-yum/" >upgrade from FC5 to FC6</a> and this upgrade happened on the first box I used for that.</p>
<ol>
<li>Before you start see the note after these steps about checking for disk labels</li>
<li>yum update</li>
<li>yum clean all</li>
<li>I repeated update and clean all a second time to make sure everything got updated</li>
<li>I then ran the command:
<div class="codesnip-container" >
<div class="codesnip">rpm -Uhv http://download.fedora.redhat.com/pub/fedora/linux/releases/<span class="nu0">7</span>/Fedora/x86_<span class="nu0">64</span>/os/Fedora/fedora-release-<span class="nu0">7</span>-<span class="nu0">3</span>.noarch.rpm http://download.fedora.redhat.com/pub/fedora/linux/releases/<span class="nu0">7</span>/Fedora/x86_<span class="nu0">64</span>/os/Fedora/fedora-release-notes-<span class="nu0">7</span>.<span class="nu0">0</span>.<span class="nu0">0</span>-<span class="nu0">1</span>.noarch.rpm</div>
</div>
</li>
<li>I then found that I had to move fedora-development.repo and fedora-updates.repo out of /etc/yum.repos.d/ and replace them with fedora-development.repo.rpmnew and fedora-updates.repo.rpmnew. I also needed to remove a custom repo I had but no longer used so I didn&#039;t take time to figure out why it needed to be removed.</li>
<li>I then did a yum -y update and waited</li>
<li>After a good wait another X server was started so you may think about not doing the update while running under X. Luckily it was able to start on another console so all was ok. Now it was time for a reboot.</li>
<li>After the reboot I had to fix up some NVidia issues but overall it looks like it upgraded without a problem</li>
</ol>
<p>Notes on disk labels:</p>
<p>There are a few things listed in the release notes under <a href="http://docs.fedoraproject.org/release-notes/f7/en_US/sn-Installer.html#Upgrade-Related-Issues" onclick="javascript:urchinTracker ('/outbound/article/docs.fedoraproject.org');">Upgrade Related Issues</a>.</p>
<p>The first was to make sure all your drives have labels. You can do this by running the command &#034;/sbin/blkid&#034; and then checking that each line that is not part of the LVM system has a LABEL entry. If you need to add a label to a drive use the &#034;/sbin/e2label&#034; command and then edit your /etc/fstab to use the label on boot instead of the device.</p>
<div class="codesnip-container" >
<div class="codesnip">LABEL=/boot&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/boot&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ext3&nbsp; &nbsp; defaults&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="nu0">2</span></div>
</div>
<p>You don&#039;t need to label LVM drives since the LVM keeps track of the drives it uses on its own. The only drive I had on a stock install that wasn&#039;t under the LVM was /boot and it had a label already.</p>
<p>After you upgrade they sugest running the following command and then upgrading anything that has a date before the upgrade date:</p>
<div class="codesnip-container" >
<div class="codesnip">rpm -qa --last &gt; RPMS_by_Install_Time.txt</div>
</div>
<p>Tags: <a href="http://technorati.com/tag/linux" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">linux</a>, <a href="http://technorati.com/tag/fedora" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> fedora</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/ioncannon?a=FXMaPF8g"><img src="http://feeds.feedburner.com/~f/ioncannon?i=FXMaPF8g" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/ioncannon?a=sxSOxngG"><img src="http://feeds.feedburner.com/~f/ioncannon?i=sxSOxngG" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ioncannon/~4/130527369" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/linux/68/upgrading-from-fc6-to-fedora7-with-yum/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ioncannon.net/linux/68/upgrading-from-fc6-to-fedora7-with-yum/</feedburner:origLink></item>
	</channel>
</rss>
