<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Waage Blog &#187; linux</title>
	<atom:link href="http://qugstart.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://qugstart.com/blog</link>
	<description>Ruby, Rails, Life</description>
	<lastBuildDate>Thu, 10 Nov 2011 00:35:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rails Rotating Log Files with logrotate</title>
		<link>http://qugstart.com/blog/ruby-and-rails/rails-rotating-log-files-with-logrotate/</link>
		<comments>http://qugstart.com/blog/ruby-and-rails/rails-rotating-log-files-with-logrotate/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 18:56:54 +0000</pubDate>
		<dc:creator>Andrew Waage</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[log file rotation]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://qugstart.com/blog/?p=122</guid>
		<description><![CDATA[I know there&#8217;s a way to specify Rails log rotation parameters directly in the app. This works for some people:

# Can place this in environment.rb
# 2nd argument - number of log files to keep
# 3rd argument - size (bytes) that log files are allowed to reach before rotation
config.logger = Logger.new(config.log_path, 8, 1024)

However&#8230;. I like the [...]]]></description>
			<content:encoded><![CDATA[<p>I know there&#8217;s a way to specify Rails log rotation parameters directly in the app. This works for some people:</p>
<pre class='prettyprint' lang='ruby'>
# Can place this in environment.rb
# 2nd argument - number of log files to keep
# 3rd argument - size (bytes) that log files are allowed to reach before rotation
config.logger = Logger.new(config.log_path, 8, 1024)
</pre>
<p>However&#8230;. I like the customizability of using <strong>logrotate</strong> better!<br />
Here&#8217;s my logrotate config file that handles weekly log rotation, delayed compression and uses the copy-truncate method:</p>
<p>I place this config in the /etc/logrotate.d folder (ubuntu)<br />
(ie. /etc/logrotate.d/&lt;rails_app_name&gt;)</p>
<pre class='prettyprint' lang='bash'>
/var/www/rails/<rails_app_name>/shared/log/production.log {
  weekly
  missingok
  rotate 8
  compress
  delaycompress
  notifempty
  copytruncate
}
</pre>
<p>This config will rotate my production.log file weekly, keeping at most 8 log files. It delays compression until next rotation (extra precaution, simply to make sure the log file is not in use), and uses the &#8216;copytruncate&#8217; method which basically copies the current log file, and then truncates this log file, so the Rails app maintains file pointer for continued writing.</p>
]]></content:encoded>
			<wfw:commentRss>http://qugstart.com/blog/ruby-and-rails/rails-rotating-log-files-with-logrotate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CentOS NFS How-to Guide: Exporting and Mounting a NFS Drive</title>
		<link>http://qugstart.com/blog/linux/centos-nfs-how-to-guide-exporting-and-mounting-a-nfs-drive/</link>
		<comments>http://qugstart.com/blog/linux/centos-nfs-how-to-guide-exporting-and-mounting-a-nfs-drive/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 02:22:16 +0000</pubDate>
		<dc:creator>Andrew Waage</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[portmap]]></category>

		<guid isPermaLink="false">http://qugstart.com/blog/?p=62</guid>
		<description><![CDATA[This guide shows you how to start an NFS service on one (host) machine, export the NFS drive, and then connect to that NFS drive from a client machine.
## On the NFS host machine:
#Start Portmap service if needed.
#NFS uses portmap and a bunch of ports (that you can set in /etc/sysconfig/nfs) if you want.
See this [...]]]></description>
			<content:encoded><![CDATA[<p>This guide shows you how to start an NFS service on one (host) machine, export the NFS drive, and then connect to that NFS drive from a client machine.</p>
<p>## On the NFS host machine:</p>
<p>#Start Portmap service if needed.<br />
#NFS uses portmap and a bunch of ports (that you can set in /etc/sysconfig/nfs) if you want.<br />
See this <a href="http://pario.no/2008/01/15/allow-nfs-through-iptables-on-a-redhat-system/">link for more details on NFS ports</a>.</p>
<p>#Start portmap service</p>
<pre lang='bash' class='prettyprint'>
service portmap status
service portmap start (if needed)
</pre>
<p>#Start NFS</p>
<pre lang='bash' class='prettyprint'>
service nfs start
</pre>
<p>#Edit /etc/exports<br />
#Reference: https://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-nfs-server-export.html</p>
<p>Format is (select the options you want):<br />
 [Directory to export] [Hosts to allow](options)</p>
<pre lang='bash' class='prettyprint'>
/home/just_testing 192.168.0.0/24(rw,async,wdelay,root_squash)
</pre>
<p>#Run exportfs to refresh NFS exports</p>
<pre lang='bash' class='prettyprint'>
exportfs -av
</pre>
<p>Be sure the proper ports are open on iptables<br />
Reference: http://pario.no/2008/01/15/allow-nfs-through-iptables-on-a-redhat-system/</p>
<p>## Now on your NFS client machine:<br />
Start portmap</p>
<pre lang='bash' class='prettyprint'>
service portmap start
</pre>
<p>Create a mount point and mount the NFS drive. Remember to use your own server&#8217;s IP address:</p>
<pre lang='bash' class='prettyprint'>
mkdir /mnt/nfs-usbdisk
mount 192.168.0.2:/home/just_testing /mnt/nfs-usbdisk
</pre>
<p>Voila ! Tail your logs if you have any problems !</p>
]]></content:encoded>
			<wfw:commentRss>http://qugstart.com/blog/linux/centos-nfs-how-to-guide-exporting-and-mounting-a-nfs-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to mount an Amazon S3 bucket as virtual drive on CentOS 5.2</title>
		<link>http://qugstart.com/blog/linux/how-to-mount-an-amazon-s3-bucket-as-virtual-drive-on-centos-5-2/</link>
		<comments>http://qugstart.com/blog/linux/how-to-mount-an-amazon-s3-bucket-as-virtual-drive-on-centos-5-2/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 01:38:41 +0000</pubDate>
		<dc:creator>Andrew Waage</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[bucket]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://qugstart.com/blog/?p=53</guid>
		<description><![CDATA[#Note: If you are using CentOS 4, it&#8217;s the same general process. You might have more difficulty finding the packages to install fuse and dependencies.
This is a simple guide on how to mount your S3 bucket as a &#8220;virtual drive&#8221;. This is great for backing up your data to S3, or downloading a bunch of [...]]]></description>
			<content:encoded><![CDATA[<p>#Note: If you are using CentOS 4, it&#8217;s the same general process. You might have more difficulty finding the packages to install fuse and dependencies.</p>
<p>This is a simple guide on how to mount your S3 bucket as a &#8220;virtual drive&#8221;. This is great for backing up your data to S3, or downloading a bunch of files from S3.</p>
<p>#First, make sure you have the fuse package installed.</p>
<p>#On CentOS, fuse is available from RPMforge </p>
<pre lang='bash' class='prettyprint'>
#http://wiki.centos.org/AdditionalResources/Repositories/RPMForge
</pre>
<p>#Now install fuse</p>
<pre lang='bash' class='prettyprint'>
yum install fuse
modprobe fuse
</pre>
<p>#Download s3fs and make</p>
<pre lang='bash' class='prettyprint'>
cd /usr/local/src
wget http://s3fs.googlecode.com/files/s3fs-r191-source.tar.gz
cd s3fs
make
</pre>
<p>#Copy the binary to /usr/local/bin (or wherever you prefer)</p>
<pre lang='bash' class='prettyprint'>
cp s3fs /usr/local/bin
</pre>
<p>#Make a mount point </p>
<pre lang='bash' class='prettyprint'>
mkdir /mnt/s3drive
</pre>
<p>#Mount your bucket like this:</p>
<pre lang='bash' class='prettyprint'>
s3fs bucketname -o accessKeyId=XXXXXXXXXXXXXXXXXXXX -o secretAccessKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /mnt/s3drive
</pre>
<p>That&#8217;s it ! You can change directory to your virtual drive or start copying files !<br />
Go ahead and use a visual client such as CyberDuck or S3Hub to verify with your own eyes that this actually worked. <img src='http://qugstart.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://qugstart.com/blog/linux/how-to-mount-an-amazon-s3-bucket-as-virtual-drive-on-centos-5-2/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>OpenOffice Headless Mode Installation Word doc to pdf conversion</title>
		<link>http://qugstart.com/blog/linux/openoffice-headless-mode-installation-word-doc-to-pdf-conversion/</link>
		<comments>http://qugstart.com/blog/linux/openoffice-headless-mode-installation-word-doc-to-pdf-conversion/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 21:30:57 +0000</pubDate>
		<dc:creator>Andrew Waage</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[headless]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[microsoft word to doc]]></category>
		<category><![CDATA[msword]]></category>
		<category><![CDATA[openoffice]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[soffice]]></category>

		<guid isPermaLink="false">http://qugstart.com/blog/?p=9</guid>
		<description><![CDATA[How to set up OpenOffice to run in headless mode on Fedora 9
What we wanted was a system set up to convert any OpenOffice document to PDF. Most importantly, we needed to convert Word .doc files to .pdf, but in fact, any OpenOffice file types (.xls, .odt, .txt, .rtf, etc) will work, as long as [...]]]></description>
			<content:encoded><![CDATA[<p>How to set up OpenOffice to run in headless mode on Fedora 9</p>
<p>What we wanted was a system set up to convert any OpenOffice document to PDF. Most importantly, we needed to convert Word .doc files to .pdf, but in fact, any OpenOffice file types (.xls, .odt, .txt, .rtf, etc) will work, as long as you install the proper packages / dependencies!</p>
<p>Also important:<br />
We will be starting OpenOffice in headless mode, which means no GUI. This should be started on boot up, and should just run in the background.</p>
<p>Install:<br />
You don&#8217;t need to install all the OpenOffice packages if you don&#8217;t need them. We are mainly concerned with Word docs, so OoWriter is a must. We are running in headless mode, which means we don&#8217;t have a GUI to openoffice. So we can leave out a bunch of unnecessary packages.</p>
<p>- Here&#8217;s what we have installed:</p>
<pre lang="bash" class="prettyprint">
openoffice.org-core.x86_64  1:2.4.2-18.3.fc9 installed
openoffice.org-headless.x86_64 1:2.4.2-18.3.fc9 installed
openoffice.org-pyuno.x86_64 1:2.4.2-18.3.fc9 installed
openoffice.org-sdk.x86_64 1:2.4.2-18.3.fc9 installed
openoffice.org-writer.x86_64 1:2.4.2-18.3.fc9 installed
openoffice.org-writer2latex.x86_64 0.5-2.fc9 installed
</pre>
<p>If you need to convert Excel spreadsheets, ppt Powerpoint presentations to pdf, you will need to install the corresponding package (ie. openoffice.org-calc, openoffice.org-draw, etc.)</p>
<p>After you have these packages installed, be sure you have the soffice command. By default it is here:<br />
/usr/lib64/<a href="http://openoffice.org/program/soffice.bin" target="_blank">openoffice.org/program/soffice.bin</a></p>
<p>Next, try to start up the service with this command:</p>
<pre lang="bash" class="prettyprint">
$ /usr/lib64/openoffice.org/program/soffice.bin -headless accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard &amp;
</pre>
<p>#Note: the ampersand (&amp;) allows the command to run in background so you get your shell back.<br />
You can specify whichever port you would like. The -nofirststartwizard flag does exactly that.</p>
<p>Next step is to find a script (client) that can interact with this OpenOffice service.<br />
A few options are:<br />
1. dag&#8217;s unoconv (Available from yum)<br />
<a href="http://dag.wieers.com/home-made/unoconv/" target="_blank">http://dag.wieers.com/home-made/unoconv/</a><br />
2. PyODConverter &#8211; a cool Python script to do conversions<br />
<a href="http://www.artofsolving.com/opensource/pyodconverter" target="_blank">http://www.artofsolving.com/opensource/pyodconverter</a><br />
3. Write your own!</p>
<p>We chose to use PyODConverter. It&#8217;s simple to use:</p>
<pre lang="bash" class="prettyprint">
$ PyODConverter.py example.doc example.pdf
</pre>
<p>Lastly, I mentioned that we want this soffice to start up everytime we reboot.</p>
<p>Simply add the line to your /etc/rc.d/rc.local</p>
<pre lang="bash" class="prettyprint">
# Start up openoffice for fax conversion
$ /usr/lib64/openoffice.org/program/soffice.bin -headless accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard
</pre>
<p>And there you have it. Hope that helps somebody. Happy Conversions!</p>
<p>Hint: If you are getting strange unintelligible errors about &#8220;URL seems to be an unsupported one&#8221;, it may be that you have not installed a necessary openoffice package. That&#8217;s how I discovered I needed OoWriter &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://qugstart.com/blog/linux/openoffice-headless-mode-installation-word-doc-to-pdf-conversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

