<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkcARXs_fSp7ImA9WhBaE0k.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876</id><updated>2013-05-23T10:14:04.545-10:00</updated><category term="flash" /><category term="Fedora" /><category term="bootcd" /><category term="solution" /><category term="news" /><category term="free" /><category term="gnucash" /><category term="conversion" /><category term="mencoder" /><category term="adobe" /><category term="upgrade" /><category term="C programming" /><category term="sed" /><category term="mingw64" /><category term="action" /><category term="gas" /><category term="hard disk" /><category term="Solaris" /><category term="email" /><category term="unicode" /><category term="wget" /><category term="x.org" /><category term="CDO" /><category term="java" /><category term="windows me" /><category term="graphics" /><category term="policy" /><category term="live555" /><category term="cdrtools" /><category term="techticker" /><category term="vlc" /><category term="online" /><category term="desktop" /><category term="trouble-shooting" /><category term="wdm" /><category term="stock" /><category term="power" /><category term="FAT32" /><category term="design" /><category term="fix" /><category term="statistics" /><category term="nvidia" /><category term="open-source" /><category term="compiler" /><category term="svn" /><category term="hongkong" /><category term="google" /><category term="millenium" /><category term="thin client" /><category term="mail" /><category term="technology" /><category term="asian" /><category term="bootloader" /><category term="gparted" /><category term="retirement" /><category term="officesuite" /><category term="hacking" /><category term="template" /><category term="hancomoffice" /><category term="ebook" /><category term="mp4" /><category term="portable" /><category term="mccain" /><category term="typography" /><category term="amd64" /><category term="opensource" /><category term="frontend" /><category term="computer" /><category term="tcpip" /><category term="codec" /><category term="maintenance" /><category term="code" /><category term="mp4box" /><category term="seamonkey" /><category term="update" /><category term="customization" /><category term="driver" /><category term="Lenny" /><category term="ripping" /><category term="p2p" /><category term="usb" /><category term="Debian" /><category term="lang:ko" /><category term="howto" /><category term="gnutella" /><category term="ssh" /><category term="music" /><category term="world" /><category term="Xvfb" /><category term="vnc" /><category term="weapon" /><category term="energy" /><category term="booting" /><category term="amule" /><category term="unix" /><category term="bookmark" /><category term="behavior" /><category term="investment" /><category term="gtk+" /><category term="log" /><category term="virus" /><category term="mathematics" /><category term="bootstrap" /><category term="film" /><category term="haansoft" /><category term="insiderpages" /><category term="dllwrap" /><category term="natural" /><category term="attachment" /><category term="yelp" /><category term="installation" /><category term="finance" /><category term="web" /><category term="C" /><category term="aria2" /><category term="MOOC" /><category term="storage" /><category term="rdbms" /><category term="library" /><category term="windows 7" /><category term="overblog" /><category term="troubleshooting" /><category term="sshfs" /><category term="gpac" /><category term="windows xp" /><category term="adwords" /><category term="repair" /><category term="performance" /><category term="mldonkey" /><category term="bond" /><category term="metatag" /><category term="cross-compiler" /><category term="palin" /><category term="backup" /><category term="utility" /><category term="story" /><category term="smartsuite" /><category term="xml" /><category term="freetype" /><category term="oil" /><category term="openbsd" /><category term="kungfu" /><category term="x11" /><category term="local" /><category term="mingw-w64" /><category term="economy" /><category term="blu-ray" /><category term="college" /><category term="greenspan" /><category term="openssl" /><category term="language" /><category term="sample" /><category term="psychotherapy" /><category term="gtk-gnutella" /><category term="windows 8" /><category term="housing" /><category term="intel" /><category term="software" /><category term="market" /><category term="ssl" /><category term="partition" /><category term="widget" /><category term="journalism" /><category term="computing" /><category term="x86-64" /><category term="yahoo" /><category term="distro" /><category term="grub" /><category term="win8" /><category term="audacity" /><category term="bush" /><category term="forbes" /><category term="javamail" /><category term="monetization" /><category term="republican" /><category term="social" /><category term="directory" /><category term="marriage" /><category term="gnu" /><category term="arab" /><category term="banking" /><category term="igoogle" /><category term="financial" /><category term="myaol" /><category term="console" /><category term="vsftpd" /><category term="download" /><category term="cmake" /><category term="keyword" /><category term="amazon" /><category term="browser" /><category term="wuxia" /><category term="script" /><category term="windows" /><category term="toshiba" /><category term="postscript" /><category term="Korean" /><category term="operating system" /><category term="lotus" /><category term="psychiatry" /><category term="agriculture" /><category term="me" /><category term="feed" /><category term="Internet" /><category term="mortgage" /><category term="personal" /><category term="nano" /><category term="Maxthon" /><category term="transmission" /><category term="how-to" /><category term="avast" /><category term="font" /><category term="mixx" /><category term="reddit" /><category term="life" /><category term="trueimage" /><category term="antivirus" /><category term="blogger" /><category term="wxwidgets" /><category term="history" /><category term="search" /><category term="freedos" /><category term="ocaml" /><category term="windows7" /><category term="digital" /><category term="mozilla" /><category term="renewable" /><category term="checksum" /><category term="sysadmin" /><category term="development" /><category term="acronis" /><category term="malware" /><category term="shopping" /><category term="hash" /><category term="fonts" /><category term="service" /><category term="war" /><category term="buzz" /><category term="prison" /><category term="cracking" /><category term="configuration" /><category term="magnet" /><category term="player" /><category term="printer" /><category term="rss" /><category term="torrent" /><category term="resource" /><category term="video" /><category term="portal" /><category term="virtual" /><category term="alternative" /><category term="compaq" /><category term="openoffice.org" /><category term="reading" /><category term="russia" /><category term="PDF" /><category term="lenovo" /><category term="theme" /><category term="example" /><category term="cdrkit" /><category term="ffmpeg" /><category term="putty" /><category term="tdm" /><category term="format" /><category term="x-terminal" /><category term="employment" /><category term="industry" /><category term="obama" /><category term="report" /><category term="cold" /><category term="build" /><category term="Pardus" /><category term="PortableApp" /><category term="marketing" /><category term="network" /><category term="aac" /><category term="clamav" /><category term="window manager" /><category term="president" /><category term="chinese" /><category term="anti-virus" /><category term="flexdll" /><category term="porting" /><category term="education" /><category term="korea" /><category term="IceWM" /><category term="myyahoo" /><category term="perl" /><category term="input" /><category term="tomcat" /><category term="advertising" /><category term="command" /><category term="MPEG" /><category term="deal" /><category term="mplayer" /><category term="urimal" /><category term="subprime" /><category term="encoder" /><category term="shell" /><category term="saving" /><category term="mbr" /><category term="learning" /><category term="sale" /><category term="hardware" /><category term="promotion" /><category term="embedded" /><category term="recovery" /><category term="router" /><category term="speed" /><category term="lender" /><category term="election" /><category term="writer" /><category term="Hawaii" /><category term="remote" /><category term="MP3" /><category term="gtk" /><category term="parenting" /><category term="calculus" /><category term="shiller" /><category term="bubble" /><category term="kde" /><category term="tip" /><category term="publishing" /><category term="seo" /><category term="literature" /><category term="essay" /><category term="acrobat" /><category term="wireless" /><category term="adsense" /><category term="mymsn" /><category term="netbook" /><category term="administration" /><category term="kernel" /><category term="server" /><category term="gcc" /><category term="Ubuntu" /><category term="ftp" /><category term="university" /><category term="SunOS" /><category term="biodiesel" /><category term="problem" /><category term="metalink" /><category term="jdni" /><category term="vietnamese" /><category term="wordperfect" /><category term="registry" /><category term="discount" /><category term="roller" /><category term="xterm" /><category term="dvd" /><category term="ghostscript" /><category term="lzo" /><category term="psychology" /><category term="pebble" /><category term="tragedy" /><category term="cost" /><category term="novel" /><category term="tips" /><category term="craigslist" /><category term="ndiswrapper" /><category term="notebook" /><category term="laptop" /><category term="cpu" /><category term="bittorrent" /><category term="opec" /><category term="business" /><category term="biofuel" /><category term="64-bit" /><category term="security" /><category term="cloud" /><category term="usage" /><category term="bash" /><category term="compile" /><category term="multimedia" /><category term="wpa" /><category term="cross-compile" /><category term="dreamlinux" /><category term="movie" /><category term="hsqldb" /><category term="posix" /><category term="ifoedit" /><category term="usb 2.0" /><category term="filesystem" /><category term="plan" /><category term="digg" /><category term="coding" /><category term="windows 98" /><category term="sugar" /><category term="china" /><category term="vista" /><category term="setup" /><category term="media" /><category term="responsibility" /><category term="ideology" /><category term="admin" /><category term="syslinux" /><category term="apple" /><category term="x-windows" /><category term="symphony" /><category term="Programming" /><category term="USA" /><category term="gnome" /><category term="C++" /><category term="compression" /><category term="unionfs" /><category term="mingw" /><category term="ibm" /><category term="picture" /><category term="cms" /><category term="domain" /><category term="ethanol" /><category term="dos" /><category term="tweak" /><category term="democrat" /><category term="database" /><category term="wxmsw" /><category term="linux" /><category term="apache" /><category term="via" /><category term="Islam" /><category term="guide" /><category term="office" /><category term="cygwin" /><category term="law" /><category term="thinkfree" /><category term="politics" /><category term="document" /><category term="tutorial" /><category term="moblin" /><category term="bsd" /><category term="x11vnc" /><category term="streaming" /><category term="book" /><category term="blog" /><category term="conflict" /><category term="presidential" /><category term="criticism" /><category term="taiwan" /><category term="terminal" /><category term="hard drive" /><category term="dictionary" /><category term="religion" /><category term="microsoft" /><category term="opensolaris" /><category term="parser" /><category term="reader" /><category term="password" /><category term="accounting" /><title>Kblog</title><subtitle type="html">True Randomness</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://kemovitra.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>459</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/FragrantMemories" /><feedburner:info uri="fragrantmemories" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>FragrantMemories</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;CkAERHo4fSp7ImA9WhBaEkQ.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-1873924558759198040</id><published>2013-05-22T20:31:00.000-10:00</published><updated>2013-05-22T20:31:45.435-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-22T20:31:45.435-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="filesystem" /><category scheme="http://www.blogger.com/atom/ns#" term="tip" /><category scheme="http://www.blogger.com/atom/ns#" term="guide" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><title>To mount Linux EXT2 filesystem with OpenBSD</title><content type="html">&lt;p&gt;&lt;a href="http://openbsd.org"&gt;OpenBSD&lt;/a&gt; can mount several foreign filesystems, including FAT, NTFS and Linux ext2. However, OpenBSD has a limited vision and can only see partitions that have been defined with disklabel. In other words, OpenBSD has hard time accessing partitions outside its boundaries unless you use disklabel to extend the OpenBSD boundaries and to define a new partition pointing to the location of the foreign partition.&lt;/p&gt;

&lt;p&gt;To use disklabel on an IDE/ATAPI hard drive, run a command like this:&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd;"&gt;disklabel -E /dev/rwd0c&lt;/pre&gt;

&lt;p&gt;You can type p to see the list of partitions defined by disklabel. Use the b command to change the OpenBSD boundaries.&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd;"&gt;&amp;gt; &lt;span style="color: #f03;"&gt;b&lt;/span&gt;
Starting sector: [5799465]
Size ('*' for entire disk): [3148740] &lt;span style="color: #f03;"&gt;*&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;For the starting sector, give a value less than the given if the foreign partition you want to mount is located before the OpenBSD area. Otherwise, leave it as is. For the size, type the asterisk(*) so you can access any foreign partition beyond the OpenBSD area.&lt;/p&gt;

&lt;p&gt;Then, use the a command to create a new letter that represents the foreign partition.&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd;"&gt;&amp;gt; &lt;span style="color: #f03;"&gt;a&lt;/span&gt;
partition: [m]
offset: [8948192] 10002432
size: [146301104] 146298880
FS type: [4.2BSD] EXT2FS&lt;/pre&gt;

&lt;p&gt;The given partition letter (m) is the next letter after the existing letters that have been defined by disklabel. We are not really creating a new physical partition but merely creating a new letter that points to the location of the partition that lies outside the OpenBSD area. Then, use the q command to save the label.&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd;"&gt;&amp;gt; q
Write new label?: [y] y&lt;/pre&gt;

&lt;p&gt;Now we can mount the partition using a new device name. In this example, the new device name is made of /dev/wd0 plus the new letter (m).&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd;"&gt;mount -t ext2fs /dev/wd0m /mnt&lt;/pre&gt;

&lt;p&gt;Unfortuately, OpenBSD is unable to mount journaling filesystems from Linux, such as XFS.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/quyJOnutmMo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/1873924558759198040/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/to-mount-linux-ext2-filesystem-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/1873924558759198040?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/1873924558759198040?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/quyJOnutmMo/to-mount-linux-ext2-filesystem-with.html" title="To mount Linux EXT2 filesystem with OpenBSD" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/to-mount-linux-ext2-filesystem-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8GRnYzfSp7ImA9WhBaEks.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-7423848445367107984</id><published>2013-05-22T13:03:00.000-10:00</published><updated>2013-05-22T13:03:47.885-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-22T13:03:47.885-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="blog" /><category scheme="http://www.blogger.com/atom/ns#" term="configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="installation" /><category scheme="http://www.blogger.com/atom/ns#" term="howto" /><category scheme="http://www.blogger.com/atom/ns#" term="guide" /><category scheme="http://www.blogger.com/atom/ns#" term="setup" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat" /><category scheme="http://www.blogger.com/atom/ns#" term="roller" /><title>Installing Apache Roller on OpenBSD</title><content type="html">&lt;p&gt;Previously, I wrote how to install Roller on &lt;a href="/2013/04/installing-and-setting-up-apache-roller.html"&gt;Windows&lt;/a&gt; and &lt;a href="/2013/05/to-install-tomcat-and-roller-on-debian.html"&gt;Linux&lt;/a&gt;. Installing Roller on &lt;a href="http://openbsd.org"&gt;OpenBSD&lt;/a&gt; is not much different from doing it on Linux. But first, read &lt;a href="/2013/05/installing-tomcat-on-openbsd.html"&gt;this post&lt;/a&gt; on installing Tomcat on OpenBSD. Then just follow these steps to set up Roller blogging platform on OpenBSD.&lt;/p&gt;

&lt;ol&gt;

&lt;li&gt;&lt;p&gt;Download &lt;a href="http://hsqldb.org"&gt;HSQLDB&lt;/a&gt;, &lt;a href="http://javamail.java.net"&gt;JavaMail&lt;/a&gt;, &lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index-135046.html"&gt;JAF&lt;/a&gt; and put them in the /var/tomcat/lib directory. You may have to create the directory first. After that, you have these files.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;/var/tomcat/lib/activation.jar
&lt;li&gt;/var/tomcat/lib/hsqldb.jar
&lt;li&gt;/var/tomcat/lib/&lt;a href="http://java.net/projects/javamail/downloads/download/javax.mail.jar" rel="nofollow"&gt;javax.mail.jar&lt;/a&gt;
&lt;li&gt;/var/tomcat/lib/sqltool.jar
&lt;/ul&gt;

&lt;li&gt;&lt;p&gt;Extract javamail.address.map and javamail.providers from javax.mail.jar and put them in /usr/local/jre-1.7.0/lib.&lt;/p&gt;

&lt;li&gt;&lt;p&gt;In this step, we manually deploy Apache Roller on Tomcat. First stop any running instance of Tomcat.&lt;/p&gt;

&lt;pre&gt;/etc/rc.d/tomcat stop&lt;/pre&gt;

&lt;p&gt;Then, download the Roller WAR file for Tomcat (roller-5.0.1-tomcat.war). Move it to /var/tomcat/webapps directory and rename it as ROOT.war, assuming you want to make Roller the default application for Tomcat.&lt;/p&gt;

&lt;pre&gt;cd /var/tomcat/webapps
rm -rf ROOT*
mv ~/Downloads/roller-5.0.1-tomcat.war ROOT.war&lt;/pre&gt;

&lt;p&gt;Restart tomcat. Tomcat will automatically unpack the WAR file to a new ROOT directory.&lt;/p&gt;

&lt;pre&gt;/etc/rc.d/tomcat restart&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Then, create roller-custom.properties and save it in /var/tomcat/lib directory. We are using JNDI method in this example.&lt;/p&gt;

&lt;pre&gt;installation.type=auto
database.configurationType=jndi
database.jndi.name=jdbc/rollerdb
openjpa.ConnectionDriverName=org.hsqldb.jdbcDriver
openjpa.ConnectionURL=jdbc:hsqldb:/var/tomcat/work/Roller/rollerdb
mediafiles.storage.dir=/var/tomcat/work/Roller/mediafiles
search.index.dir=/var/tomcat/work/Roller/searchindex
log4j.appender.roller.File=/var/tomcat/logs/roller.log
mail.configurationType=jndi
mail.jndi.name=mail/Session&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Create a text file and save it as /var/tomcat/webapps/ROOT/META-INF/context.xml. Below is sample contents. Tweak it according to your needs.&lt;/p&gt;

&lt;pre&gt;&amp;lt;Context&amp;gt;

  &amp;lt;Resource name="jdbc/rollerdb" auth="Container" type="javax.sql.DataSource"
    driverClassName="org.hsqldb.jdbcDriver"
    url="jdbc:hsqldb:/var/tomcat/work/Roller/rollerdb"
    factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    maxActive="20" maxIdle="3" removeAbandoned="true" maxWait="3000" /&amp;gt;

  &amp;lt;Resource name="mail/Session" auth="Container" type="javax.mail.Session"
    password="xanadu00"
    mail.debug="true"
    mail.transport.protocol="smtp"
    mail.smtp.auth="true"
    mail.smtp.host="smtp.gmail.com"
    mail.smtp.user="kblakhan@gmail.com"
    mail.smtp.ssl.enable="true"
    mail.smtp.starttls.enable="true"
    mail.smtp.socketFactory.class="com.sun.mail.util.MailSSLSocketFactory"
    mail.smtp.socketFactory.fallback="false"
    mail.smtp.socketFactory.port="465"
    mail.smtp.port="465"
  /&amp;gt;

&amp;lt;/Context&amp;gt;&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Then create directories for storing Roller data.&lt;/p&gt;
&lt;pre&gt;mkdir -p /var/tomcat/work/Roller
mkdir -p /var/tomcat/work/Roller/mediafiles
mkdir -p /var/tomcat/work/Roller/searchindex&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Restart Tomcat again to have Tomcat read new settings and start Roller.&lt;/p&gt;
&lt;pre&gt;/etc/rc.d/tomcat restart&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Point your Web browser to http://127.0.0.1:8080 and start Roller configuration. First, you need to create the database. Then, create a new user and the first blog.&lt;/p&gt;

&lt;li&gt;&lt;p&gt;After setup is complete, set the installation.type to manual in roller-custom.properties.&lt;/p&gt;
&lt;pre&gt;installation.type=manual&lt;/pre&gt;

&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/QGGwMVIbhwM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/7423848445367107984/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/installing-apache-roller-on-openbsd.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/7423848445367107984?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/7423848445367107984?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/QGGwMVIbhwM/installing-apache-roller-on-openbsd.html" title="Installing Apache Roller on OpenBSD" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/installing-apache-roller-on-openbsd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIDRHk5cCp7ImA9WhBaEk0.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-4129331485436760895</id><published>2013-05-21T21:26:00.002-10:00</published><updated>2013-05-21T21:26:15.728-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-21T21:26:15.728-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="blog" /><category scheme="http://www.blogger.com/atom/ns#" term="configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="installation" /><category scheme="http://www.blogger.com/atom/ns#" term="guide" /><category scheme="http://www.blogger.com/atom/ns#" term="setup" /><category scheme="http://www.blogger.com/atom/ns#" term="hsqldb" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Debian" /><category scheme="http://www.blogger.com/atom/ns#" term="javamail" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat" /><category scheme="http://www.blogger.com/atom/ns#" term="roller" /><title>To install Tomcat and Roller on Debian Linux</title><content type="html">&lt;p&gt;&lt;a href="http://roller.apache.org"&gt;Roller&lt;/a&gt; is a blogging platform that runs on &lt;a href="http://tomcat.apache.org"&gt;Tomcat&lt;/a&gt; and other Java-based web servers. Previously, I installed &lt;a href="/2013/04/installing-and-setting-up-apache-roller.html"&gt;Roller on Windows&lt;/a&gt;, but because Windows is not the best server OS, I want to install and use Roller on Linux and OpenBSD. I use &lt;a href="http://www.debian.org"&gt;Debian Linux&lt;/a&gt;, so I am going to show how I install Apache Roller on Debian Linux in this post.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Install JRE, tomcat and HSQLDB. In this guide, &lt;a href="http://hsqldb.org"&gt;HSQLDB&lt;/a&gt; is selected for the database backend for Roller because of its leanness, but you can choose to install MySQL or PostgreSQL instead. On Debian, the names of packages are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;openjdk-7-jre or openjdk-6-jre
&lt;li&gt;tomcat7 or tomcat6
&lt;li&gt;libhsqldb-java or libhsqldb1.8.0-java
&lt;/ul&gt;

&lt;p&gt;Using apt-get, I installed the packages as follows:&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;apt-get install openjdk-7-jre tomcat7 libhsqldb-java&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Copy or symlink hsqldb and &lt;a href="http://commons.apache.org/proper/commons-dbcp/"&gt;dbcp&lt;/a&gt; files from /usr/share/java to /var/lib/tomcat7/lib. In addition, download &lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index-135046.html" rel="nofollow"&gt;activation.jar&lt;/a&gt; and javamail, and put them in the /var/lib/tomcat7/lib directory, too. If this directory doesn't exist, create it. It is one of the directories that Tomcat searches for Java libraries. Now we have these files at /var/lib/tomcat7/lib:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;/var/lib/tomcat7/lib/activation.jar
&lt;li&gt;/var/lib/tomcat7/lib/commons-dbcp.jar
&lt;li&gt;/var/lib/tomcat7/lib/&lt;a href="http://java.net/projects/javamail/downloads/download/javax.mail.jar" rel="nofollow"&gt;javax.mail.jar&lt;/a&gt;
&lt;li&gt;/var/lib/tomcat7/lib/hsqldb.jar
&lt;/ul&gt;

&lt;li&gt;&lt;p&gt;In this step, we deploy the Roller WAR file (roller-5.0.1-tomcat.war). I don't like putting the WAR file in /var/lib/tomcat7/webapps directory. Instead, I manually unpack it into the "ROOT" directory. Before messing with the webapps directory, stop Tomcat7 first.&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd;"&gt;/etc/init.d/tomcat7 stop
cd /var/lib/tomcat7/webapps
rm -rf ROOT
mkdir ROOT
cd ROOT
unzip ~/Downloads/roller-5.0.1-tomcat.war&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Next, create a text file named roller-custom.properties. We can save it in one of several locations, for example, /usr/share/tomcat7/common/classes, /usr/share/tomcat7/lib, /usr/share/tomcat7/shared/classes, /var/lib/tomcat7/lib, etc. I think /var/lib/tomcat7/lib will work in most cases.&lt;/p&gt;

&lt;pre&gt;installation.type=auto
database.configurationType=jndi
database.jndi.name=jdbc/rollerdb
openjpa.ConnectionDriverName=org.hsqldb.jdbcDriver
openjpa.ConnectionURL=jdbc:hsqldb:/var/cache/tomcat7/Roller/rollerdb
mediafiles.storage.dir=/var/cache/tomcat7/Roller/mediafiles
search.index.dir=/var/cache/tomcat7/Roller/searchindex
log4j.appender.roller.File=/var/log/tomcat7/roller.log
mail.configurationType=jndi
mail.jndi.name=mail/Session&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Then, create /var/lib/tomcat7/webapps/ROOT/META-INF/context.xml. The following is example contents:&lt;/p&gt;

&lt;pre&gt;&amp;lt;Context&amp;gt;
  &amp;lt;Resource name="jdbc/rollerdb" auth="Container" type="javax.sql.DataSource"
    driverClassName="org.hsqldb.jdbcDriver"
    url="jdbc:hsqldb:/var/cache/tomcat7/Roller/rollerdb"
    factory="org.apache.commons.dbcp.BasicDataSourceFactory"
    maxActive="20" maxIdle="3" removeAbandoned="true" maxWait="3000"
  /&amp;gt;
  &amp;lt;Resource name="mail/Session" auth="Container" type="javax.mail.Session"
    password="********"
    mail.debug="true"
    mail.transport.protocol="smtp"
    mail.smtp.auth="true"
    mail.smtp.host="smtp.gmail.com"
    mail.smtp.user="********@gmail.com"
    mail.smtp.ssl.enable="true"
    mail.smtp.starttls.enable="true"
    mail.smtp.socketFactory.class="com.sun.mail.util.MailSSLSocketFactory"
    mail.smtp.socketFactory.fallback="false"
    mail.smtp.socketFactory.port="465"
    mail.smtp.port="465"
  /&amp;gt;
&amp;lt;/Context&amp;gt;&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Now create the Roller data folders.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;mkdir -p /var/cache/tomcat7/Roller
mkdir -p /var/cache/tomcat7/Roller/mediafiles
mkdir -p /var/cache/tomcat7/Roller/searchindex&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Restart Tomcat.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;/etc/init.d/tomcat7 restart&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Point your Web browser to http://127.0.0.1:8080 and start setting up Roller. First, you need to create the Roller database.&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/95894379@N06/8775003445/" title="001 by k.blog, on Flickr"&gt;&lt;img src="http://farm9.staticflickr.com/8276/8775003445_844a3513c1.jpg" width="500" height="313" alt="001"&gt;&lt;/a&gt;

&lt;p&gt;Hopefully, database will be created successfully.&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/95894379@N06/8781572544/" title="002 by k.blog, on Flickr"&gt;&lt;img src="http://farm8.staticflickr.com/7425/8781572544_8d0c006a05.jpg" width="500" height="313" alt="002"&gt;&lt;/a&gt;

&lt;p&gt;You'll see the "Welcome to Roller" page.&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/95894379@N06/8781572274/" title="003 by k.blog, on Flickr"&gt;&lt;img src="http://farm3.staticflickr.com/2894/8781572274_7cdfbf7b5f.jpg" width="500" height="313" alt="003"&gt;&lt;/a&gt;

&lt;p&gt;Create the first user.&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/95894379@N06/8775002807/" title="004 by k.blog, on Flickr"&gt;&lt;img src="http://farm8.staticflickr.com/7346/8775002807_f1e3be4941.jpg" width="500" height="313" alt="004"&gt;&lt;/a&gt;

&lt;p&gt;Log in as admin and create the first blog.&lt;/p&gt;

&lt;a href="http://www.flickr.com/photos/95894379@N06/8775002571/" title="005 by k.blog, on Flickr"&gt;&lt;img src="http://farm8.staticflickr.com/7307/8775002571_a7d0069fd7.jpg" width="500" height="313" alt="005"&gt;&lt;/a&gt;

&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/ZKMkCPDh2x4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/4129331485436760895/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/to-install-tomcat-and-roller-on-debian.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/4129331485436760895?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/4129331485436760895?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/ZKMkCPDh2x4/to-install-tomcat-and-roller-on-debian.html" title="To install Tomcat and Roller on Debian Linux" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/to-install-tomcat-and-roller-on-debian.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcFSX4-eSp7ImA9WhBbGEs.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-3446462918130905000</id><published>2013-05-17T21:54:00.000-10:00</published><updated>2013-05-17T22:00:18.051-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-17T22:00:18.051-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="hsqldb" /><category scheme="http://www.blogger.com/atom/ns#" term="rdbms" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat" /><category scheme="http://www.blogger.com/atom/ns#" term="jdni" /><category scheme="http://www.blogger.com/atom/ns#" term="database" /><category scheme="http://www.blogger.com/atom/ns#" term="roller" /><title>Setting up Tomcat and Roller with a JNDI datasource for standalone HSQLDB</title><content type="html">&lt;p&gt;Setting up a &lt;a href="http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html"&gt;JNDI&lt;/a&gt; datasource for database with &lt;a href="http://tomcat.apache.org"&gt;Apache Tomcat&lt;/a&gt; can be a difficult and tricky thing. In my case, it took me a considerable time to set up a &lt;a href="http://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html"&gt;JNDI datasource&lt;/a&gt; for a standalone/file-based &lt;a href="http://hsqldb.org"&gt;HSQLDB&lt;/a&gt; database on my Tomcat server. It was a trial-and-error task as I try different settings. The &lt;a href="/search/label/hsqldb"&gt;HSQLDB database&lt;/a&gt; in my case is used for &lt;a href="http://roller.apache.org"&gt;Apache Roller&lt;/a&gt;. There are many settings that can affect the &lt;a href="http://docs.oracle.com/javase/jndi/tutorial/"&gt;JNDI&lt;/a&gt; functionality. Whether it works or not mostly depends on how we write and tweak the configuration files. In this post, I'll just show how I edited the files involved in JNDI configuration.&lt;/p&gt;

&lt;p&gt;First of all, I switched the working mode of HSQLDB database from &lt;a href="http://hsqldb.org/doc/guide/ch01.html"&gt;server&lt;/a&gt; to standalone. That means there is no server listening at a network port (TCP 80 or 9001) for SQL queries from client applications. Because database operation is done directly on the database files without mediation of the server, no username or password is required. No action to start and shut down the server is necessary either.&lt;/p&gt;

&lt;p&gt;For Apache Roller, modification of the &lt;em&gt;roller-custom.properties&lt;/em&gt; file is necessary. The following example shows the lines that need to be modified.&lt;/p&gt;

&lt;pre&gt;database.configurationType=jndi
database.jndi.name=jdbc/rollerdb
openjpa.ConnectionDriverName=org.hsqldb.jdbcDriver
openjpa.ConnectionURL=jdbc:hsqldb:file://F:/apache-tomcat-7.0.39/work/Roller/rollerdb&lt;/pre&gt;

&lt;p&gt;I am not sure what &lt;a href="http://openjpa.apache.org/"&gt;openjpa&lt;/a&gt; has to do with JNDI, but it helps Roller work with new settings. There's nothing to change for WEB-INF/web.xml. However, META-INF/context.xml should be changed as shown below. Here's how I set up a JNDI datasource for standalone/embedded HSQLDB in META-INF/context.xml.&lt;/p&gt;

&lt;pre&gt;&amp;lt;Context&amp;gt;

  &amp;lt;Resource name="jdbc/rollerdb" auth="Container" type="javax.sql.DataSource"
    driverClassName="org.hsqldb.jdbcDriver"
    url="jdbc:hsqldb:file://F:/apache-tomcat-7.0.39/work/Roller/rollerdb"
    factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    maxActive="20" maxIdle="3" removeAbandoned="true" maxWait="3000" /&amp;gt;

&amp;lt;/Context&amp;gt;&lt;/pre&gt;

&lt;p&gt;Note that I am using Tomcat's built-in DBCP component (tomcat-dbcp.jar) for the datasource factory, which is based on Apache Commons &lt;a href="http://commons.apache.org/proper/commons-dbcp/"&gt;Database Connection Pools&lt;/a&gt; project. Without a datasource factory, the datasource may not work. Also, note that I didn't specify username or password because I am not using a server-based datasource. In Unix-like systems, you may have to restrict read-write permissions of the database files if you are concerned with security and database integrity. Most likely, the database files shall be readable and writable for "tomcat", and unreadable for other users.&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd;"&gt;chown tomcat:tomcat database.*
chmod 640 database.*&lt;/pre&gt;

&lt;p&gt;I am not sure how different a networked HSQLDB server is from an embedded or standalone HSQLDB database in terms of performance. Probably, a benchmark test is needed to find that out.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/D1IR3qEGzks" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/3446462918130905000/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/setting-up-tomcat-and-roller-with-jndi.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/3446462918130905000?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/3446462918130905000?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/D1IR3qEGzks/setting-up-tomcat-and-roller-with-jndi.html" title="Setting up Tomcat and Roller with a JNDI datasource for standalone HSQLDB" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/setting-up-tomcat-and-roller-with-jndi.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYMQ3k-fip7ImA9WhBbF0k.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-5358325596829176476</id><published>2013-05-16T12:43:00.000-10:00</published><updated>2013-05-16T12:43:02.756-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-16T12:43:02.756-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="tip" /><category scheme="http://www.blogger.com/atom/ns#" term="command" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>rc.local and rc.shutdown</title><content type="html">&lt;p&gt;Scheduling something to run at each boot-time and shutdown is part of the job involved in UNIX system setup and maintenance. On certain UNIX-like systems, such as OpenBSD, the two files /etc/rc.local and /etc/rc.shutdown may be used to perform certain things at every boot/shutdown time.&lt;/p&gt;

&lt;p&gt;To run something at the boot time, include the command in /etc/rc.local, ending the line with ampersand(&amp;amp;). For example,&lt;/p&gt;

&lt;pre style="background-color: #000, color: #ddd"&gt;# /etc/rc.local
start_some_daemon &amp;&lt;/pre&gt;

&lt;p&gt;The ending ampersand (&amp;amp;) is important because you don't want the program to halt the boot process especially if it is a server or daemon. On the other hand, don't use the ampersand (&amp;amp;) in /etc/rc.shutdown because we expect the programs to successfully terminate before bringing down the system.&lt;/p&gt;

&lt;pre style="background-color: #000, color: #ddd"&gt;# /etc/rc.shutdown
kill_some_daemon&lt;/pre&gt;
&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/laIHVvVtNIc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/5358325596829176476/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/rclocal-and-rcshutdown.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/5358325596829176476?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/5358325596829176476?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/laIHVvVtNIc/rclocal-and-rcshutdown.html" title="rc.local and rc.shutdown" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/rclocal-and-rcshutdown.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4FQHw-eip7ImA9WhBbF0k.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-1132859651500875681</id><published>2013-05-16T12:21:00.001-10:00</published><updated>2013-05-16T12:21:51.252-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-16T12:21:51.252-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="tip" /><category scheme="http://www.blogger.com/atom/ns#" term="command" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>Using sleep to execute a command after a certain time</title><content type="html">&lt;p&gt;Although there are traditional commands, &lt;code&gt;at&lt;/code&gt; and &lt;code&gt;batch&lt;/code&gt;, for sophisticated scheduling of jobs and tasks on UNIX-like Linux and *BSD systems, I often use the command &lt;code&gt;sleep&lt;/code&gt; to schedule a job at a certain time in the future. It's really simple. For example, to power off the system after 5 minutes, I would run:&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd"&gt;(sleep 300 &amp;&amp; halt -p) &amp;amp;&lt;/pre&gt;

&lt;p&gt;Notice that there are three ampersands(&amp;amp;). The first two ampersands causes halt to run only after sleep finishes running for 300 seconds (doing nothing). Since I don't want these commands to take up the terminal screen, I surround them with parentheses and end the command line with a single ampersand. Thus, this job is placed in the background, but it is still running for the specified time. In the specified time (300 seconds), the scheduled command (halt -p) will be executed. This type of simple scheduling is useful for minimalist systems with no cron facility. Be creative but be careful with this trick. You may forget about the job, and then some scheduled job does an unexpected thing to you.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/g3OGaPh8dfk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/1132859651500875681/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/using-sleep-to-execute-command-after.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/1132859651500875681?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/1132859651500875681?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/g3OGaPh8dfk/using-sleep-to-execute-command-after.html" title="Using sleep to execute a command after a certain time" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/using-sleep-to-execute-command-after.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QESXg-fip7ImA9WhBbF04.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-8671841581465097317</id><published>2013-05-16T10:15:00.000-10:00</published><updated>2013-05-16T10:15:08.656-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-16T10:15:08.656-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="tip" /><category scheme="http://www.blogger.com/atom/ns#" term="command" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>Enabling power-off at OpenBSD shutdown</title><content type="html">&lt;p&gt;The &lt;code&gt;halt&lt;/code&gt; command is used on &lt;a href="http://openbsd.org"&gt;OpenBSD&lt;/a&gt; to shut down the system, but it doesn't necessarily power off the machine. To allow &lt;code&gt;halt&lt;/code&gt; to turn off the computer during shutdown, you need to set the &lt;code&gt;powerdown&lt;/code&gt; variable to YES in /etc/rc.shutdown file. Open /etc/rc.shutdown in your favorite text editor as root, and locate the line with "powerdown=". Set its value to YES.&lt;/p&gt;

&lt;pre&gt;powerdown=YES&lt;/pre&gt;

&lt;p&gt;Alternatively, you can explicitly tell &lt;code&gt;halt&lt;/code&gt; to turn off the hardware with -p option.&lt;/p&gt;

&lt;pre&gt;halt -p&lt;/pre&gt;

&lt;p&gt;Make sure to close all applications and save your work before turning off the system.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/afb4zq6b0kc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/8671841581465097317/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/enabling-power-off-at-openbsd-shutdown.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8671841581465097317?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8671841581465097317?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/afb4zq6b0kc/enabling-power-off-at-openbsd-shutdown.html" title="Enabling power-off at OpenBSD shutdown" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/enabling-power-off-at-openbsd-shutdown.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQGRno9eip7ImA9WhBbFks.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-300745582381272866</id><published>2013-05-15T14:15:00.001-10:00</published><updated>2013-05-15T14:15:27.462-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-15T14:15:27.462-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="compile" /><category scheme="http://www.blogger.com/atom/ns#" term="web" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat" /><title>To build Tomcat Native library for OpenBSD</title><content type="html">&lt;p&gt;I just installed &lt;a href="http://openbsd.org"&gt;OpenBSD&lt;/a&gt; and I am going to compile Apache &lt;a href="http://tomcat.apache.org/native-doc/index.html"&gt;Tomcat Native&lt;/a&gt;. Hopefully, Tomcat Native will boost &lt;a href="http://tomcat.apache.org"&gt;Tomcat performance&lt;/a&gt;. I downloaded the Tomcat Native source code with ftp.&lt;/p&gt;

&lt;pre&gt;ftp apache.cs.utah.edu&lt;/pre&gt;

&lt;p&gt;It was located in the directory &lt;code&gt;/apache.org/tomcat/tomcat-connectors/native/1.1.27/source&lt;/code&gt;. After downloading the source (tomcat-native-1.1.27-src.tar.gz), I became the super-user to install packages necessary for building Tomcat Native.&lt;/p&gt;

&lt;pre&gt;su&lt;/pre&gt;

&lt;p&gt;Compiling Tomcat Native requires the APR library, OpenSSL and JDK. Luckily, the OpenSSL library is already included in the base system. So I only need to install APR and JDK.&lt;/p&gt;

&lt;pre&gt;export PKG_PATH=ftp://ftp5.usa.openbsd.org/pub/OpenBSD/5.3/packages/i386/
pkg_add -i -v apr
pkg_add -i -v jdk&lt;/pre&gt;

&lt;p&gt;Pkg_add asked me whether I want to install JDK 1.6.0 or JDK 1.7.0. I chose JDK 1.7.0. Additionally, JDK depends on libiconv, so pkg_add fetched and installed libiconv, too. I moved to the /usr/src directory and unpacked the Tomcat Native source.&lt;/p&gt;

&lt;pre&gt;cd /usr/src
tar xzvf tomcat-native-1.1.27-src.tar.gz
cd tomcat-native-1.1.27-src/jni/native&lt;/pre&gt;

&lt;p&gt;Then, I ran the &lt;code&gt;configure&lt;/code&gt; script.&lt;/p&gt;

&lt;pre&gt;./configure --with-apr=/usr/local/bin/apr-1-config&lt;/pre&gt;

&lt;p&gt;Compiling is as easy as running &lt;code&gt;make&lt;/code&gt;. GCC and make are by default included in the base system, too.&lt;/p&gt;

&lt;pre&gt;make
make install&lt;/pre&gt;

&lt;p&gt;The following files are produced at this point.&lt;/p&gt;

&lt;pre&gt;/usr/local/apr/lib/pkgconfig/tcnative-1.pc
/usr/local/apr/lib/libtcnative-1.la
/usr/local/apr/lib/libtcnative-1.a
/usr/local/apr/lib/libtcnative-1.so.1.27&lt;/pre&gt;

&lt;p&gt;I put libtcnative-1.so.1.27 in /usr/local/lib.&lt;/p&gt;

&lt;pre&gt;cp /usr/local/apr/lib/libtcnative-1.so.1.27 /usr/local/lib&lt;/pre&gt;

&lt;p&gt;Then, I created setenv.sh script in /var/tomcat/bin (or /usr/local/tomcat/bin) with the following contents.&lt;/p&gt;

&lt;pre&gt;export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/X11R6/lib&lt;/pre&gt;

&lt;p&gt;At last, I restarted Tomcat.&lt;/p&gt;

&lt;pre&gt;/etc/rc.d/tomcat restart.&lt;/pre&gt;

&lt;p&gt;The log showed me that Tomcat Native Library was successfully loaded.&lt;/p&gt;

&lt;blockquote&gt;May 15, 2013 3:39:27 AM org.apache.catalina.core.AprLifecycleListener init&lt;br/&gt;
INFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.6&lt;/blockquote&gt;

&lt;p&gt;I notice that Tomcat now runs more responsively.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/yJwhZmt5_YM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/300745582381272866/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/to-build-tomcat-native-library-for.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/300745582381272866?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/300745582381272866?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/yJwhZmt5_YM/to-build-tomcat-native-library-for.html" title="To build Tomcat Native library for OpenBSD" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/to-build-tomcat-native-library-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcMQn09cCp7ImA9WhBbFUg.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-951550046435043739</id><published>2013-05-14T08:44:00.001-10:00</published><updated>2013-05-14T08:44:43.368-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-14T08:44:43.368-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="tip" /><category scheme="http://www.blogger.com/atom/ns#" term="command" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="web" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><category scheme="http://www.blogger.com/atom/ns#" term="browser" /><title>Using lynx to download a file</title><content type="html">&lt;p&gt;lynx is a text-mode web browser that can be found on old-school Unix systems, but there are also binaries available for Linux and Windows. Most people won't have a need for lynx because of its archaic text-only interface. But in the worst scenario where no other browsers are available, lynx may help you with your basic Internet task quickly. For instance, I was using &lt;a href="http://openbsd.org"&gt;OpenBSD&lt;/a&gt; and found no browser except lynx in the default installation. I just wanted to download something from the Web quickly. After reading the lynx man page, I found that lynx can be used to save a document from the Web and can even traverse and crawl the Web.&lt;/p&gt;

&lt;p&gt;Here's the command syntax that I used to download a file from the Web.&lt;/p&gt;

&lt;pre&gt;lynx -dump http://some.web.site/file.bin &amp;gt; file.bin&lt;/pre&gt;

&lt;p&gt;To learn more about lynx, read its man page.&lt;/p&gt;

&lt;pre&gt;man lynx&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/5EWsAJUFcNM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/951550046435043739/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/using-lynx-to-download-file.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/951550046435043739?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/951550046435043739?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/5EWsAJUFcNM/using-lynx-to-download-file.html" title="Using lynx to download a file" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/using-lynx-to-download-file.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcMRno7fCp7ImA9WhBbFks.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-3529715265079264537</id><published>2013-05-14T01:11:00.000-10:00</published><updated>2013-05-15T15:18:07.404-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-15T15:18:07.404-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="blog" /><category scheme="http://www.blogger.com/atom/ns#" term="mail" /><category scheme="http://www.blogger.com/atom/ns#" term="javamail" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><category scheme="http://www.blogger.com/atom/ns#" term="roller" /><title>Setting up Roller to have JavaMail send comment notifications via Gmail</title><content type="html">&lt;p&gt;&lt;a href="http://roller.apache.org"&gt;Apache Roller&lt;/a&gt; lets you receive email notifications of blog comments. To enable email notifications, &lt;a href="http://javamail.java.net"&gt;JavaMail&lt;/a&gt; is needed. JavaMail depends on JavaBeans Activation Framework (JAF), so you need to install JAF, too. Assuming you are using Tomcat, download &lt;a href="http://java.net/projects/javamail/downloads/download/javax.mail.jar" rel="nofollow"&gt;javax.mail.jar&lt;/a&gt; and &lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index-135046.html" rel="nofollow"&gt;activation.jar&lt;/a&gt;, and put these files in ${catalina.home}/lib folder. To integrate JavaMail with Apache Roller, follow these steps.&lt;/p&gt;

&lt;p&gt;Put the following lines in roller-custom.properties.&lt;/p&gt;

&lt;pre&gt;mail.configurationType=jndi
mail.jndi.name=mail/Session&lt;/pre&gt;

&lt;p&gt;Assuming that you want to use Gmail SMTP server, put something like this in webapps/roller/META-INF/context.xml file.&lt;/p&gt;

&lt;pre&gt;&amp;lt;Context&amp;gt;
  &amp;lt;Resource name="mail/Session" auth="Container" type="javax.mail.Session"
    password="********"
    mail.debug="true"
    mail.transport.protocol="smtp"
    mail.smtp.auth="true"
    mail.smtp.host="smtp.gmail.com"
    mail.smtp.user="*****@gmail.com"
    mail.smtp.ssl.enable="true"
    mail.smtp.starttls.enable="true"
    mail.smtp.socketFactory.class="com.sun.mail.util.MailSSLSocketFactory"
    mail.smtp.socketFactory.fallback="false"
    mail.smtp.socketFactory.port="465"
    mail.smtp.port="465"
  /&amp;gt;
&amp;lt;/Context&amp;gt;&lt;/pre&gt;

&lt;p&gt;Restart Tomcat. Now test your new settings by making a comment and then checking your email. Hopefully, JavaMail works for you.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/NEPwcFtj0D0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/3529715265079264537/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/setting-up-javamail-to-send-comment.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/3529715265079264537?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/3529715265079264537?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/NEPwcFtj0D0/setting-up-javamail-to-send-comment.html" title="Setting up Roller to have JavaMail send comment notifications via Gmail" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/setting-up-javamail-to-send-comment.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMDQ388fSp7ImA9WhBbFU0.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-167075931821049024</id><published>2013-05-13T18:02:00.000-10:00</published><updated>2013-05-13T18:41:12.175-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-13T18:41:12.175-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="email" /><category scheme="http://www.blogger.com/atom/ns#" term="command" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>Using mailx to send email on OpenBSD</title><content type="html">&lt;p&gt;I was just trying to test sendmail on my &lt;a href="http://openbsd.org"&gt;OpenBSD&lt;/a&gt; computer. &lt;a href="http://www.sendmail.com/sm/open_source/"&gt;Sendmail&lt;/a&gt; is the default mail server on OpenBSD, and it is included in the base system together with &lt;a href="http://apache.org"&gt;Apache&lt;/a&gt; web server. Reading the &lt;a href="http://www.sendmail.com/sm/open_source/docs/"&gt;sendmail manual&lt;/a&gt; was too overwhelming, and I just wanted to find out whether sendmail was working out of box, especially sending out email. With no graphical email client, such as &lt;a href="http://www.mozilla.org/en-US/thunderbird"&gt;Thunderbird&lt;/a&gt;, my options were limited. Fortunately, most Unix-like systems have the &lt;em&gt;mailx&lt;/em&gt; (or simply &lt;em&gt;mail&lt;/em&gt;) program which is a simple console application for reading and writing email.&lt;/p&gt;

&lt;p&gt;Writing email with mailx is easy. On the terminal, just run mailx with the -s option followed by the subject line and  the recipient's email address. For example,&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd"&gt;mailx -s "Meeting tonight" franky@gmail.com&lt;/pre&gt;

&lt;p&gt;Then, type the message right on the terminal. When you're finished writing the message, press Ctrl+D. The mail will be successfully delivered to the recipient's inbox. Editing email message on the terminal is not pleasant because it's not easy to go back and change the previous lines. The simplest solution to that is to save the email message in a text file and type the mailx command with the less-than character (&amp;lt;) followed by the name of the text file. For example,&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd"&gt;mailx -s "Meeting tonight" franky@gmail.com &amp;lt; mail_for_frank.txt&lt;/pre&gt;

&lt;p&gt;I haven't tested mailx for checking email since I don't have need for that yet. Anyway, I think mailx is a quick and handy tool for sending email.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/B8DyMbYjBaw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/167075931821049024/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/using-mailx-to-send-email-on-openbsd.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/167075931821049024?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/167075931821049024?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/B8DyMbYjBaw/using-mailx-to-send-email-on-openbsd.html" title="Using mailx to send email on OpenBSD" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/using-mailx-to-send-email-on-openbsd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UNQn87cSp7ImA9WhBbE0Q.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-8431107968423646329</id><published>2013-05-12T10:41:00.002-10:00</published><updated>2013-05-12T10:41:33.109-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-12T10:41:33.109-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="blog" /><category scheme="http://www.blogger.com/atom/ns#" term="customization" /><category scheme="http://www.blogger.com/atom/ns#" term="roller" /><title>Fix Comment Form in Fauxcoly theme for Apache Roller</title><content type="html">&lt;p&gt;I am running &lt;a href="http://roller.apache.org"&gt;Apache Roller&lt;/a&gt; for my personal blog, and I'm using the &lt;a href="http://rollerweblogger.org/roller/entry/more_about_the_theme" rel="nofollow"&gt;Fauxcoly&lt;/a&gt; theme which is included in the default Roller installation. I found that there were several obsolete codes in the Fauxcoly theme. One of the annoyances in the Fauxcoly theme is the broken comment form. Without fixing the Fauxcoly theme, you'll always see the message: "Comment is closed for this entry."&lt;/p&gt;

&lt;p&gt;I assume that you have created a custom theme from Fauxcoly &amp;mdash; you can't change the shared themes. At the Design &amp;gt; Templates page for your blog, select the Entry template. Find the section with a showWeblogEntryComments macro. Make the following changes.&lt;/p&gt;

&lt;pre&gt;#if ($model.weblogEntry.permalink)
    #showWeblogEntryComments($model.weblogEntry)
    #showWeblogEntryCommentForm($model.weblogEntry)
#end&lt;/pre&gt;

&lt;p&gt;Save the template. Reload your blog entry in the browser and you will be able to read and post comments. I hope that the next Roller release comes with updated and working themes.&lt;/p&gt;

&lt;h4&gt;Also Read&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/2013/05/encoding-current-post-url-in-apache.html"&gt;Encoding the Current Post URL in Apache Roller&lt;/a&gt;
&lt;li&gt;&lt;a href="/2013/04/installing-and-setting-up-apache-roller.html"&gt;Installing and Setting Up Apache Roller on Windows&lt;/a&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/LJnf68vRvK4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/8431107968423646329/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/fix-comment-form-in-fauxcoly-theme-for.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8431107968423646329?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8431107968423646329?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/LJnf68vRvK4/fix-comment-form-in-fauxcoly-theme-for.html" title="Fix Comment Form in Fauxcoly theme for Apache Roller" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/fix-comment-form-in-fauxcoly-theme-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cBRHs7fSp7ImA9WhBbE08.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-1289424124581550247</id><published>2013-05-11T15:10:00.002-10:00</published><updated>2013-05-11T15:10:55.505-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-11T15:10:55.505-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="blog" /><category scheme="http://www.blogger.com/atom/ns#" term="theme" /><category scheme="http://www.blogger.com/atom/ns#" term="customization" /><category scheme="http://www.blogger.com/atom/ns#" term="roller" /><title>Encoding the Current Post URL in Apache Roller</title><content type="html">&lt;p&gt;Once you install &lt;a href="http://roller.apache.org"&gt;Apache Roller&lt;/a&gt;, you'll probably want to customize the templates of your blog theme. Roller themes use the theme language based on the &lt;a href="http://velocity.apache.org"&gt;Apache Velocity&lt;/a&gt; project. The first thing I did when I was designing my Roller theme was to read the &lt;a href="http://archive.apache.org/dist/roller/roller-3/v3.1.0/docs/roller-template-guide.pdf"&gt;Roller template guide&lt;/a&gt;. However, the guide wasn't very easy to understand for me at first. It was a bit confusing.&lt;/p&gt;

&lt;p&gt;I wanted to insert a code into the &lt;em&gt;Entry&lt;/em&gt; template that will show the URL of the current blog post. After some digging, I found it. Here's the code.&lt;/p&gt;

&lt;pre&gt;$model.weblogEntry.permalink&lt;/pre&gt;

&lt;p&gt;If you want to use the URL returned by the code as a parameter of another URL, you need to encode it. Here's the code for doing that.&lt;/p&gt;

&lt;pre&gt;$utils.encode($model.weblogEntry.permalink)&lt;/pre&gt;

&lt;p&gt;I am still new to Apache Roller and its theme language. I don't think it's too complicated. For now, I just want to customize the &lt;a href="http://rollerweblogger.org/roller/entry/more_about_the_theme" rel="nofollow"&gt;Fauxcoly&lt;/a&gt; theme I am using.&lt;/p&gt;

&lt;h4&gt;Also Read&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/2013/04/installing-and-setting-up-apache-roller.html"&gt;Installing and Setting Up Apache Roller on Windows&lt;/a&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/YeaapjPHobc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/1289424124581550247/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/encoding-current-post-url-in-apache.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/1289424124581550247?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/1289424124581550247?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/YeaapjPHobc/encoding-current-post-url-in-apache.html" title="Encoding the Current Post URL in Apache Roller" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/encoding-current-post-url-in-apache.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YMR385cCp7ImA9WhBbEEg.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-7869927024218762269</id><published>2013-05-07T22:42:00.000-10:00</published><updated>2013-05-08T12:13:06.128-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-08T12:13:06.128-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="cross-compile" /><category scheme="http://www.blogger.com/atom/ns#" term="x.org" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw-w64" /><category scheme="http://www.blogger.com/atom/ns#" term="compile" /><category scheme="http://www.blogger.com/atom/ns#" term="computer" /><category scheme="http://www.blogger.com/atom/ns#" term="x-windows" /><title>To Cross-compile X.org server with MinGW-w64 on Linux (part 3)</title><content type="html">&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Install xcb-proto.&lt;/p&gt;
&lt;pre&gt;cd /var/tmp
wget http://xcb.freedesktop.org/dist/xcb-proto-1.8.tar.bz2
tar xjvf xcb-proto-1.8.tar.bz2
cd xcb-proto-1.8
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make install&lt;/pre&gt;

&lt;p&gt;Compiling libxcb requires xsltproc, so I installed the xsltproc package.&lt;/p&gt;

&lt;pre&gt;apt-get install xsltproc&lt;/pre&gt;

&lt;p&gt;Then, compile libxcb.&lt;/p&gt;

&lt;pre&gt;cd /var/tmp
wget http://xcb.freedesktop.org/dist/libxcb-1.9.tar.bz2
tar xjvf libxcb-1.9.tar.bz2
cd libxcb-1.9
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw LIBS='-lpthreadGC2 -lws2_32'
make
make install&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Build libX11.&lt;/p&gt;

&lt;pre&gt;cd /var/tmp
wget http://ftp.x.org/pub/individual/lib/libX11-1.5.0.tar.bz2
tar xjvf libX11-1.5.0.tar.bz2
cd libX11-1.5.0
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;
&lt;/li&gt;
&lt;p&gt;I got the following error. Apparently, mingw won't tolerate codes containing "Private." I changed Private to _Private in winioctl.h.&lt;/p&gt;
&lt;pre&gt;  CC     imTrans.lo
In file included from imTrans.c:59:0:
/mingw/include/X11/Xtrans/Xtrans.h:447:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
In file included from /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/winscard.h:11:0,
                 from /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/windows.h:85,
                 from /mingw/include/X11/Xwindows.h:71,
                 from imTrans.c:66:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/winioctl.h:1667:8: error: expected identifier or '(' before 'static'
make[3]: *** [imTrans.lo] Error 1
make[3]: Leaving directory `/var/tmp/libX11-1.5.0/modules/im/ximcp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/libX11-1.5.0/modules/im'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/libX11-1.5.0/modules'
make: *** [all-recursive] Error 1&lt;/pre&gt;
&lt;p&gt;Another error occurred with makekeys. I opened another terminal and manually built makekeys&lt;/p&gt;
&lt;pre&gt;cd /var/tmp/libX11-1.5.0/src/util/
gcc-4.7 -I/mingw/include -I/var/tmp/libX11-1.5.0/include -o makekeys-makekeys.o -c makekeys.c
gcc-4.7 -o makekeys makekeys-makekeys.o
cp makekeys makekeys.exe&lt;/pre&gt;

&lt;p&gt;If you get a "dlfcn.h not found" error, download the precompiled dlfcn-win32 static library from &lt;a href="http://code.google.com/p/dlfcn-win32/"&gt;here&lt;/a&gt; and unpack it into your MinGW folder.&lt;/p&gt;
&lt;pre&gt;cd /mingw
tar xjvf /var/tmp/dlfcn-win32-static-r19.tar.bz2
cd //var/tmp/libX11-1.5.0
make LIBS='-ldl'
make install&lt;/pre&gt;

&lt;p&gt;I had to generate libX11-6.dll manually.&lt;/p&gt;
&lt;pre&gt;cd /mingw/lib
i686-w64-mingw32-gcc -shared -o libX11-6.dll -Wl,--out-implib,libX11.dll.a -Wl,--whole-archive libX11.a -Wl,--no-whole-archive -L/mingw/lib -lX11-xcb -lxcb -lpthreadGC2 -lXau -lXdmcp -ldl -L/usr/i686-w64-mingw32/lib -lws2_32
mv libX11-6.dll /mingw/bin&lt;/pre&gt;

&lt;p&gt;Then, edit libX11.la.&lt;/p&gt;
&lt;pre&gt;# The name that we can dlopen(3).
dlname='../bin/libX11-6.dll'

# Names of this library.
library_names='libX11.dll.a'&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Compile libXfont.&lt;/p&gt;
&lt;pre&gt;cd /var/tmp
wget http://ftp.x.org/pub/individual/lib/libXfont-1.4.5.tar.bz2
tar xjvf libXfont-1.4.5.tar.bz2
cd libXfont-1.4.5
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;
&lt;p&gt;The shared library of libXfont was not made, but I don't need it right now.&lt;/p&gt;

&lt;li&gt;&lt;p&gt;Compile libxkbfile.&lt;/p&gt;

&lt;pre&gt;cd /var/tmp
wget http://ftp.x.org/pub/individual/lib/libxkbfile-1.0.8.tar.bz2
tar xjvf libxkbfile-1.0.8.tar.bz2
cd libxkbfile-1.0.8
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;
&lt;p&gt;The shared library of libxkbfile was not make, but I don't need it right now.&lt;/p&gt;

&lt;li&gt;Build libXext.

&lt;pre&gt;cd /var/tmp
wget http://ftp.x.org/pub/individual/lib/libXext-1.3.1.tar.bz2
tar xjvf libXext-1.3.1.tar.bz2
cd libXext-1.3.1
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;

To create libXext-6.dll, I typed:

&lt;pre&gt;cd /mingw/lib
i686-w64-mingw32-gcc -shared -o libXext-6.dll -Wl,--out-implib,libXext.dll.a -Wl,--whole-archive libXext.a -Wl,--no-whole-archive -L/mingw/lib -lX11-xcb -lxcb -lpthreadGC2 -lX11 -lXau -lXdmcp -ldl -L/usr/i686-w64-mingw32/lib -lws2_32
mv libXext-6.dll /mingw/bin&lt;/pre&gt;
&lt;p&gt;Then, I modified 2 lines in /mingw/lib/libXext.la.&lt;/p&gt;
&lt;pre&gt;dlname='../bin/libXext-6.dll'
library_names='libXext.dll.a'&lt;/pre&gt;

&lt;li&gt;Build libWindowsWM.

&lt;pre&gt;cd /var/tmp
wget http://ftp.x.org/pub/individual/lib/libWindowsWM-1.0.1.tar.bz2
tar xjvf libWindowsWM-1.0.1.tar.bz2
cd libWindowsWM-1.0.1
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;

&lt;li&gt;Build makedepend.

&lt;pre&gt;tar xjvf makedepend-1.0.4.tar.bz2
cd makedepend-1.0.4
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;


&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/svQWXsHnRAA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/7869927024218762269/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/to-cross-compile-xorg-server-with-mingw_7.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/7869927024218762269?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/7869927024218762269?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/svQWXsHnRAA/to-cross-compile-xorg-server-with-mingw_7.html" title="To Cross-compile X.org server with MinGW-w64 on Linux (part 3)" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/to-cross-compile-xorg-server-with-mingw_7.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcNRHc_eip7ImA9WhBUGUU.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-2508947080585628865</id><published>2013-05-07T18:24:00.000-10:00</published><updated>2013-05-07T18:24:55.942-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-07T18:24:55.942-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="cross-compile" /><category scheme="http://www.blogger.com/atom/ns#" term="x.org" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw-w64" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="compile" /><category scheme="http://www.blogger.com/atom/ns#" term="computer" /><category scheme="http://www.blogger.com/atom/ns#" term="x-windows" /><title>To Cross-compile X.org Server with MinGW-w64 on Linux (Part 2)</title><content type="html">&lt;p&gt;I am continuing cross-compilation of X.org server for Windows.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;From http://ftp.x.org/pub/individual/proto, download the following tarballs.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;bigreqsproto-1.1.2.tar.bz2
&lt;li&gt;compositeproto-0.4.2.tar.bz2
&lt;li&gt;damageproto-1.2.1.tar.bz2
&lt;li&gt;fixesproto-5.0.tar.bz2
&lt;li&gt;fontsproto-2.1.2.tar.bz2
&lt;li&gt;glproto-1.4.16.tar.bz2
&lt;li&gt;inputproto-2.2.tar.bz2
&lt;li&gt;kbproto-1.0.6.tar.bz2
&lt;li&gt;randrproto-1.2.2.tar.bz2
&lt;li&gt;recordproto-1.14.2.tar.bz2
&lt;li&gt;renderproto-0.11.1.tar.bz2
&lt;li&gt;resourceproto-1.2.0.tar.bz2
&lt;li&gt;scrnsaverproto-1.2.2.tar.bz2
&lt;li&gt;windowswmproto-1.0.4.tar.bz2
&lt;li&gt;xcmiscproto-1.2.2.tar.bz2
&lt;li&gt;xextproto-7.2.1.tar.bz2
&lt;li&gt;xineramaproto-1.2.1.tar.bz2
&lt;li&gt;xproto-7.0.23.tar.bz2 
&lt;/ul&gt;

&lt;p&gt;Install each of them like this.&lt;/p&gt;

&lt;pre style="background-color: #000; color: #ddd;"&gt;./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make install&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;From http://ftp.x.org/pub/individual/lib, download the following files.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;libXau-1.0.7.tar.bz2
&lt;li&gt;libfontenc-1.1.1.tar.bz2
&lt;li&gt;xtrans-1.2.7.tar.bz2 
&lt;/ul&gt;
&lt;p&gt;Compile each of them like this.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;From http://ftp.x.org/pub/individual/lib, download libXdmcp and compile it like this.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;cd /var/tmp
wget http://ftp.x.org/pub/individual/lib/libXdmcp-1.1.1.tar.bz2
tar xjvf libXdmcp-1.1.1.tar.bz2
cd libXdmcp-1.1.1
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make LIBS='-lws2_32'
make install&lt;/pre&gt;
&lt;p&gt;I got the following error during compile time.&lt;/p&gt;
&lt;pre&gt;make[2]: Entering directory `/var/tmp/libXdmcp-1.1.1'
  CC     Fill.lo
In file included from /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/windows.h:59:0,
                 from /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/winsock2.h:23,
                 from /mingw/include/X11/Xwinsock.h:55,
                 from Fill.c:43:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/windef.h:105:13: error: conflicting types for 'BOOL'
/mingw/include/X11/Xmd.h:145:16: note: previous declaration of 'BOOL' was here
make[2]: *** [Fill.lo] Error 1
make[2]: Leaving directory `/var/tmp/libXdmcp-1.1.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/libXdmcp-1.1.1'
make: *** [all] Error 2&lt;/pre&gt;
&lt;p&gt;To fix it, I changed "typedef CARD8 BOOL" to "typedef int BOOL" in /mingw/include/X11/Xmd.h.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Compile pthreads-win32.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;cd /var/tmp
wget ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.tar.gz
tar xzvf pthreads-w32-2-9-1-release.tar.gz
cd pthreads-w32-2-9-1-release
make GC
cp -iv pthreadGC2.dll /mingw/bin
cp -iv pthread.h semaphore.h sched.h /mingw/include/
cp -iv libpthreadGC2.a /mingw/lib&lt;/pre&gt;
&lt;p&gt;Then, compile libpthread-stubs.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;cd /var/tmp
wget http://xcb.freedesktop.org/dist/libpthread-stubs-0.3.tar.bz2
tar xjvf libpthread-stubs-0.3.tar.bz2
cd libpthread-stubs-0.3
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw LIBS='-lpthreadGC2'
make
make install&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I am going to take a break and continue later in the next post.&lt;/p&gt;

&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/Wy4jhe7LvPU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/2508947080585628865/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/to-cross-compile-xorg-server-with-mingw.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/2508947080585628865?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/2508947080585628865?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/Wy4jhe7LvPU/to-cross-compile-xorg-server-with-mingw.html" title="To Cross-compile X.org Server with MinGW-w64 on Linux (Part 2)" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/to-cross-compile-xorg-server-with-mingw.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAHQ307fip7ImA9WhBUGUo.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-2352532197163021353</id><published>2013-05-07T14:19:00.000-10:00</published><updated>2013-05-07T14:25:32.306-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-07T14:25:32.306-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="cross-compile" /><category scheme="http://www.blogger.com/atom/ns#" term="x.org" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw-w64" /><category scheme="http://www.blogger.com/atom/ns#" term="compile" /><category scheme="http://www.blogger.com/atom/ns#" term="computer" /><category scheme="http://www.blogger.com/atom/ns#" term="x-windows" /><title>To Cross-compile X.org Server on Linux-hosted MinGW-w64 (Part 1)</title><content type="html">&lt;p&gt;This is my latest attempt at building a native Windows build of &lt;a href="http://www.x.org"&gt;X.org&lt;/a&gt; server on the Linux platform. I am running &lt;a href="http://www.debian.org"&gt;Debian&lt;/a&gt; Sid on a virtual RAM disk. I prepared my build environment following &lt;a href="/2013/02/setting-up-mingw-w64-on-linux.html"&gt;this post&lt;/a&gt;. Then, I followed &lt;a href="/2013/01/compiling-xming-with-mingw.html"&gt;this post&lt;/a&gt; to cross-compile X.org.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The first step I took was setting up MinGW on my Debian box. I installed bison, flex, g++-mingw-w64-i686, gettext, libtool, make, patch and pkg-config. Apt-get also installed additional packages resulting in 271MB increase in used disk storage, but that's alright as I am working in volatile memory.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;apt-get update
apt-get install bison flex g++-mingw-w64-i686 gettext libtool make patch pkg-config&lt;/pre&gt;
&lt;p&gt;Then, I created a new directory /mingw.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;mkdir /mingw&lt;/pre&gt;
&lt;p&gt;I created simple symbolic links in /mingw/bin that points to MinGW executables in /usr/bin.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;mkdir /mingw/bin
cd /mingw/bin
ln -s /usr/bin/i686-w64-mingw32-* .
rename 's/^i686-w64-mingw32-//' *&lt;/pre&gt;
&lt;p&gt;Then, I added /mingw/bin to the PATH environment variable.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;export PATH="/mingw/bin:$PATH"&lt;/pre&gt;
&lt;p&gt;Then, I typed these commands to define environment variables necessary for compiling with MinGW.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;export CC='/usr/bin/i686-w64-mingw32-gcc -I/mingw/include -I/usr/i686-w64-mingw32/include'
export CPP='/usr/bin/i686-w64-mingw32-cpp -I/mingw/include -I/usr/i686-w64-mingw32/include'
export CXX='/usr/bin/i686-w64-mingw32-g++'
export CXXCPP='/mingw/bin/i686-w64-mingw32-g++ -E'
export CFLAGS='-mtune=pentium3 -mthreads -mms-bitfields -O3'
export CXXFLAGS='-mtune=pentium3 -mthreads -mms-bitfields -O3'
export LDFLAGS='-L/mingw/lib -L/usr/i686-w64-mingw32/lib -L/usr/lib/gcc/i686-w64-mingw32/4.6'
export PKG_CONFIG_PATH=/mingw/lib/pkgconfig&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Next, I compiled &lt;a href="http://zlib.net"&gt;zlib&lt;/a&gt;.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd; overflow: scroll;"&gt;cd /var/tmp
wget http://zlib.net/zlib-1.2.8.tar.gz
tar xzvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
make -f win32/Makefile.gcc CC=i686-w64-mingw32-gcc RC=i686-w64-mingw32-windres
make -f win32/Makefile.gcc install BINARY_PATH=/mingw/bin INCLUDE_PATH=/mingw/include LIBRARY_PATH=/mingw/lib SHARED_MODE=1&lt;/pre&gt;
&lt;p&gt;Then, I created /mingw/lib/libz.la:&lt;/p&gt;
&lt;pre style="height: 160px;overflow: scroll;"&gt;# libz.la - a libtool library file
# Generated by ltmain.sh (GNU libtool) 2.2.6b
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='../bin/zlib1.dll'

# Names of this library.
library_names='libz.dll.a'

# The name of the static archive.
old_library='libz.a'

# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''

# Libraries that this one depends upon.
dependency_libs=''

# Names of additional weak libraries provided by this library
weak_library_names=''

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/mingw/lib'&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Then, I compiled libiconv.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;cd /var/tmp
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar xzvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Next, I compiled freetype.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;cd /var/tmp
tar xjvf freetype-2.4.11.tar.bz2
cd freetype-2.4.11
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make&lt;/pre&gt;
&lt;p&gt;Compilation halted with the following message.&lt;/p&gt;
&lt;pre&gt;/var/tmp/freetype-2.4.11/objs/apinames: /var/tmp/freetype-2.4.11/objs/apinames: cannot execute binary file
make: *** [/var/tmp/freetype-2.4.11/objs/ftexport.sym] Error 126&lt;/pre&gt;
&lt;p&gt;Apparently, Linux couldn't run apinames because it's a win32 executable. I had to compile a Linux binary of apinames. I opened another terminal and ran these commands.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;cd /var/tmp/freetype-2.4.11
/usr/bin/gcc-4.7 -o objs/apinames src/tools/apinames.c&lt;/pre&gt;
&lt;p&gt;Then, I continued compiling freetype.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;make
make install&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Next, I compiled pixman.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;cd /var/tmp
wget http://cairographics.org/releases/pixman-0.28.2.tar.gz
tar xzvf pixman-0.28.2.tar.gz
cd pixman-0.28.2
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make
make install&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Then, I installed util-macros.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;cd /var/tmp
wget http://ftp.x.org/pub/individual/util/util-macros-1.17.tar.bz2
tar xjvf util-macros-1.17.tar.bz2
cd util-macros-1.17
./configure --build=i486-linux-gnu --host=i686-w64-mingw32 --prefix=/mingw
make install&lt;/pre&gt;
&lt;p&gt;util-macros.pc was installed in /mingw/share/pkgconfig. So I set PKG_CONFIG_PATH like this.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd;"&gt;export PKG_CONFIG_PATH=/mingw/lib/pkgconfig:/mingw/share/pkgconfig&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I am going to take a break and continue in the next post.&lt;/p&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/vLM_rFsBysM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/2352532197163021353/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/to-cross-compile-xorg-server-on-linux.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/2352532197163021353?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/2352532197163021353?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/vLM_rFsBysM/to-cross-compile-xorg-server-on-linux.html" title="To Cross-compile X.org Server on Linux-hosted MinGW-w64 (Part 1)" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/to-cross-compile-xorg-server-on-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YHR3c8cCp7ImA9WhBUGUs.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-7856108254593089086</id><published>2013-05-07T00:04:00.000-10:00</published><updated>2013-05-07T12:18:56.978-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-07T12:18:56.978-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw" /><category scheme="http://www.blogger.com/atom/ns#" term="gcc" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw-w64" /><category scheme="http://www.blogger.com/atom/ns#" term="installation" /><category scheme="http://www.blogger.com/atom/ns#" term="howto" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="guide" /><category scheme="http://www.blogger.com/atom/ns#" term="cygwin" /><category scheme="http://www.blogger.com/atom/ns#" term="setup" /><category scheme="http://www.blogger.com/atom/ns#" term="computer" /><title>Installing GCC 4.8.0 from MinGW-builds project</title><content type="html">&lt;p&gt;&lt;a href="http://gcc.gnu.org"&gt;GCC&lt;/a&gt; 4.8.0 is the latest release of the open-source compiler suite, and I am going to install its win32 build from the &lt;a href="http://sourceforge.net/projects/mingwbuilds/"&gt;MinGW-builds&lt;/a&gt; project. I downloaded the file &lt;a href="http://iweb.dl.sourceforge.net/project/mingwbuilds/host-windows/releases/4.8.0/32-bit/threads-posix/dwarf/x32-4.8.0-release-posix-dwarf-rev2.7z"&gt;x32-4.8.0-release-posix-dwarf-rev2.7z&lt;/a&gt; and unpacked it directly into C: drive.&lt;/p&gt;

&lt;div style="text-align: center"&gt;&lt;a href="http://farm8.staticflickr.com/7446/8716131291_255217ed58_d.jpg" rel="nofollow"&gt;&lt;img src="http://farm8.staticflickr.com/7446/8716131291_255217ed58_d.jpg" alt="mingw-w64 win32 build from MinGW-builds project" title="mingw-w64 win32 build from MinGW-builds project" style="padding: 10px" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;Then, I installed &lt;a href="http://www.cygwin.com"&gt;Cygwin&lt;/a&gt; instead of &lt;a href="/2012/11/manual-installation-of-msys.html"&gt;MSYS&lt;/a&gt; for the Unix-like environment I'll use to compile programs. Using the Cygwin &lt;a href="http://cygwin.com/setup.exe"&gt;setup&lt;/a&gt; program, I installed the following Cygwin packages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bison
&lt;li&gt;flex
&lt;li&gt;gettext-devel
&lt;li&gt;libtool
&lt;li&gt;make
&lt;li&gt;patch
&lt;li&gt;pkg-config
&lt;/ul&gt;

&lt;p&gt;Then, I edited the file C:\cygwin\etc\fstab and added the following lines.&lt;/p&gt;

&lt;pre&gt;none / cygdrive binary,posix=0,user 0 0
C:/mingw32 /mingw none binary&lt;/pre&gt;

&lt;p&gt;Next, I started the Cygwin Terminal &amp;mdash; just to have my home folder created. I opened .bashrc (C:\cygwin\home\joe\.bashrc) with &lt;a href="http://notepad-plus-plus.org/"&gt;notepad++&lt;/a&gt;, deleted all the commented crap and wrote the following:&lt;/p&gt;

&lt;pre style="overflow: scroll;"&gt;export CC='/mingw/bin/i686-w64-mingw32-gcc.exe -I/mingw/include -I/mingw/i686-w64-mingw32/include'
export CPP='/mingw/bin/cpp.exe -I/mingw/include -I/mingw/i686-w64-mingw32/include'
export CXX='/mingw/bin/i686-w64-mingw32-g++.exe -I/mingw/lib/gcc/i686-w64-mingw32/4.8.0/include/c++ -I/mingw/lib/gcc/i686-w64-mingw32/4.8.0/include/c++/i686-w64-mingw32'
export CXXCPP='/mingw/bin/i686-w64-mingw32-g++.exe -E'
export CFLAGS='-mtune=pentium3 -mthreads -mms-bitfields -O3'
export CXXFLAGS='-mtune=pentium3 -mthreads -mms-bitfields -O3'
export LDFLAGS='-L/mingw/lib -L/mingw/i686-w64-mingw32/lib -L/mingw/lib/gcc/i686-w64-mingw32/4.8.0'
export PATH=/mingw/bin:/mingw/i686-w64-mingw32/bin:/mingw/opt/bin:/mingw/libexec/gcc/i686-w64-mingw32/4.8.0:/usr/bin
export PKG_CONFIG_PATH=/mingw/lib/pkgconfig&lt;/pre&gt;

&lt;p&gt;I saved my .bashrc file and typed this command to renew the settings:&lt;/p&gt;

&lt;pre&gt;source .bashrc&lt;/pre&gt;

&lt;p&gt;Now, I am ready to compile something. Let's write a simple "Hello" c++ code. I saved this code as hello.cxx.&lt;/p&gt;

&lt;pre&gt;#include &amp;lt;iostream&amp;gt;
using namespace std;

int main()
{
  cout &amp;lt;&amp;lt; "Hello, boys and girls.\n";
  return 0;
}&lt;/pre&gt;

&lt;p&gt;Then, I ran g++ in Cygwin Terminal to compile the Hello program.&lt;/p&gt;

&lt;pre style="background-color: #000; color: #DDD;"&gt;g++.exe -o hello.exe hello.cxx&lt;/pre&gt;

&lt;p&gt;If everything was correctly set up, then the hello.exe program will say Hello on the Terminal screen when you run it.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/22IPKyhs9z4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/7856108254593089086/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/installing-gcc-480-from-mingw-builds.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/7856108254593089086?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/7856108254593089086?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/22IPKyhs9z4/installing-gcc-480-from-mingw-builds.html" title="Installing GCC 4.8.0 from MinGW-builds project" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/installing-gcc-480-from-mingw-builds.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAMRXgzfyp7ImA9WhBUGE8.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-7252460488689242837</id><published>2013-05-05T14:10:00.004-10:00</published><updated>2013-05-05T21:03:04.687-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-05T21:03:04.687-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="network" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="setup" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>Connecting to the Internet on OpenBSD</title><content type="html">&lt;p&gt;To set up Internet on &lt;a href="http://www.openbsd.org"&gt;OpenBSD&lt;/a&gt;, you need to create or edit some text files in the /etc directory. I'll write a few tips on OpenBSD networking in this post, and add some more later. Firstly, you need to know the name of your network interface card. Just type "ifconfig" and you'll find it in the output.&lt;/p&gt;

&lt;pre style="background-color: #000, color: #DDD"&gt;$ &lt;span style="color: #F03"&gt;ifconfig&lt;/span&gt;
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 33196
        priority: 0
        groups: lo
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet 127.0.0.1 netmask 0xff000000
nfe0: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt; mtu 1500
        lladdr 00:e0:18:d6:67:a7
        priority: 0
        media: Ethernet autoselect (none)
        status: no carrier
        inet6 fe80::2e0:18ff:fed6:67a7%nfe0 prefixlen 64 scopeid 0x1
enc0: flags=0&amp;lt;&amp;gt;
        priority: 0
        groups: enc
        status: active
pflog0: flags=141&amp;lt;UP,RUNNING,PROMISC&amp;gt; mtu 33196
        priority: 0
        groups: pflog&lt;/pre&gt;

&lt;p&gt;In the example output above, nfe0 is the device name for the Ethernet card. Since most people use a router or have a DHCP server running somewhere in the network, you can simply run dhclient to connect to the Internet instantly.&lt;/p&gt;

&lt;pre style="background-color: #000, color: #DDD"&gt;dhclient nfe0&lt;/pre&gt;

&lt;p&gt;To set up OpenBSD to have automatic connection, create a text file in the /etc directory whose name is "hostname" plus the network device name as extension. For example, I have a "NVIDIA nForce2 LAN" onboard NIC that OpenBSD calls nfe0. To configure it, I create a file "hostname.nfe0" in /etc. All I need to write in the file is the word "dhcp".&lt;/p&gt;

&lt;pre&gt;# Contents of /etc/hostname.nfe0
dhcp&lt;/pre&gt;

&lt;p&gt;To manually assign an IP to a network interface, put in the hostname file something like the following:&lt;/p&gt;

&lt;pre&gt;# Contents of /etc/hostname.xl0
inet 192.168.0.16 255.255.255.0 192.168.0.255
!route add default 192.168.0.1&lt;/pre&gt;

&lt;p&gt;The contents of "hostname.xl0" file shown above illustrates how we can set up a "3Com 3c9201 100Base-TX" card to automatically have a static IPv4 address (192.168.0.16) and a default route at 192.168.0.1.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/mBjdOmqPkUg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/7252460488689242837/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/connecting-to-internet-on-openbsd.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/7252460488689242837?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/7252460488689242837?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/mBjdOmqPkUg/connecting-to-internet-on-openbsd.html" title="Connecting to the Internet on OpenBSD" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/connecting-to-internet-on-openbsd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8NQHc7eSp7ImA9WhBaEkg.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-6106183730328456124</id><published>2013-05-05T00:06:00.000-10:00</published><updated>2013-05-22T10:18:11.901-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-22T10:18:11.901-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="server" /><category scheme="http://www.blogger.com/atom/ns#" term="installation" /><category scheme="http://www.blogger.com/atom/ns#" term="setup" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="web" /><category scheme="http://www.blogger.com/atom/ns#" term="tomcat" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>Installing Tomcat on OpenBSD</title><content type="html">&lt;p&gt;To install &lt;a href="http://tomcat.apache.org"&gt;Tomcat&lt;/a&gt; on &lt;a href="http://openbsd.org"&gt;OpenBSD&lt;/a&gt;, I took the following steps.&lt;/p&gt; 

&lt;ol&gt;

&lt;li&gt;&lt;p&gt;Define the PKG_PATH environment variable so that pkg_add can find and fetch packages from an &lt;a href="http://openbsd.org/ftp.html"&gt;OpenBSD mirror&lt;/a&gt;.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd"&gt;export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/5.3/packages/i386/&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Run pkg_add to install jre or jdk.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd"&gt;pkg_add -i -v jre&lt;/pre&gt;

&lt;p&gt;You'll be asked to choose the version 1.6 or 1.7 of JRE/JDK.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Then, run pkg_add again to install tomcat.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd"&gt;pkg_add -i -v tomcat&lt;/pre&gt;
&lt;p&gt;You'll be allowed to choose version 6 or 7 of tomcat.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Add the following line to /etc/rc.conf.local so that tomcat always runs.&lt;/p&gt;
&lt;pre&gt;pkg_scripts=tomcat&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Start tomcat.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #ddd"&gt;/etc/rc.d/tomcat start&lt;/pre&gt;&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;I did these things to files under /etc/tomcat.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Locate every Connector line in /etc/tomcat/server.xml and add URIEncoding="UTF-8" to the end of the connecor lines.&lt;/p&gt;

&lt;pre&gt;    &amp;lt;Connector address="0.0.0.0" port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" &lt;span style="color: #f03"&gt;URIEncoding="UTF-8"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Open /etc/tomcat/catalina.policy with vi and uncomment the following lines:&lt;/p&gt;
&lt;pre&gt;// If using a per instance lib directory, i.e. ${catalina.base}/lib,
// then the following permission will need to be uncommented
// grant codeBase "file:${catalina.base}/lib/-" {
&lt;span style="color: #F03;"&gt;         permission java.security.AllPermission;
 };&lt;/span&gt;&lt;/pre&gt;
&lt;/ul&gt;

&lt;h4&gt;Also Read&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/2013/05/to-build-tomcat-native-library-for.html"&gt;To build Tomcat Native library for OpenBSD&lt;/a&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/3Tgt0s2f4xI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/6106183730328456124/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/installing-tomcat-on-openbsd.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/6106183730328456124?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/6106183730328456124?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/3Tgt0s2f4xI/installing-tomcat-on-openbsd.html" title="Installing Tomcat on OpenBSD" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/installing-tomcat-on-openbsd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcARnc8fip7ImA9WhBUF08.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-8409276826272433921</id><published>2013-05-04T17:54:00.000-10:00</published><updated>2013-05-04T17:54:07.976-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-04T17:54:07.976-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="password" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="tip" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>Using urandom device to create passwords, WPA keys, etc.</title><content type="html">&lt;p&gt;urandom is a special device found on Linux and *BSD that serves as a random number generator. We can use urandom to create a relatively strong password that is not found in dictionaries. Here's the command I commonly use to generate a password or WPA key.&lt;/p&gt;

&lt;pre&gt;cat /dev/urandom | tr -dc 'a-zA-Z0-9._' | head -c 16; echo&lt;/pre&gt;

&lt;p&gt;This command creates a 16-digit password made of letters randomly chosen from a set of alphabet, numbers, the dot (.) and the underscore (_). I think 16 digit is a reasonable length, but you can increase it to longer digits. If you are not satisfied with the first result, run the command again and you'll get another random result.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/50G4L_vLTy0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/8409276826272433921/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/using-urandom-device-to-create.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8409276826272433921?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8409276826272433921?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/50G4L_vLTy0/using-urandom-device-to-create.html" title="Using urandom device to create passwords, WPA keys, etc." /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/using-urandom-device-to-create.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAFSXs5eyp7ImA9WhBUFks.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-5509299997541398793</id><published>2013-05-03T22:14:00.000-10:00</published><updated>2013-05-04T00:18:38.523-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-04T00:18:38.523-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="backup" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>To restore an OpenBSD backup using bsd.rd</title><content type="html">&lt;p&gt;Now that I made the new OpenBSD partition bootable and put bsd.rd in it, I am ready to restore the OpenBSD backup I made previously. This task will be like reversing the steps in making an OpenBSD backup.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;At the SYSLINUX prompt, I type &amp;ldquo;chain.c32 hd0 2&amp;rdquo; to boot OpenBSD partition, and then type &amp;ldquo;bsd.rd&amp;rdquo; to load bsd.rd.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD"&gt;SYSLINUX 4.04 EDD 20110711 Copyright (C) 1994-2011 H. Peter Anvin et al
boot: &lt;span style="color: #F03"&gt;chain.c32 hd0 2&lt;/span&gt;
Booting...
Loading...
probing: pc0 com0 com1 apm pci mem[639K 510M a20=on]
disk: fd0 hd0+
&amp;gt;&amp;gt; OpenBSD/i386 BOOT 3.17
boot&amp;gt; &lt;span style="color: #F03"&gt;bsd.rd&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I type S at the following message.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD"&gt;Welcome to the OpenBSD/i386 5.3 installation program.
(I)nstall, (U)pgrade or (S)hell? &lt;span style="color: #F03"&gt;S&lt;/span&gt;&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;I show the partition layout using the disklabel command.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD"&gt;disklabel /dev/rwd0c&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I mount the OpenBSD partitions I previous made with disklabel.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD"&gt;mount /dev/wd0a /mnt
mount -o nodev,nosuid /dev/wd0d /mnt/tmp
mount -o nodev /dev/wd0e /mnt/usr
mount -o nodev /dev/wd0f /mnt/usr/X11R6
mount -o nodev /dev/wd0g /mnt/usr/local
mount -o nodev,nosuid /dev/wd0h /mnt/usr/src
mount -o nodev,nosuid /dev/wd0j /mnt/usr/obj
mount -o nodev,nosuid /dev/wd0k /mnt/home
mount -o nodev,nosuid /dev/wd0l /mnt/var&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Then I plug in the USB drive containing the backup and mount it.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD"&gt;mount -t msdos /dev/sd0i /mnt2&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I changed to /mnt and restore the backup.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD"&gt;cd /mnt
tar xpf /mnt2/openbsd-5.1-i386-backup-20130430.tar&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Fix fstab by running disklabel.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD"&gt;# &lt;span style="color: #F03"&gt;disklabel -E -F /mnt/etc/fstab /dev/rwd0c&lt;/span&gt;
Label editor (enter '?' for help at any prompt)
&amp;gt; &lt;span style="color: #F03"&gt;n a&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;n d&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/tmp&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;n e&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/usr&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;n f&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/usr/X11R6&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;n g&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/usr/local&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;n h&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/usr/src&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;n j&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/usr/obj&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;n k&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/home&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;n l&lt;/span&gt;
mount point: [none] &lt;span style="color: #F03"&gt;/var&lt;/span&gt;
&amp;gt; &lt;span style="color: #F03"&gt;q&lt;/span&gt;
No label changes.&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I unmount partitions and reboot.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD"&gt;umount /mnt
reboot&lt;/pre&gt;

&lt;/ol&gt;

&lt;h3&gt;After Reboot&lt;/h3&gt;
&lt;p&gt;There are some things to check after reboot. Inconsistencies have been found in the filesystem compared to the backup. To be more specific, the /tmp directory had incorrect permission. And /usr/src and /usr/obj had wrong permission and group. To make correction, I ran the following commands:&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;chmod 1777 /tmp
chmod 775 /usr/src /usr/obj
chown root:wsrc /usr/src usr/obj&lt;/pre&gt;
&lt;p&gt;Also check fstab. The following is the contents of my fstab.&lt;/p&gt;
&lt;pre&gt;b99bea09139b7bd4.a / ffs rw 1 1
b99bea09139b7bd4.k /home ffs rw,nodev,nosuid 1 2
b99bea09139b7bd4.d /tmp ffs rw,nodev,nosuid 1 2
b99bea09139b7bd4.e /usr ffs rw,nodev 1 2
b99bea09139b7bd4.f /usr/X11R6 ffs rw,nodev 1 2
b99bea09139b7bd4.g /usr/local ffs rw,nodev 1 2
b99bea09139b7bd4.j /usr/obj ffs rw,nodev,nosuid 1 2
b99bea09139b7bd4.h /usr/src ffs rw,nodev,nosuid 1 2
b99bea09139b7bd4.l /var ffs rw,nodev,nosuid 1 2
b99bea09139b7bd4.b none swap sw&lt;/pre&gt;
&lt;p&gt;Also check the ownership and permissions of files and directories in /home.&lt;/p&gt;

&lt;h4&gt;Also Read&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/2013/05/backing-up-openbsd-with-bsdrd.html"&gt;Backing up OpenBSD with bsd.rd&lt;/a&gt;
&lt;li&gt;&lt;a href="/2013/05/making-openbsd-partition-bootable.html"&gt;Making an OpenBSD partition bootable&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/8lsvlCl2hwA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/5509299997541398793/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/to-restore-openbsd-backup-using-bsdrd.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/5509299997541398793?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/5509299997541398793?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/8lsvlCl2hwA/to-restore-openbsd-backup-using-bsdrd.html" title="To restore an OpenBSD backup using bsd.rd" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/to-restore-openbsd-backup-using-bsdrd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04CQ3o9eCp7ImA9WhBUFkk.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-8632197969928552237</id><published>2013-05-03T19:35:00.000-10:00</published><updated>2013-05-03T19:39:22.460-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-03T19:39:22.460-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="booting" /><category scheme="http://www.blogger.com/atom/ns#" term="bootstrap" /><category scheme="http://www.blogger.com/atom/ns#" term="syslinux" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bootloader" /><title>Making an OpenBSD partition bootable</title><content type="html">&lt;p&gt;In the &lt;a href="/2013/05/to-slice-openbsd-disk-label-using.html"&gt;previous post&lt;/a&gt;, I used floppy53.fs to create and slice an OpenBSD partition. In this post, I am going to make it bootable. Basically, I will boot from floppy53.fs again and use the &lt;code&gt;installboot&lt;/code&gt; command.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;From the &lt;a href="/2013/05/backing-up-openbsd-with-bsdrd.html"&gt;OpenBSD backup&lt;/a&gt; I previously made, I extracted /usr/mdec/biosboot, /usr/mdec/boot and /usr/mdec/installboot to a FAT16 partition on the hard drive.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I boot from floppy53.fs by typing the following at the SYSLINUX prompt:&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;SYSLINUX 4.04 EDD 20110711 Copyright (C) 1994-2011 H. Peter Anvin et al
boot: &lt;span style="color: #F03"&gt;memdisk initrd=floppy53.fs raw&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Floppy53.fs will be loading and stop to display the message below. I type S to start the shell.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;Welcome to the OpenBSD/i386 5.3 installation program.
(I)nstall, (U)pgrade or (S)hell? &lt;span style="color: #F03"&gt;S&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I mount the FAT16 partition where I saved biosboot, boot and installboot.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;mount -t msdos /dev/wd0i /mnt&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;I move biosboot, boot and installboot to /usr/mdec.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;cd /mnt
mv biosboot boot installboot /usr/mdec&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;I unmount /mnt.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;cd /
umount /mnt&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;I mount the previously prepared OpenBSD partition.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;mount /dev/wd0a /mnt&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Then I copy /usr/mdec/boot to /mnt.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;cp /usr/mdec/boot /mnt&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;I run installboot to install the bootloader.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot /dev/rwd0c&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;Then I download the OpenBSD kernel (bsd) from the OpenBSD ftp site and put it in OpenBSD root partition.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;cp bsd /mnt
cp bsd.mp /mnt
cp bsd.rd /mnt&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;I unmount /mnt and reboot.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;umount /mnt
reboot&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;When the computer restarts and shows the SYSLINUX prompt, I type the following to boot the OpenBSD partiton.&lt;/p&gt;
&lt;pre style="background-color: #000; color: #DDD;"&gt;SYSLINUX 4.04 EDD 20110711 Copyright (C) 1994-2011 H. Peter Anvin et al
boot: &lt;span style="color: #F03"&gt;chain.c32 hd0 2&lt;/span&gt;&lt;/pre&gt;
&lt;/ol&gt;

&lt;h4&gt;Also Read&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/2013/05/to-slice-openbsd-disk-label-using.html"&gt;To slice an OpenBSD disk label using floppy53.fs&lt;/a&gt;
&lt;li&gt;&lt;a href="/2013/05/backing-up-openbsd-with-bsdrd.html"&gt;Backing up OpenBSD with bsd.rd&lt;/a&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/63x0a3R-O7E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/8632197969928552237/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/making-openbsd-partition-bootable.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8632197969928552237?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8632197969928552237?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/63x0a3R-O7E/making-openbsd-partition-bootable.html" title="Making an OpenBSD partition bootable" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/making-openbsd-partition-bootable.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ADQXkyeip7ImA9WhBUFk0.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-8403154763989138153</id><published>2013-05-03T09:36:00.000-10:00</published><updated>2013-05-03T09:36:10.792-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-03T09:36:10.792-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="partition" /><category scheme="http://www.blogger.com/atom/ns#" term="installation" /><category scheme="http://www.blogger.com/atom/ns#" term="unix" /><category scheme="http://www.blogger.com/atom/ns#" term="setup" /><category scheme="http://www.blogger.com/atom/ns#" term="openbsd" /><category scheme="http://www.blogger.com/atom/ns#" term="bsd" /><title>To slice OpenBSD disk label using floppy53.fs</title><content type="html">&lt;p&gt;I am going to restore a backup of OpenBSD that I made previously (See &lt;a href="/2013/05/backing-up-openbsd-with-bsdrd.html"&gt;this post&lt;/a&gt;). The computer that I'll restore the backup on has no OpenBSD partition. The first thing I have to do is booting from the floppy image floppy53.fs, creating an OpenBSD partition and using disklabel to slice it into many partitions. To boot floppy53.fs, we can use GRUB or SYSLINUX.&lt;/p&gt;

&lt;ol&gt;

&lt;li&gt;&lt;p&gt;I have a FAT16 partition containing a SYSLINUX bootloader. At the SYSLINUX prompt, I used memdisk to boot from the floppy image &lt;em&gt;floppy53.fs&lt;/em&gt;. The &lt;code&gt;raw&lt;/code&gt; keyword may or may not be needed to make floppy53.fs boot.&lt;/p&gt;

&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;SYSLINUX 4.04 EDD 20110711 Copyright (C) 1994-2011 H. Peter Anvin et al
boot: &lt;span style="color: #F03"&gt;memdisk initrd=floppy53.fs raw&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The floppy installation image (floppy53.fs) starts and asks if we want to install, upgrade or use the shell. I typed &lt;code&gt;S&lt;/code&gt; to start the shell.&lt;/p&gt;

&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;Welcome to the OpenBSD/i386 5.3 installation program.
(I)nstall, (U)pgrade or (S)hell? &lt;span style="color: #F03"&gt;S&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;I use fdisk to create a new partition for OpenBSD. In the following example, I create an OpenBSD partition (type A6) at the second partition using cylinder-head-sector mode.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;# &lt;span style="color: #F03"&gt;fdisk -e /dev/rwd0c&lt;/span&gt;
Enter 'help' for information
fdisk: 1&amp;gt; &lt;span style="color: #F03"&gt;print&lt;/span&gt;
Disk: /dev/rwd0c        geometry: 9729/255/63 [156301488 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*0: 16      0  32  33 -    359 256  63 [        2048:     5781352 ] OS/2 hidden
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
fdisk: 1&amp;gt; &lt;span style="color: #F03"&gt;edit 1&lt;/span&gt;
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
Partition id ('0' to disable) [0 - FF]: [0] (? for help) A6
Do you wish to edit in CHS mode? [n] y
BIOS Starting cylinder [0 - 9728]: [0] 361
BIOS Starting head [0 - 254]: [0] 0
BIOS Starting sector [1 - 63]: [1] 1
BIOS Ending cylinder [0-9728]: [0] 9728
BIOS Ending head [0 - 254]: [0] 254
BIOS Ending sector [1 - 63]: [1] 63
fdisk:*1&amp;gt; &lt;span style="color: #F03"&gt;print&lt;/span&gt;
Disk: /dev/rwd0c        geometry: 9729/255/63 [156301488 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*0: 16      0  32  33 -    359 256  63 [        2048:     5781352 ] OS/2 hidden
 1: A6    361   0   1 -   9728 254  63 [     5799465:   150496920 ] OpenBSD
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
fdisk:*1&amp;gt; &lt;span style="color: #F03"&gt;quit&lt;/span&gt;
Writing MBR at offset 0.&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Then, I use &lt;code&gt;disklabel&lt;/code&gt; to create OpenBSD partitions. I'll make 10 partitions: /, /home, /tmp, /usr, /usr/X11R6, /usr/local, /usr/src, /usr/obj, /var and the swap. I am using number of cylinders to specify size.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf; height: 200; overflow: scroll;"&gt;# &lt;span style="color: #F03"&gt;disklabel -E /dev/rwd0c&lt;/span&gt;
Label editor (enter '?' for help at any prompt)
&amp;gt; a
partition: [a]
offset: [5799465]
size: [150496920] 10c
FS type: [4.2BSD] 
&amp;gt; a
partition: [b]
offset: [5960096]
size: [150336289] 261c
FS type: [swap]
&amp;gt; a
partition: [d]
offset: [10153080]
size: [146143305] 131c
FS type: [4.2BSD]
&amp;gt; a
partition: [e]
offset: [12273660] 
size: [144022725] 96c
FS type: [4.2BSD]
&amp;gt; a
partition: [f]
offset: [13815872]
size: [142480513] 64c
FS type: [4.2BSD]
&amp;gt; a
partition: [g]
offset: [14844032]
size: [141452353] 32c
FS type: [4.2BSD]
&amp;gt; a
partition: [h]
offset: [15358112]
size: [140938273] 131c
FS type: [4.2BSD]
&amp;gt; a
partition: [j]
offset: [17462624]
size: [138833761] 131c
FS type: [4.2BSD]
&amp;gt; a
partition: [k]
offset: [19567168]
size: [136729217] 522c
FS type: [4.2BSD]
&amp;gt; a
partition: [l]
offset: [27953088]
size: [128343297]
FS type: [4.2BSD]
&amp;gt; q
Write new label?: [y] y&lt;/pre&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Then, I format the OpenBSD partitions using &lt;code&gt;newfs&lt;/code&gt;.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;newfs /dev/rwd0a
newfs /dev/rwd0d
newfs /dev/rwd0e
newfs /dev/rwd0f
newfs /dev/rwd0g
newfs /dev/rwd0h
newfs /dev/rwd0j
newfs /dev/rwd0k
newfs /dev/rwd0l&lt;/pre&gt;

&lt;li&gt;&lt;p&gt;I'll install the OpenBSD bootloader into the new OpenBSD partition in the next post. Thanks for reading.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/7qSrPQYBTX8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/8403154763989138153/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/to-slice-openbsd-disk-label-using.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8403154763989138153?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/8403154763989138153?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/7qSrPQYBTX8/to-slice-openbsd-disk-label-using.html" title="To slice OpenBSD disk label using floppy53.fs" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/to-slice-openbsd-disk-label-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUBR3g-fSp7ImA9WhBUFEQ.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-5278120472945296973</id><published>2013-05-02T00:57:00.000-10:00</published><updated>2013-05-02T00:57:36.655-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-02T00:57:36.655-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 7" /><category scheme="http://www.blogger.com/atom/ns#" term="troubleshooting" /><category scheme="http://www.blogger.com/atom/ns#" term="repair" /><category scheme="http://www.blogger.com/atom/ns#" term="booting" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="computer" /><category scheme="http://www.blogger.com/atom/ns#" term="fix" /><title>How to fix Windows 7 boot problem with BCDEDIT</title><content type="html">&lt;p&gt;Sometimes, Windows 7 won't start especially after you make changes to the layout of the hard drive. For example, if you resize/move Windows 7 partition or restore a Windows backup to a new location, a boot problem will most likely happen. In that case, you can boot from a Windows DVD and use bcdedit to fix this problem.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Boot the PC from Windows 7 DVD. Hit any key when you see the following message.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;Press any key to boot from CD or DVD.....&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Windows DVD will be loading. Click &lt;em&gt;Next&lt;/em&gt; at the first window where you select language/time/keyboard settings.&lt;/p&gt;
&lt;div style="text-align: center"&gt;&lt;a href="http://farm9.staticflickr.com/8271/8700241443_5d437dd9cb_b_d.jpg" rel="nofollow"&gt;&lt;img src="http://farm9.staticflickr.com/8271/8700241443_5d437dd9cb_b_d.jpg" alt="Windows 7 install locale menu" title="Windows 7 install locale menu" width=540 style="padding: 10px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Click "Repair your computer" at the next window.&lt;/p&gt;
&lt;div style="text-align: center"&gt;&lt;a href="http://farm9.staticflickr.com/8272/8701381968_ee814054ef_b_d.jpg" rel="nofollow"&gt;&lt;img src="http://farm9.staticflickr.com/8272/8701381968_ee814054ef_b_d.jpg" alt="Windows 7 Install now" title="Windows 7 Install now" width=540 style="padding: 10px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;System Recovery Options&lt;/em&gt; window will show on the screen. If you see the message "Do you want to apply repairs and restart your computer?", click No.&lt;/p&gt;
&lt;div style="text-align: center"&gt;&lt;a href="http://farm9.staticflickr.com/8259/8701654176_94028eb544_b_d.jpg" rel="nofollow"&gt;&lt;img src="http://farm9.staticflickr.com/8259/8701654176_94028eb544_b_d.jpg" alt="System Recovery Options repair and restart" title="System Recovery Options repair and restart" width=540 style="padding: 10px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Select "Use recovery tools" and click Next.&lt;/p&gt;
&lt;div style="text-align: center"&gt;&lt;a href="http://farm9.staticflickr.com/8140/8701673546_17cdc30ce9_b_d.jpg" rel="nofollow"&gt;&lt;img src="http://farm9.staticflickr.com/8140/8701673546_17cdc30ce9_b_d.jpg" alt="System Recovery Options" title="System Recovery Options" width=540 style="padding: 10px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;em&gt;Command Prompt&lt;/em&gt; when you see a list of recovery tools.&lt;/p&gt;
&lt;div style="text-align: center"&gt;&lt;a href="http://farm9.staticflickr.com/8124/8701682498_962505126e_b_d.jpg" rel="nofollow"&gt;&lt;img src="http://farm9.staticflickr.com/8124/8701682498_962505126e_b_d.jpg" alt="System Recovery Options recovery tools" title="System Recovery Options recovery tools" width=540 style="padding: 10px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At the Command Prompt, type &lt;code&gt;C:&lt;/code&gt;, then &lt;code&gt;dir&lt;/code&gt; to make sure the C: drive has &lt;code&gt;Windows&lt;/code&gt; folder.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;X:\Sources&amp;gt;C:

C:\&amp;gt;dir
 Volume in drive C has no label.
 Volume Serial Number is 08B5-DD80

 Directory of C:\

06/10/2009   01:42 PM                24 autoexec.bat
06/10/2009   01:42 PM                10 config.sys
04/09/2013   03:07 AM    &amp;lt;DIR&amp;gt;          Documents
07/13/2009   06:37 PM    &amp;lt;DIR&amp;gt;          PerfLogs
04/28/2013   12:59 PM    &amp;lt;DIR&amp;gt;          PortableApps
04/27/2013   01:12 PM    &amp;lt;DIR&amp;gt;          Program Files
10/14/2012   12:42 PM           148,376 Start.exe
04/08/2013   09:39 AM    &amp;lt;DIR&amp;gt;          Users
04/23/2013   09:02 AM    &amp;lt;DIR&amp;gt;          Windows
                3 Files(s)       148,410 bytes
                6 Dir(s)  24,614,199,296 bytes free&lt;/pre&gt;
&lt;p&gt;If the C: drive doesn't have "Windows" folder, keep changing to the next letter drive (D:, E:, etc.) until you find a drive that has. Note the letter of this drive (C: in this case).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type "bcdedit /store C:\Boot\BCD /enum" to show boot entries.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;C:\&amp;gt;bcdedit /store C:\Boot\BCD /enum

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  unknown
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {default}
resumeobject            {aaefde36-a035-11e2-85f9-d08a24bd2bde}
displayorder            {default}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {default}
device                  unknown
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {aaefde38-a035-11e2-85f9-d08a24bd2bde}
recoveryenabled         Yes
osdevice                unknown
systemroot              \Windows
resumeobject            {aaefde36-a035-11e2-85f9-d08a24bd2bde}
nx                      OptIn&lt;/pre&gt;
&lt;p&gt;We should find the lines that have "unknown" values, and correct them by setting the value to "partition=C:" &amp;mdash; or whatever drive has "Windows" folder.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To fix the lines with "unknown" values, use bcdedit as follows.&lt;/p&gt;
&lt;pre&gt;bcdedit /store C:\Boot\BCD /set {bootmgr} device partition=C:
bcdedit /store C:\Boot\BCD /set {default} device partition=C:
bcdedit /store C:\Boot\BCD /set {default} osdevice partition=C:&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To verify that corrections were made to the Windows 7 boot configuration, run bcdedit again.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;C:\&amp;gt;bcdedit /store C:\Boot\BCD /enum

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=C:
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {default}
resumeobject            {aaefde36-a035-11e2-85f9-d08a24bd2bde}
displayorder            {default}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {default}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {aaefde38-a035-11e2-85f9-d08a24bd2bde}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {aaefde36-a035-11e2-85f9-d08a24bd2bde}
nx                      OptIn&lt;/pre&gt;
&lt;p&gt;You can see that "partition=C:" values appear on lines that previously had "unknown" values.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Windows will now boot normally. Close all windows and restart the computer.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/iMvLhUZnLmo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/5278120472945296973/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/how-to-fix-windows-7-boot-problem-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/5278120472945296973?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/5278120472945296973?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/iMvLhUZnLmo/how-to-fix-windows-7-boot-problem-with.html" title="How to fix Windows 7 boot problem with BCDEDIT" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/how-to-fix-windows-7-boot-problem-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ANR3k_eyp7ImA9WhBUFEk.&quot;"><id>tag:blogger.com,1999:blog-21888962961382876.post-5204318734282274790</id><published>2013-05-01T13:09:00.002-10:00</published><updated>2013-05-01T13:09:56.743-10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-01T13:09:56.743-10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="howto" /><category scheme="http://www.blogger.com/atom/ns#" term="backup" /><category scheme="http://www.blogger.com/atom/ns#" term="tutorial" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="computer" /><title>How to clone Windows NTFS partition over network with Linux ntfsclone, netcat, lzop and ssh</title><content type="html">&lt;p&gt;Cloning a Windows NTFS partition from one computer to another over the network is a challenging task, and it doesn't always work especially if the two computers have different hardware. Also keep in mind that Windows is picky about the type and geometry of the hard drive and the starting sector of the partition where it will be cloned. Although there are commercial backup software that can do network partition cloning, free and open-source alternatives also exist and they often work. In this article, let us review the use of some Linux programs for cloning Windows over the network. I'll show how we can use ntfsclone, netcat, lzop and ssh to copy a Windows partition across network.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;With a bootable Linux CD or USB drive, start both computers involved in Windows cloning. &lt;a href="http://partedmagic.com/"&gt;Parted Magic&lt;/a&gt;, &lt;a href="http://www.sysresccd.org/"&gt;System Rescue CD&lt;/a&gt; or &lt;a href="http://www.ubuntu.com/download/desktop"&gt;Ubuntu live DVD&lt;/a&gt; may also work.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;In xterm or GNOME terminal, run the command necessary to configure the network. Do this on both computers. If you are using GNOME or KDE, this step may be skipped since it's automatic for Ethernet connections.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf;"&gt;&lt;span style="color: #ffdf1f;"&gt;root@host1:/#&lt;/span&gt; dhclient eth0&lt;/pre&gt;
&lt;p&gt;Alternatively, we can use &lt;code&gt;ifconfig&lt;/code&gt; manually. Let's use the IP address 192.168.0.1 for the source computer and 192.168.0.2 for the target computer.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf; overflow: scroll;"&gt;&lt;span style="color: #ffdf1f;"&gt;root@host1:/#&lt;/span&gt; ifconfig eth0 192.168.0.1 up&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We need to create a new partition on the target computer whose size is greater than or equal to the source partition. We can use the command "fdisk -l /dev/sda" on the source computer to see how many blocks the source partition uses.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf; overflow: scroll;"&gt;&lt;span style="color: #ffdf1f;"&gt;root@host1:/#&lt;/span&gt; fdisk -l /dev/sda

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9fede339

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     5783399     2890676   16  Hidden FAT16
/dev/sda2         5799465    14185394     4192965   1b  Hidden W95 FAT32
/dev/sda3   *    14186496   131125247    58469376    7  HPFS/NTFS/exFAT
/dev/sda4       131125248   156301311    12588032    5  Extended
/dev/sda5       131127296   135321599     2097152   82  Linux swap / Solaris
/dev/sda6       141623296   156301311     7339008   83  Linux&lt;/pre&gt;
&lt;p&gt;Here the Windows partition is /dev/sda3 and has a size of 58,469,376 kilobytes. Now let's go to the target computer, and use &lt;code&gt;fdisk&lt;/code&gt; to create a new partition that has at least the same size as the source partition. Note that I typed +116938751 to specify exactly the same size as the source partition.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf; overflow: scroll;"&gt;&lt;span style="color: #ffdf1f;"&gt;root@host2:/#&lt;/span&gt; fdisk /dev/sda

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (4196352-156301487, default 4196352):
Using default value 4196352
Last sector, + sectors or +size{K,M,G} (4196352-156301487, default 156301487):
+116938751

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 7
Changed system type of partition 2 to 7 (HPFS/NTFS/exFAT)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Still at the target computer, let's use netcat to fetch the image from the network at port 7749 and use ntfsclone to write the image to the target partition (/dev/sda2). We are using lzop for speed reason.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf; overflow: scroll;"&gt;&lt;span style="color: #ffdf1f;"&gt;root@host2:/#&lt;/span&gt; nc -l 7749 | lzop -dc | ntfsclone --restore --overwrite /dev/sda2 -&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Then, let's go to the source computer, and set up a SSH tunnel from port 5525 of the source computer (192.168.0.1) to port 7749 of the target computer (192.168.0.2).&lt;/p&gt;

&lt;pre style="background-color: #000000; color: #dfdfdf; overflow: scroll;"&gt;&lt;span style="color: #ffdf1f;"&gt;root@host1:/#&lt;/span&gt; ssh -L 5525:127.0.0.1:7749 joe@192.168.0.2&lt;/pre&gt;

&lt;p&gt;Just leave the terminal open as we should keep the SSH tunnel open.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Still at the source computer, let's open another terminal. Now use ntfsclone to create a special image of the source partition (/dev/sda3), compress it with lzop and have netcat send it through port 5525.&lt;/p&gt;
&lt;pre style="background-color: #000000; color: #dfdfdf; overflow: scroll;"&gt;&lt;span style="color: #ffdf1f;"&gt;root@host1:/#&lt;/span&gt; ntfsclone --save --out - /dev/sda3 | lzop -c | nc 127.0.0.1 5525&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Wait till ntfsclone finishes. Ntfsclone on both computers will show the progress in percentage. Once ntfsclone reaches 100.00 percent and sync the disk, the job is done. Things to do after this include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check the integrity of the newly cloned NTFS filesystem.
&lt;li&gt;Make it bootable.
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Also Read&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/2012/11/how-to-back-up-windows-with-linux.html"&gt;How To Back Up Windows with Linux ntfsclone&lt;/a&gt;
&lt;li&gt;&lt;a href="/2012/10/disk-cloning-imaging-over-network-with.html"&gt;Disk Cloning / Imaging over Network with ssh, netcat, dd and lzop&lt;/a&gt;
&lt;li&gt;&lt;a href="/2009/03/resizing-windows-vista-partition-with.html"&gt;Resizing a Windows Vista partition with ntfsresize&lt;/a&gt;
&lt;li&gt;&lt;a href="/2010/07/linux-using-dd-to-back-up-and-restore.html"&gt;Linux: Using dd To Back Up Hard Drive Partitions&lt;/a&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/FragrantMemories/~4/9YZeJkGR2zc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kemovitra.blogspot.com/feeds/5204318734282274790/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://kemovitra.blogspot.com/2013/05/how-to-clone-windows-ntfs-partition.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/5204318734282274790?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/21888962961382876/posts/default/5204318734282274790?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/FragrantMemories/~3/9YZeJkGR2zc/how-to-clone-windows-ntfs-partition.html" title="How to clone Windows NTFS partition over network with Linux ntfsclone, netcat, lzop and ssh" /><author><name>Ken Yeo</name><uri>https://plus.google.com/109477644826156494233</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-xlpbZT8Ohuw/AAAAAAAAAAI/AAAAAAAABBk/CP6ghDpjRHM/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://kemovitra.blogspot.com/2013/05/how-to-clone-windows-ntfs-partition.html</feedburner:origLink></entry></feed>
