<?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>Ammon Shepherd</title>
	<atom:link href="http://mossiso.com/feed" rel="self" type="application/rss+xml" />
	<link>http://mossiso.com</link>
	<description>History, it happens every yesterday</description>
	<lastBuildDate>Thu, 16 May 2013 23:28:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Four Steps to a Personal Website</title>
		<link>http://mossiso.com/2013/02/20/four-steps-to-a-personal-website.html</link>
		<comments>http://mossiso.com/2013/02/20/four-steps-to-a-personal-website.html#comments</comments>
		<pubDate>Wed, 20 Feb 2013 16:56:59 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1454</guid>
		<description><![CDATA[There are four basic steps to creating a personal website. 1. Content You may want to start out with a cool design, or fun idea on how to interact with visitors, or what have you. But really, the most important thing a website has going for it is the content. Design is a close second [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=Four+Steps+to+a+Personal+Website&amp;rft.source=Ammon+Shepherd&amp;rft.date=2013-02-20&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2013%2F02%2F20%2Ffour-steps-to-a-personal-website.html&amp;rft.language=English&amp;rft.subject=HowTo&amp;rft.subject=Technical&amp;rft.subject=Websites&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>There are four basic steps to creating a personal website.</p>
<h3>1. Content</h3>
<p>You may want to start out with a cool design, or fun idea on how to interact with visitors, or what have you. But really, the most important thing a website has going for it is the content. Design is a close second (but we&#8217;ll talk about that last), because people tend to shy away from &#8220;ugly&#8221; sites. But they won&#8217;t even go in the first place if the content isn&#8217;t relevant.</p>
<p>You&#8217;ll need to ask yourself a few questions to get an idea of what kind of website you need. The answers will even help define the design, and determine the platform, or website technology, that you use.</p>
<ul>
<li>What information do you want to share?</li>
<li>Why do you want to it?</li>
<li>Do you want conversations to take place on your website?</li>
<li>Do you want a blog, a simple website with information about you or a topic, or something else?</li>
</ul>
<h3>2. Domain Name</h3>
<p>A domain name is a word, set of words, or phrase thatThe domain name plays an important role in search engine rankings. If this is your personal site, try to get your name, or part of it, as the domain name. It can be all you need for &#8220;brand&#8221; identification.</p>
<p>Shop around before you buy a domain name. There are plenty of options out there, just do a <a href="https://www.google.com/#hl=en&amp;output=search&amp;sclient=psy-ab&amp;q=domain+registra">search for domain registrar</a>. Often a hosting provider will sell domain names as well. As of this writing, you should be able to get a domain name for around $10-$11 a year. Make sure the registrar includes DNS management.</p>
<p>.org, .net, .com, .info, .us, &#8230; What type of domain name should you buy? There are 19 top level domains (TLDs the very last part of a domain name, the part followed by the last period), and over 250 country code top-level domains (.us, .me, .de, .uk, etc.) That depends on a few things, the most important being, which one is available. Generally, .com and .org are the most sought after. Here is a list of the top-level domains and their intended purposes (from <a href="http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains">Wikipedia</a>).</p>
<table>
<tbody>
<tr valign="top">
<td><a title=".com" href="http://en.wikipedia.org/wiki/.com">.com</a></td>
<td>commercial</td>
<td>This is an open TLD; any person or entity is permitted to register. Though originally intended for use by for-profit business entities, for a number of reasons it became the &#8220;main&#8221; TLD for domain names and is currently used by all types of entities including nonprofits, schools and private individuals. Domain name registrations may be challenged if the holder cannot prove an outside relation justifying reservation of the name, to prevent &#8220;<a title="Cybersquatting" href="http://en.wikipedia.org/wiki/Cybersquatting">squatting</a>&#8220;.</td>
</tr>
<tr valign="top">
<td><a title=".info" href="http://en.wikipedia.org/wiki/.info">.info</a></td>
<td>information</td>
<td>This is an open TLD; any person or entity is permitted to register.</td>
</tr>
<tr valign="top">
<td><a title=".name" href="http://en.wikipedia.org/wiki/.name">.name</a></td>
<td>individuals, by name</td>
<td>This is an open TLD; any person or entity is permitted to register; however, registrations may be challenged later if they are not by individuals (or the owners of fictional characters) in accordance with the domain&#8217;s charter.</td>
</tr>
<tr valign="top">
<td><a title=".net" href="http://en.wikipedia.org/wiki/.net">.net</a></td>
<td>network</td>
<td>This is an open TLD; any person or entity is permitted to register. Originally intended for use by domains pointing to a distributed network of computers, or &#8220;umbrella&#8221; sites that act as the portal to a set of smaller websites.</td>
</tr>
<tr valign="top">
<td><a title=".org" href="http://en.wikipedia.org/wiki/.org">.org</a></td>
<td>organization</td>
<td>This is an open TLD; any person or entity is permitted to register. Originally intended for use by non-profit organizations, and still primarily used by some.</td>
</tr>
</tbody>
</table>
<p>Country code top-level domains can be used as well, often to create <a href="http://en.wikipedia.org/wiki/Domain_hack#Examples_of_domain_hacks_in_different_languages">clever domain names</a> (called domain hacks) like del.icio.us, bit.ly, instagr.am, pep.si, and redd.it.</p>
<p>&nbsp;</p>
<div id="attachment_1459" class="wp-caption alignnone" style="width: 160px"><img class="size-thumbnail wp-image-1459 " alt="source, creative commons search on flickr.com" src="http://mossiso.com/wp-content/uploads/2013/02/4847678335_a92fe09dee-150x150.jpg" width="150" height="150" /><p class="wp-caption-text">source, creative commons search on flickr.com</p></div>
<h3>3. Hosting</h3>
<p>A hosting provider is the company that owns the servers where your website lives. There are many free options. Look for a hosting provider that offers &#8220;easy&#8221; installations of common software like WordPress, Drupal, etc.</p>
<ul>
<li><a href="http://wordpress.com">wordpress.com</a></li>
<li><a href="http://omeka.net">omeka.net</a></li>
<li><a href="http://weebly.com">weebly.com</a></li>
<li>list of 40 free blog hosts: mashable.com/2007/08/06/free-blog-hosts</li>
<li><a href="http://en.wikipedia.org/wiki/Comparison_of_free_web_hosting_services">Wikipedia: Comparison of free web hosting services</a></li>
</ul>
<p>Paid options:</p>
<p>You can find a hosting provider from anywhere between $5/month to $100/month.</p>
<ul>
<li><a href="http://hostgator.com">hostgator.com</a></li>
<li><a href="http://dreamhost.com/">dreamhost.com</a></li>
<li><a href="http://mediatemple.net/">mediatemple.net</a></li>
</ul>
<div id="attachment_1458" class="wp-caption alignnone" style="width: 160px"><img class="size-thumbnail wp-image-1458" alt="source: creative commons search on flickr.com" src="http://mossiso.com/wp-content/uploads/2013/02/5818096043_d6e6ba27d5_n-150x150.jpg" width="150" height="150" /><p class="wp-caption-text">source: creative commons search on flickr.com</p></div>
<h3>4. Design</h3>
<p>Independent on the platform you choose, there are usually thousands of free themes available for easy download and install. When you pick a platform, look on their site for places to find free themes.</p>
<p>Designing a website takes lots of work to make it look nice. The better the design, the more resources are needed (be they time, or money).</p>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2013/02/20/four-steps-to-a-personal-website.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a Hosting Environment, Part 3: RedHat Cluster and GFS2</title>
		<link>http://mossiso.com/2013/02/01/setting-up-a-hosting-environment-part-3-redhat-cluster-and-gfs2.html</link>
		<comments>http://mossiso.com/2013/02/01/setting-up-a-hosting-environment-part-3-redhat-cluster-and-gfs2.html#comments</comments>
		<pubDate>Fri, 01 Feb 2013 20:12:57 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Setting up a Hosting Environment]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[gfs2]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1438</guid>
		<description><![CDATA[Previous posts in this series: Part 1: Setting up the servers Part 2: Connecting the Array RedHat Cluster and GFS2 Setup Required reading: https://alteeve.com/w/2-Node_Red_Hat_KVM_Cluster_Tutorial Seriously. Don&#8217;t do anything until you read his tutorial a couple of times. Might as well read a bunch of his other tutorials, too. Unless mentioned, the following commands should be [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=Setting+up+a+Hosting+Environment%2C+Part+3%3A+RedHat+Cluster+and+GFS2&amp;rft.source=Ammon+Shepherd&amp;rft.date=2013-02-01&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2013%2F02%2F01%2Fsetting-up-a-hosting-environment-part-3-redhat-cluster-and-gfs2.html&amp;rft.language=English&amp;rft.subject=HowTo&amp;rft.subject=Setting+up+a+Hosting+Environment&amp;rft.subject=Technical&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>Previous posts in this series:</p>
<p><a title="Setting up a Hosting Environment: Part 1 – The servers" href="http://mossiso.com/2012/03/01/setting-up-a-hosting-environment-part-1-the-servers.html">Part 1: Setting up the servers</a></p>
<p><a title="Setting up a Hosting Environment – Part 2: Connecting the Storage Array" href="http://mossiso.com/2012/03/09/setting-up-a-hosting-environment-part-2-connecting-the-storage-array.html">Part 2: Connecting the Array</a></p>
<h2>RedHat Cluster and GFS2 Setup</h2>
<ul>
<li>Required reading: <a href="https://alteeve.com/w/2-Node_Red_Hat_KVM_Cluster_Tutorial">https://alteeve.com/w/2-Node_Red_Hat_KVM_Cluster_Tutorial</a> Seriously. Don&#8217;t do anything until you read his tutorial a couple of times. Might as well read a bunch of his other tutorials, too.</li>
<li>Unless mentioned, the following commands should be done on each server.</li>
</ul>
<h3>Set date/time to be accurate and within a few minutes of each other.</h3>
<ul>
<li>Install the ntp program and update to current time.
<ul>
<li><code>yum install ntp</code></li>
<li><code>ntpdate time.nist.gov</code></li>
</ul>
</li>
<li>Set time servers and start ntpd
<ul>
<li><code>service ntpd start</code></li>
<li>Edit the <code>/etc/ntp.conf</code> file to use the following servers:</li>
<li>
<pre>server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org</pre>
</li>
</ul>
</li>
<li>Restart ntpd
<ul>
<li><code>service ntpd restart</code></li>
<li><code>chkconfig ntpd on</code></li>
</ul>
</li>
</ul>
<h3>Cluster setup</h3>
<p>RedHat Cluster must be set up before the GFS2 File systems can be created and mounted.</p>
<ul>
<li>Instal the necessary programs
<ul>
<li><code>yum install openais cman rgmanager lvm2-cluster gfs2-utils ccs</code></li>
<li>Create a <code>/etc/cluster/cluster.conf</code> REMEMBER: Always increment the “config_version” parameter in the <code>cluster</code> tag!
<ul>
<li>
<div>
<pre>&lt;?xml version=“1.0”?&gt;
    &lt;cluster config_version=“24” name=“web-production”&gt;
        &lt;cman expected_votes=“1” two_node=“1”/&gt;
        &lt;fence_daemon clean_start=“1” post_fail_delay=“6” post_join_delay=“3”/&gt;
        &lt;totem rrp_mode=“none” secauth=“off”/&gt;
        &lt;clusternodes&gt;
            &lt;clusternode name=“bill” nodeid="1"&gt;
                &lt;fence&gt;
                    &lt;method name="ipmi"&gt;
                        &lt;device action=“reboot” name=“ipmi_bill”/&gt;
                    &lt;/method&gt;
                &lt;/fence&gt;
            &lt;/clusternode&gt;
            &lt;clusternode name=“ted” nodeid="2"&gt;
                &lt;fence&gt;
                    &lt;method name="ipmi"&gt;
                        &lt;device action=“reboot” name=“ipmi_ted”/&gt;
                    &lt;/method&gt;
                &lt;/fence&gt;
            &lt;/clusternode&gt;
        &lt;/clusternodes&gt;
        &lt;fencedevices&gt;
            &lt;fencedevice agent=“fence_ipmilan” ipaddr=“billsp” login=“root” name=“ipmi_bill” passwd=“PASSWORD-HERE”/&gt;
            &lt;fencedevice agent=“fence_ipmilan” ipaddr=“tedsp” login=“root” name=“ipmi_ted” passwd=“PASSWORD-HERE”/&gt;
        &lt;/fencedevices&gt;
        &lt;rm log_level="5"&gt;
            &lt;resources&gt;
                &lt;clusterfs device=“/dev/mapper/StorageTek2530-sites” fstype=“gfs2” mountpoint=“/sites” name=“sites”/&gt;
                &lt;clusterfs device=“/dev/mapper/StorageTek2530-databases” fstype=“gfs2” mountpoint=“/databases” name=“databases”/&gt;
                &lt;clusterfs device=“/dev/mapper/StorageTek2530-logs” fstype=“gfs2” mountpoint=“/logs” name=“logs”/&gt;
            &lt;/resources&gt;
            &lt;failoverdomains&gt;
                &lt;failoverdomain name=“bill-only” nofailback=“1” ordered=“0” restricted="1"&gt;
                    &lt;failoverdomainnode name=“bill”/&gt;
                &lt;/failoverdomain&gt;
                &lt;failoverdomain name=“ted-only” nofailback=“1” ordered=“0” restricted="1"&gt;
                    &lt;failoverdomainnode name=“ted”/&gt;
                &lt;/failoverdomain&gt;
            &lt;/failoverdomains&gt;
        &lt;/rm&gt;
    &lt;/cluster&gt;</pre>
</div>
</li>
</ul>
</li>
<li>We’ll be adding more to this later, but this will work for now.</li>
<li>Validate the config file
<ul>
<li><code>ccs_config_validate</code></li>
</ul>
</li>
<li>Set a password for the ricci user
<ul>
<li><code>passwd ricci</code></li>
</ul>
</li>
<li>Start ricci, and set to start on boot
<ul>
<li><code>service ricci start</code></li>
<li><code>chkconfig ricci on</code></li>
</ul>
</li>
<li>Start modclusterd and set to start on boot
<ul>
<li><code>service modclusterd start</code></li>
<li><code>chkconfig modclusterd on</code></li>
</ul>
</li>
<li>Sync the cluster.conf file to other node
<ul>
<li><code>ccs -f /etc/cluster/cluster.conf -h ted --setconf</code></li>
</ul>
</li>
<li>Start cman on both servers at the same time
<ul>
<li><code>service cman start</code></li>
</ul>
</li>
<li>Set cman to start on boot
<ul>
<li><code>chkconfig cman on</code></li>
</ul>
</li>
</ul>
</li>
<li>Check the tutorial on testing the fencing
<ul>
<li><a href="https://alteeve.com/w/2-Node_Red_Hat_KVM_Cluster_Tutorial#Testing_Fencing">https://alteeve.com/w/2-Node_Red_Hat_KVM_Cluster_Tutorial#Testing_Fencing</a></li>
</ul>
</li>
</ul>
<h3>Create GFS2 partitions</h3>
<p>Create a partition on the new scsi device /dev/mapper/mpatha using parted. NOTE: This part only needs to be done once on one server</p>
<ul>
<li><code>parted /dev/mapper/mpatha</code></li>
<li><code>mklabel gpt</code></li>
<li><code>mkpart primary 1 -1</code></li>
<li><code>set 1 lvm on</code></li>
<li><code>quit</code></li>
<li>Now you can see a partition for the storage array.
<ul>
<li><code>parted -l</code></li>
</ul>
</li>
</ul>
<p>Edit the <code>/etc/lvm/lvm.conf file</code> and set the value for <code>locking_type = 3</code> to allow for cluster locking.</p>
<p>In order to enable the LVM volumes you are creating in a cluster, the cluster infrastructure must be running and the cluster must be quorate.</p>
<ul>
<li><code>service clvmd start</code></li>
<li><code>chkconfig clvmd on</code></li>
<li><code>chkconfig gfs2 on</code></li>
</ul>
<p>Create LVM partitions on the raw drive available from the StorageTek. NOTE: This part only needs to be done once on one server.</p>
<ul>
<li><code>pvcreate /dev/mapper/mpatha1</code></li>
<li><code>vgcreate -c y StorageTek2530 /dev/mpatha1</code></li>
</ul>
<p>Now create the different partitions for the system: sites, databases, logs, home, root</p>
<ul>
<li><code>lvcreate --name sites --size 350GB StorageTek2530</code></li>
<li><code>lvcreate --name databases --size 100GB StorageTek2530</code></li>
<li><code>lvcreate --name logs --size 50GB StorageTek2530</code></li>
<li><code>lvcreate --name root --size 50GB StorageTek2530</code></li>
</ul>
<p>Make a temporary directory <code>/root-b</code> and copy everything from root’s home directory to there, because it will be erased when we make the GFS2 file system.</p>
<p>Copy /root/.ssh/known_hosts to /etc/ssh/root_known_hosts so the file is different for both servers.</p>
<p>Before doing the home directory, we have to remove it from the local LVM.</p>
<ul>
<li><code>unmount /home</code></li>
<li><code>lvremove bill_local/home</code> and on ted <code>lvremove ted_local/home</code></li>
<li>Remove the line from <code>/etc/fstab</code> referring to the /home directory on the local LVM</li>
<li>Then add the clustered LV.
<ul>
<li><code>lvcreate --name home --size 50GB StorageTek2530</code></li>
</ul>
</li>
</ul>
<p>Create GFS2 files systems on the LVM partitions created on the StorageTek. Make sure they are unmounted, first. NOTE: This part only needs to be done once on one server.</p>
<ul>
<li><code>mkfs.gfs2 -p lock_dlm -j 2 -t web-production:sites /dev/mapper/StorageTek2530-sites</code></li>
<li><code>mkfs.gfs2 -p lock_dlm -j 2 -t web-production:databases /dev/mapper/StorageTek2530-databases</code></li>
<li><code>mkfs.gfs2 -p lock_dlm -j 2 -t web-production:logs /dev/mapper/StorageTek2530-logs</code></li>
<li><code>mkfs.gfs2 -p lock_dlm -j 2 -t web-production:root /dev/mapper/StorageTek2530-root</code></li>
<li><code>mkfs.gfs2 -p lock_dlm -j 2 -t web-production:home /dev/mapper/StorageTek2530-home</code></li>
</ul>
<p>Mount the GFS2 partitions</p>
<ul>
<li>NOTE: GFS2 file systems that have been mounted manually rather than automatically through an entry in the fstab file will not be known to the system when file systems are unmounted at system shutdown. As a result, the GFS2 script will not unmount the GFS2 file system. After the GFS2 shutdown script is run, the standard shutdown process kills off all remaining user processes, including the cluster infrastructure, and tries to unmount the file system. This unmount will fail without the cluster infrastructure and the system will hang.</li>
<li>To prevent the system from hanging when the GFS2 file systems are unmounted, you should do one of the following:
<ul>
<li>Always use an entry in the fstab file to mount the GFS2 file system.</li>
<li>If a GFS2 file system has been mounted manually with the mount command, be sure to unmount the file system manually with the umount command before rebooting or shutting down the system.</li>
</ul>
</li>
<li>If your file system hangs while it is being unmounted during system shutdown under these circumstances, perform a hardware reboot. It is unlikely that any data will be lost since the file system is synced earlier in the shutdown process.</li>
</ul>
<p>Make the appropriate folders on each node (/home is already there).</p>
<ul>
<li><code>mkdir /sites /logs /databases</code></li>
</ul>
<p>Make sure the appropriate lines are in /etc/fstab</p>
<pre>#GFS2 partitions shared in the cluster
/dev/mapper/StorageTek2530-root        /root        gfs2   defaults,acl    0 0
/dev/mapper/StorageTek2530-home        /home        gfs2   defaults,acl    0 0
/dev/mapper/StorageTek2530-databases      /databases      gfs2   defaults,acl    0 0
/dev/mapper/StorageTek2530-logs        /logs        gfs2   defaults,acl    0 0
/dev/mapper/StorageTek2530-sites    /sites    gfs2   defaults,acl    0 0</pre>
<p>Once the GFS2 partitions are set up and in <code>/etc/fstab</code>, rgmanager can be started. This will mount the GFS2 partions.</p>
<ul>
<li><code>service rgmanager start</code></li>
<li><code>chkconfig rgmanager on</code></li>
</ul>
<h3>Starting Cluster Software</h3>
<p>To start the cluster software on a node, type the following commands in this order:</p>
<ul>
<li><code>service cman start</code></li>
<li><code>service clvmd start</code></li>
<li><code>service gfs2 start</code></li>
<li><code>service rgmanager start</code></li>
</ul>
<h3>Stopping Cluster Software</h3>
<p>To stop the cluster software on a node, type the following commands in this order:</p>
<ul>
<li><code>service ossec-hids stop</code>
<ul>
<li>(ossec monitors the apache log files, so the /logs partition will not be unmounted unless ossec is stopped first.)</li>
</ul>
</li>
<li><code>service rgmanager stop</code></li>
<li><code>service gfs2 stop</code></li>
<li><code>umount -at gfs2</code></li>
<li><code>service clvmd stop</code></li>
<li><code>service cman stop</code></li>
</ul>
<h3>Cluster tips</h3>
<p>If a service shows as ‘failed’ when checking on services with <code>clustat</code></p>
<ul>
<li>Disable the service first: <code>clusvcadm -d service-name</code></li>
<li>Then re-enable it: <code>clusvcadm -e service-name</code></li>
</ul>
<p>Have Shorewall start sooner in the boot process.</p>
<ul>
<li>It was necessary to move shorewall up in the boot process, otherwise cman had no open connection to detect the other nodes.</li>
<li>Edit the <code>/etc/init.d/shorewall</code> and change the line near the top from <code># chkconfig: - 28 90</code> to
<ul>
<li><code># chkconfig: - 18 90</code></li>
</ul>
</li>
<li>Then use chkconfig to turn off shorewall and then back on.
<ul>
<li><code>chkconfig shorewall off</code></li>
<li><code>chkconfig shorewall on</code></li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2013/02/01/setting-up-a-hosting-environment-part-3-redhat-cluster-and-gfs2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Research Trip!</title>
		<link>http://mossiso.com/2012/11/26/research-trip.html</link>
		<comments>http://mossiso.com/2012/11/26/research-trip.html#comments</comments>
		<pubDate>Mon, 26 Nov 2012 21:35:42 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Dissertation]]></category>
		<category><![CDATA[German]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[School Work]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1367</guid>
		<description><![CDATA[Not quite the same feeling and fun as a road trip, but fun enough. Yeah, archive work! Yeah, Germany! Yeah, yeah archive work in Germany! So I just spent the last two weeks in Germany (by myself, not so yeah) doing some archival research for the dissertation. Here are some thoughts on the trip. 1. [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=Research+Trip%21&amp;rft.source=Ammon+Shepherd&amp;rft.date=2012-11-26&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2012%2F11%2F26%2Fresearch-trip.html&amp;rft.language=English&amp;rft.subject=Academic&amp;rft.subject=Dissertation&amp;rft.subject=German&amp;rft.subject=History&amp;rft.subject=School+Work&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>Not quite the same feeling and fun as a road trip, but fun enough.<br />
Yeah, archive work! Yeah, Germany! Yeah, yeah archive work in Germany! So I just spent the last two weeks in Germany (by myself, not so yeah) doing some archival research for the dissertation. Here are some thoughts on the trip.</p>
<h3>1. Internet!</h3>
<div id="attachment_1368" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/11/IMG_0141.jpg"><img class="size-medium wp-image-1368 " title="IMG_0141" alt="Starbucks" src="http://mossiso.com/wp-content/uploads/2012/11/IMG_0141-300x200.jpg" width="300" height="200" /></a><p class="wp-caption-text">The Starbucks with Internet&#8230; saved my bacon.</p></div>
<p>Make sure you have a good internet connection where you will stay. I booked a decent hotel with Internet included, and free breakfast. The only problem is, the connection to the Internet is spotty at best. I have to get a new user/pass combination to connect to the Internet every 24 hours, too. It&#8217;s so frustrating to want to communicate, but not be able to. Especially when you&#8217;re trying to get in touch with family back home. So, do some research and hope you get lucky. Also, it is important to know any quirks about the Internet in the country you go to, if going out side of the USA. In Germany, they use 13 channels for their routers, in the USA we only use 11. So if your place of stay uses channel 12 or 13, you&#8217;re almost out of luck. You can pick up a relatively cheap USB wireless adapter in the country that should get you all of their available channels. But you will most likely have to find some place with Internet to download software. Enter in the great Internet hubs scattered throughout the world: Starbucks and McDonalds! Even BurgerKing has Internet available. Find out where they are and use them.</p>
<p>&nbsp;</p>
<h3>2. This is only a test.</h3>
<div id="attachment_1372" class="wp-caption alignright" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/11/IMG_0209.jpg"><img class="size-medium wp-image-1372 " title="IMG_0209" alt="weinachtsmarkt" src="http://mossiso.com/wp-content/uploads/2012/11/IMG_0209-300x200.jpg" width="300" height="200" /></a><p class="wp-caption-text">Getting ready for Christmas!</p></div>
<p>Don&#8217;t get your hopes up too high for your first trip. I kind of went on this trip with the attitude that it would be a test run of a later real trip. This was possible because I know that I&#8217;m coming back in a few months. If you don&#8217;t know if you&#8217;ll ever go back, then you need to do a lot of background research and contacting before hand. I had scheduled to go to the archive Tuesday through Friday the first week and Monday through Thursday the second week. The first day ended up being a get settled day; exchanging money, finding my way around, finding the Starbucks for Internet, etc. It often felt like I was wasting time, but if you know you are going to go back, then it is time well spent to get your bearings and figure things out. I lived in Germany for two years, but that was a life time ago (like 15 years ago). So I am a bit rusty on speaking German, and German customs, and such. Luckily that mostly all came back easily.</p>
<h3></h3>
<h3></h3>
<h3>3. Talk to me.</h3>
<div id="attachment_1369" class="wp-caption alignleft" style="width: 210px"><a href="http://mossiso.com/wp-content/uploads/2012/11/IMG_0193.jpg"><img class="size-medium wp-image-1369" title="IMG_0193" alt="Divided" src="http://mossiso.com/wp-content/uploads/2012/11/IMG_0193-200x300.jpg" width="200" height="300" /></a><p class="wp-caption-text">A house divided&#8230; will make a good restaurant.</p></div>
<p>Talk with your contacts before leaving home. Or email them. Let them know exactly what you want to do, what you want to research, where you are going to look, etc. They can save you lots of time. I had one contact at the University of Freiburg, Professor Ulricht Herbert. I met with him twice, and he gave me sound advice. I should have emailed him more often before hand, but nothing really beats face to face contact anyway. My one contact here has turned into two or three. He also helped me realize I am trying to do too much in my dissertation. As it stands, its really a life&#8217;s work project. Going through the sources helped me understand that too. There is just way too much for me to be able to grasp it in two years time (my goal). Instead, I&#8217;m going to scale back and only cover one tunnel project, and cover that in depth. The reason there is no all encompassing history about the underground projects from World War II is because it was a huge project. Basically the whole of the German economy was turned to focus on these projects towards the end of the War. There is just too much to understand, too many documents to go through, and too much to grasp before this history can be written. That&#8217;s why nobody has done it, yet. It would take lots of financing and lots of time. Dr. Herbert suggested four years of work, but only after I had perfect understanding of German, have read all that has been written on the subject so far, and had an intimate grasp of Germany in World War II. That ain&#8217;t gonna happen in two years when I have a full-time job, a family, and no financial support. Perhaps that will be my ongoing project as a professor&#8230;</p>
<p>&nbsp;</p>
<h3>4. I&#8217;ll make a note of that&#8230;</h3>
<div id="attachment_1373" class="wp-caption alignright" style="width: 210px"><a href="http://mossiso.com/wp-content/uploads/2012/11/IMG_0211.jpg"><img class="size-medium wp-image-1373" title="IMG_0211" alt="Schemmer" src="http://mossiso.com/wp-content/uploads/2012/11/IMG_0211-200x300.jpg" width="200" height="300" /></a><p class="wp-caption-text">Hotel Schemmer. Home away from home.</p></div>
<p>Figure out a good note taking routine. I have several hundred documents digitized from another archive already, and figured out a good naming scheme for them. I have a spread sheet for taking notes on each file, and for later import into Omeka for an online archive. This time around was a little different. The Bundesarchiv-Militärarchiv in Freiburg had lots of documents for me to go through. Whereas before it was one collection/folder in one archive, I now had many collections/folders in one archive. So I had to figure out something a little different. I also didn&#8217;t have enough money to make digital copies of any of the records I found. It turned out that I didn&#8217;t need to make any, but that should be budgeted and planned for as well. There were a handful of documents that I wanted copies of, so I just transcribed them into a word processing document. I thought about making them plain text documents, but ran into a few formatting issues. I chose to make them LibreOffice (OpenOffice) Text documents, because there will always be a program that can open those, and that program is free. Of course, any program nowadays can open Microsoft Word documents, too, and there is no fancy formatting, so that would work fine too. One of my greatest struggles so far is keeping the documents in place chronologically. So my naming scheme for the files takes care of that. Start the name of the file with the year, then month number, then day number (YYYY-MM-DD), and the documents sort themselves! The file viewer (File Explorer for Windows or Finder for Macs) will usually sort by alphabet, so there&#8217;s nothing to it. Another thing I did was to go through the documents as quickly as I could. If It looked like it was helpful, I jotted notes about it, or quickly transcribed it. I will be able to go through the notes and transcriptions later to make sense out of them. That leads into the next point.</p>
<h3></h3>
<h3></h3>
<h3>5. Plan it right.</h3>
<div id="attachment_1370" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/11/IMG_0197.jpg"><img class="size-medium wp-image-1370" title="IMG_0197" alt="Trolly" src="http://mossiso.com/wp-content/uploads/2012/11/IMG_0197-300x200.jpg" width="300" height="200" /></a><p class="wp-caption-text">Trolly going through the tunnel.</p></div>
<p>Leave a day on either end for miscellaneous things. I unintentionally had a whole day with nothing to do. I was finished with the archives on Wednesday, and didn&#8217;t need to leave until Friday. That left me with the whole day on Thursday to tie things up and get ready to leave. I did some laundry, packed my bags and wrote this. It&#8217;s also a good time to go through the notes to make sure you don&#8217;t forget anything.</p>
<h3>6. Enjoy!</h3>
<p>The final tip is to just enjoy the time. If you&#8217;re in a foreign country, take a day to go see the sights. I had a weekend where the archive was not even open, so I spent the day walking around the awesome Altstadt (the oldest part of town, buildings from the 1400&#8242;s!). If you have funding for your trip, just think, who else gets paid to go look at old documents. Man, history is great! <img src='http://mossiso.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2012/11/26/research-trip.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If at first you don&#8217;t succeed</title>
		<link>http://mossiso.com/2012/10/11/if-at-first-you-dont-succeed.html</link>
		<comments>http://mossiso.com/2012/10/11/if-at-first-you-dont-succeed.html#comments</comments>
		<pubDate>Thu, 11 Oct 2012 23:07:40 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Dissertation]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[School Work]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[digital maps]]></category>
		<category><![CDATA[exhibit]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[spreadsheets]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1356</guid>
		<description><![CDATA[&#8230;copy somebody&#8217;s code. Or at least your own from the past that works. I finally got the map to work for my Exhibit exhibit. See. &#160; First I copied the tutorial here. When that was working, I carefully copied it to the file I wanted it to be in and&#8230; nothing. Still broken. So next [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=If+at+first+you+don%27t+succeed&amp;rft.source=Ammon+Shepherd&amp;rft.date=2012-10-11&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2012%2F10%2F11%2Fif-at-first-you-dont-succeed.html&amp;rft.language=English&amp;rft.subject=Academic&amp;rft.subject=Coding&amp;rft.subject=Dissertation&amp;rft.subject=HowTo&amp;rft.subject=School+Work&amp;rft.subject=Technical&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>&#8230;copy somebody&#8217;s code. Or at least your own from the past that works.</p>
<p>I finally got the map to work for my Exhibit exhibit. <a href="http://chnm.gmu.edu/staff/ammon/clio3/tunnels.php">See</a>.</p>
<p>&nbsp;</p>
<p>First I copied the tutorial <a href="http://simile.mit.edu/wiki/Exhibit/2.0/Map_View_Tutorial">here</a>. When that was working, I carefully copied it to the file I wanted it to be in and&#8230; nothing. Still broken.</p>
<p>So next I commented out all extraneous stuff, and finally got it to work. Now came the fun part of tracking down what code was making my awesome map look like nothing. I narrowed it down to something within the &lt;header&gt; tag. So line by line I uncommented and tested until I tracked the issue down to the bootstrap.css file I was using.</p>
<p>Then came the same process within the bootstrap.css file. It was easily 1000 lines long, so a line by line process wasn&#8217;t going to work. Instead I commented out the first have of the file. Bing, the map displayed, so it was somewhere within that first 500 lines. Then I commented out the first 250 lines. Bing again. I kept dividing the culprits in half until I narrowed it down to styles for the img tag. Commented those out and I was in business.</p>
<p>Through that grueling process I lost the images of the documents on the first page. Now I have to figure out how to get those back, apply some styling and we&#8217;re all set.</p>
<p>Unfortunately I wasn&#8217;t ever able to get it to pull in the data from a spreadsheet, so the JSON file will have to do. The process for making a JSON file from a spreadsheet is simple:</p>
<p>1. Make the spreadsheet file so that the headers are encapsulated with curly braces &#8216;{ }&#8217;</p>
<p><a href="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-6.44.16-PM.png"><img class="alignnone size-full wp-image-1361" title="Screen Shot 2012-10-11 at 6.44.16 PM" src="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-6.44.16-PM.png" alt="" width="800" height="76" /></a></p>
<p>2. If you&#8217;re using Google spreadsheets, export it as an Excel file. You&#8217;ll have to open it in Excel and save it as an older file format, because the next step doesn&#8217;t like .xlsx.</p>
<p>3. Next, use <a href="http://service.simile-widgets.org/babel/">Similie&#8217;s Babel tool</a> to convert the spreadsheet to JSON.</p>
<p>4. Select &#8220;Excel&#8221; as the &#8220;from format&#8221; and &#8220;Exhibit JSON&#8221; as the &#8220;to format&#8221; and then browse to find the xls file you just made.</p>
<p>5. Click the &#8220;Upload and Convert&#8221; button.</p>
<p><a href="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-6.50.19-PM.png"><img class="alignnone size-large wp-image-1360" title="Screen Shot 2012-10-11 at 6.50.19 PM" src="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-6.50.19-PM-1024x474.png" alt="" width="550" height="254" /></a></p>
<p>6. The next screen is all of your spreadsheet data output into a nice JSON format.</p>
<p><a href="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-6.50.27-PM.png"><img class="alignnone size-full wp-image-1359" title="Screen Shot 2012-10-11 at 6.50.27 PM" src="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-6.50.27-PM.png" alt="" width="527" height="860" /></a></p>
<p>7. Now you can use this JSON file for any number of things. But it&#8217;s especially nice to use it in an Exhibit to display your data.</p>
<p><a href="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-6.52.53-PM.png"><img class="alignnone size-large wp-image-1357" title="Screen Shot 2012-10-11 at 6.52.53 PM" src="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-6.52.53-PM-1024x786.png" alt="" width="550" height="422" /></a></p>
<p>This is cross posted at the class blog <a href="http://www.fredgibbs.net/clio3workspace/blog/if-at-first-you-dont-succeed/">http://www.fredgibbs.net/clio3workspace/blog/if-at-first-you-dont-succeed/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2012/10/11/if-at-first-you-dont-succeed.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When  your OS updates break your CAM</title>
		<link>http://mossiso.com/2012/10/11/when-your-os-updates-break-your-cam.html</link>
		<comments>http://mossiso.com/2012/10/11/when-your-os-updates-break-your-cam.html#comments</comments>
		<pubDate>Thu, 11 Oct 2012 19:01:50 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[server admin]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1342</guid>
		<description><![CDATA[As I&#8217;m sure many people have run into this before, and from personal experience, found nothing roaming the Interwebs on how to fix it, and seeings how I just fixed it, I&#8217;ll write up a little how to fix it post. &#160; The set up: Two SunFire X2100 M2 servers connected to a StorageTek 2530 [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=When++your+OS+updates+break+your+CAM&amp;rft.source=Ammon+Shepherd&amp;rft.date=2012-10-11&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2012%2F10%2F11%2Fwhen-your-os-updates-break-your-cam.html&amp;rft.language=English&amp;rft.subject=Technical&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>As I&#8217;m sure many people have run into this before, and from personal experience, found nothing roaming the Interwebs on how to fix it, and seeings how I just fixed it, I&#8217;ll write up a little how to fix it post.</p>
<p>&nbsp;</p>
<h3>The set up:</h3>
<p>Two SunFire X2100 M2 servers connected to a StorageTek 2530 via iscsi. The two nodes are running CentOS 6.2 with RedHat cluster software. I have a server running Nagios for monitoring and it checks for failed disks on the StorageTek by running a script on either node that returns the number of &#8220;optimal&#8221; and &#8220;failed&#8221; disks.</p>
<p>&nbsp;</p>
<div id="attachment_1343" class="wp-caption aligncenter" style="width: 500px"><a href="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-1.45.03-PM.png"><img class="size-full wp-image-1343" title="server set up" src="http://mossiso.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-11-at-1.45.03-PM.png" alt="" width="490" height="237" /></a><p class="wp-caption-text">Two nodes connected to an array via iscsi (Ethernet)</p></div>
<h3>The problem:</h3>
<p>Updating system software is important. Keeping packages up to date protects from security vulnerabilities. Unfortunately, sometimes it breaks things. In this case, updating the suggested packages broke my set up, making it so that the Sun Storage CAM (Common Array Manager) software did not work anymore.</p>
<p>I first became alerted to this when Nagios sent me errors from the script checking the StorageTek disks. I checked the command that runs in the script to see what was up, and it returned several errors. Here they are for future googlers:</p>
<pre>sscs list -i 192.168.128.101 device</pre>
<p> returned &#8220;Command failed due to an exception. null&#8221; and</p>
<pre>sscs list -a arrayname host</pre>
<p> returned &#8220;arrayname : The resource was not found.&#8221;</p>
<p>Not particularly helpful messages.</p>
<p>Fortunately the nodes could still mount the array partitions, which allowed them to continue running as web and mysql servers. I just couldn&#8217;t run management commands on the array.</p>
<p>Since some of the required software for CAM was updated, I supposed that was causing the issue. The required software is listed below:</p>
<ul>
<li>libXtst-1.0.99.2-3.el6.i686.rpm and its dependent rpm (InstallShield requirement)</li>
<li>libselinux-2.0.94-2.el6.i686.rpm</li>
<li>audit-libs-2.0.4-1.el6.i686.rpm</li>
<li>cracklib-2.8.16-2.el6.i686.rpm</li>
<li>db4-4.7.25-16.el6.i686.rpm</li>
<li>pam-1.1.1-4.el6.i686.rpm</li>
<li>libstdc++-4.4.4-13.el6.i686.rpm</li>
<li>zlib-1.2.3-25.el6.i686.rpm</li>
<li>ksh-20100621-2.el6.x86_64.rpm</li>
</ul>
<p>&nbsp;</p>
<h3>The solution:</h3>
<p>I couldn&#8217;t figure out on my own exactly what was wrong, so I contacted Oracle support, and they finally tipped me off to the solution. Completely remove the CAM software and reinstall it. Those steps are outlined below:</p>
<ul>
<li>Go to the CAM software folder in <code>/var/opt/CommonArrayManager/Host_Software_6.9.0.16/bin/</code>and run</li>
</ul>
<pre>./uninstall -f</pre>
<ul>
<li>Here is a good spot to run <code>yum update</code> and restart the server if needed.</li>
<li>Change directories to where you have the CAM software install CD. There should be a folder called <code>components</code> in there. Change into that directory and install the jdk available there:</li>
</ul>
<pre>rpm -Uvh jdk-6u20-linux-i586.rpm</pre>
<ul>
<li>Next run the <code>RunMe.bin</code> file in the CAM Software CD folder.</li>
</ul>
<pre>./RunMe.bin -c</pre>
<ul>
<li>Install the RAID Proxy Agent package located in the Add_On/RaidArrayProxy directory of the latest CAM software distribution.</li>
</ul>
<pre>rpm -ivh SMruntime.xx.xx.xx.xx-xxxx.rpm</pre>
<pre>rpm -ivh SMagent-LINUX-xx.xx.xx.xx-xxxx.rpm</pre>
<ul>
<li>Register the array with the host/node. This process can take several minutes.</li>
</ul>
<pre>sscs register -d storage-system</pre>
<p>One additional issue I ran into, was that some update or other process shutdown the NIC connecting the node to the array. I had to make sure that was running before I ran the register -d storage-system command above.</p>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2012/10/11/when-your-os-updates-break-your-cam.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Multiple MySQL Instances on One Server</title>
		<link>http://mossiso.com/2012/07/31/making-multiple-mysql-instances-on-one-server.html</link>
		<comments>http://mossiso.com/2012/07/31/making-multiple-mysql-instances-on-one-server.html#comments</comments>
		<pubDate>Tue, 31 Jul 2012 19:15:08 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[database admin]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1275</guid>
		<description><![CDATA[I&#8217;m trying this new idea for backing up our production MySQL servers. I have a backup server that basically runs rdiff-backup in the morning across several servers, but then does nothing for the rest of the day. It&#8217;s a pretty decent machine, so I&#8217;d like to utilize some resources. Replicating a MySQL server is a [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=Making+Multiple+MySQL+Instances+on+One+Server&amp;rft.source=Ammon+Shepherd&amp;rft.date=2012-07-31&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2012%2F07%2F31%2Fmaking-multiple-mysql-instances-on-one-server.html&amp;rft.language=English&amp;rft.subject=HowTo&amp;rft.subject=Technical&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>I&#8217;m trying this new idea for backing up our production MySQL servers. I have a backup server that basically runs rdiff-backup in the morning across several servers, but then does nothing for the rest of the day. It&#8217;s a pretty decent machine, so I&#8217;d like to utilize some resources. Replicating a MySQL server is a good way to ensure High Availability in case of a failure. The backup server acts as a slave to the master (production) server. Basically, the slave is an exact copy of the master. They are two separate instances of MySQL server running on two physical servers. Whatever queries run on the master are sent to the slave so it can do the same. This way they are kept completely in sync. You could also have the slave take over for the master, should the master server happen to fail.</p>
<div id="attachment_1279" class="wp-caption aligncenter" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/07/master-and-slave.png"><img class="size-medium wp-image-1279 " title="master-and-slave" src="http://mossiso.com/wp-content/uploads/2012/07/master-and-slave-300x125.png" alt="" width="300" height="125" /></a><p class="wp-caption-text">The slave is an ever updating duplicate of the master.</p></div>
<p>The only problem I face with this set up, though, is that I have multiple production servers out there. So this only works if this backup server could be a slave for multiple machines.</p>
<div id="attachment_1283" class="wp-caption aligncenter" style="width: 258px"><a href="http://mossiso.com/wp-content/uploads/2012/07/no-2-masters.png"><img class="size-medium wp-image-1283" title="no-2-masters" src="http://mossiso.com/wp-content/uploads/2012/07/no-2-masters-248x300.png" alt="" width="248" height="300" /></a><p class="wp-caption-text">No slave can serve two masters.</p></div>
<p>This is not possible, though, because, of course, <a href="https://www.lds.org/scriptures/nt/matt/6.24?lang=eng#23" target="_blank">no slave can serve two masters</a>. Fortunately, a server can have multiple instances of MySQL running on it! So, in a sense, we have a server with multiple MySQL instances, to which a master can replicate. More about that set up in an upcoming post.</p>
<div id="attachment_1281" class="wp-caption aligncenter" style="width: 252px"><a href="http://mossiso.com/wp-content/uploads/2012/07/mm-slave.png"><img class="size-medium wp-image-1281" title="mm-slave" src="http://mossiso.com/wp-content/uploads/2012/07/mm-slave-242x300.png" alt="" width="242" height="300" /></a><p class="wp-caption-text">The slave has multiple instances of MySQL running.</p></div>
<p>A how to on <a href="http://blog.mydream.com.hk/howto/linux/mysql-multiple-instance-on-centos-howto" target="_blank">this blog</a>, shows how this can be done. I&#8217;ll replicate the process below.</p>
<h2>STEPS TO MULTIPLE MYSQL MADNESS</h2>
<h3>On the slave server</h3>
<h4>Step 1. Install MySQL</h4>
<p>We&#8217;ll be working with CentOS 5.8, but this could really apply for any OS. First we&#8217;ll need to install MySQL like normal.</p>
<pre>yum install mysql mysql-server</pre>
<p>There are plenty of good tutorials out there on how to install the specific version of MySQL you want on the specific OS you&#8217;re running.</p>
<h4>Step 2. Set up the data area.</h4>
<p>You&#8217;ll need to have a different folder for each of the MySQL instances, say <code>/dbases/master-a/</code>, <code>/dbases/master-b/</code>, and <code>/dbases/master-c/</code>.</p>
<pre>mkdir -p /dbases/{master-a,master-b,master-c}</pre>
<h4>Step 3. Copy the default my.cnf file</h4>
<p>This is the default MySQL config file, it may be named differently on other OSes.</p>
<pre>cp /etc/my.cnf /etc/master-a.cnf; cp /etc/my.cnf /etc/master-b.cnf; cp /etc/my.cnf /etc/master-c.cnf</pre>
<h4>Step 4. Edit the new MySQL config files.</h4>
<p>For each new config file, you&#8217;ll need to specify some unique variables.</p>
<pre>
[mysqld]
port=3307
datadir=/dbases/master-a
socket=/dbases/master-a/mysql.sock
user=mysql
server_id=3307
log-bin=/dbases/master/mysql-bin.log

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
symbolic-links=0

[mysqld_safe]
log-error=/dbases/master-a/mysqld.log
pid-file=/dbases/master-a/mysqld.pid
</pre>
<p>The <code>port</code> option sets this MySQL instance on a different port than the default 3306. The <code>datadir</code>, <code>socket</code>, <code>log-bin</code>, <code>log-error</code>, and <code>pid-file</code> options make sure the necessary files are not using the default files.</p>
<h4>Step 5. Create new init scripts.</h4>
<p>The init script allows the server to start and stop the service at boot time, and allows for easy start up and shutdown (on CentOS/RedHat, at least &#8211; with an easy <code>service mysqld start</code>).</p>
<pre>cp /etc/init.d/mysqld /etc/init.d/mysqld-master-a</pre>
<p>Just do one for now. We&#8217;ll copy the new one to create the others, then just do a quick search and replace in those files to change the master-a to master-b and master-c.</p>
<h4>Step 6. Edit the init script</h4>
<div style="border: 1px solid #ddd; margin: 10px; padding: 10px;">
<pre>#!/bin/bash
#
# mysqld        This shell script takes care of starting and stopping
#               the MySQL subsystem (mysqld).
#
# chkconfig: - 64 36
# description:  MySQL database server.
# processname: mysqld
# config: <span style="color: #3366ff;">/etc/master-a.cnf</span>
# pidfile: <span style="color: #3366ff;">/dbases/master-a/mysqld.pid</span>

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

prog="MySQL"

# extract value of a MySQL option from config files
# Usage: get_mysql_option SECTION VARNAME DEFAULT
# result is returned in $result
# We use my_print_defaults which prints all options from multiple files,
# with the more specific ones later; hence take the last match.
get_mysql_option(){
        result=`/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1`
        if [ -z "$result" ]; then
            # not found, use default
            result="$3"
        fi
}

get_mysql_option mysqld datadir "<span style="color: #3366ff;">/dbases/master-a</span>"
datadir="<span style="color: #3366ff;">/dbases/master-a</span>"
get_mysql_option mysqld socket "<span style="color: #3366ff;">/dbases/master-a/mysql.sock</span>"
socketfile="<span style="color: #3366ff;">/dbases/master-a/mysql.sock</span>"
get_mysql_option mysqld_safe log-error "<span style="color: #3366ff;">/dbases/master-a/mysqld.log</span>"
errlogfile="<span style="color: #3366ff;">/dbases/master-a/mysqld.log</span>"
get_mysql_option mysqld_safe pid-file "<span style="color: #3366ff;">/dbases/master-a/mysqld.pid</span>"
mypidfile="<span style="color: #3366ff;">/dbases/master-a/mysqld.pid</span>"

<span style="color: #3366ff;">defaultfile="/etc/master-a.cnf"</span>

start(){
        touch "$errlogfile"
        chown mysql:mysql "$errlogfile"
        chmod 0640 "$errlogfile"
        [ -x /sbin/restorecon ] &amp;&amp; /sbin/restorecon "$errlogfile"
        if [ ! -d "$datadir/mysql" ] ; then
            action $"Initializing MySQL database: " /usr/bin/mysql_install_db --datadir="$datadir" --user=mysql
            ret=$?
            chown -R mysql:mysql "$datadir"
            if [ $ret -ne 0 ] ; then
                return $ret
            fi
        fi
        chown mysql:mysql "$datadir"
        chmod 0755 "$datadir"
        # Pass all the options determined above, to ensure consistent behavior.
        # In many cases mysqld_safe would arrive at the same conclusions anyway
        # but we need to be sure.
        /usr/bin/mysqld_safe  <span style="color: #3366ff;">--defaults-file="$defaultfile"</span> --datadir="$datadir" --socket="$socketfile" \
                --log-error="$errlogfile" --pid-file="$mypidfile" \
                --user=mysql &gt;/dev/null 2&gt;&amp;1 &amp;
        ret=$?
        # Spin for a maximum of N seconds waiting for the server to come up.
        # Rather than assuming we know a valid username, accept an "access
        # denied" response as meaning the server is functioning.        
        if [ $ret -eq 0 ]; then
            STARTTIMEOUT=30
            while [ $STARTTIMEOUT -gt 0 ]; do
                RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2&gt;&amp;1` &amp;&amp; break
                echo "$RESPONSE" | grep -q "Access denied for user" &amp;&amp; break
                sleep 1
                let STARTTIMEOUT=${STARTTIMEOUT}-1
            done
            if [ $STARTTIMEOUT -eq 0 ]; then
                    echo "Timeout error occurred trying to start MySQL Daemon."
                    action $"Starting $prog: " /bin/false
                    ret=1
            else
                    action $"Starting $prog: " /bin/true
            fi
        else
            action $"Starting $prog: " /bin/false
        fi
        [ $ret -eq 0 ] &amp;&amp; touch <span style="color: #3366ff;">/dbases/master-a/mysqld</span>
        return $ret
}

stop(){ 
        MYSQLPID=`cat "$mypidfile"  2&gt;/dev/null `
        if [ -n "$MYSQLPID" ]; then
            /bin/kill "$MYSQLPID" &gt;/dev/null 2&gt;&amp;1
            ret=$?
            if [ $ret -eq 0 ]; then
                STOPTIMEOUT=60
                while [ $STOPTIMEOUT -gt 0 ]; do
                    /bin/kill -0 "$MYSQLPID" &gt;/dev/null 2&gt;&amp;1 || break
                    sleep 1
                    let STOPTIMEOUT=${STOPTIMEOUT}-1
                done
                if [ $STOPTIMEOUT -eq 0 ]; then
                    echo "Timeout error occurred trying to stop MySQL Daemon."
                    ret=1
                    action $"Stopping $prog: " /bin/false
                else
                    rm -f <span style="color: #3366ff;">/dbases/master-a/mysqld</span>
                    rm -f "$socketfile"
                    action $"Stopping $prog: " /bin/true
                fi
            else
                action $"Stopping $prog: " /bin/false
            fi
        else
            ret=1
            action $"Stopping $prog: " /bin/false
        fi
        return $ret
}

restart(){
    stop
    start
}

condrestart(){
    [ -e <span style="color: #3366ff;">/dbases/master-a/mysqld</span> ] &amp;&amp; restart || :
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  status)
    status mysqld
    ;;
  restart)
    restart
    ;;
  condrestart)
    condrestart
    ;;
  *)
    echo $"Usage: $0 {start|stop|status|condrestart|restart}"
    exit 1
esac

exit $?</pre>
</div>
<h4>Step 7. Start each MySQL instance.</h4>
<p>Now you can start each instance with the handy <code>service</code> command.</p>
<pre>service mysqld-master-a start</pre>
<h4>Step 8. Connect to MySQL instances.</h4>
<p>Now, to connect to each MySQL instance, you&#8217;ll need to specify the port and/or socket file.</p>
<pre>mysql -P3307 --socket="/dbases/mysql-master-a/mysql.sock"</pre>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2012/07/31/making-multiple-mysql-instances-on-one-server.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Backing up MySQL with Replication and Incremental Files &#8211; Part 1</title>
		<link>http://mossiso.com/2012/07/24/backing-up-mysql-with-replication-and-incremental-files-part-1.html</link>
		<comments>http://mossiso.com/2012/07/24/backing-up-mysql-with-replication-and-incremental-files-part-1.html#comments</comments>
		<pubDate>Tue, 24 Jul 2012 19:49:38 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[database admin]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[server admin]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1277</guid>
		<description><![CDATA[I&#8217;m trying this new idea for backing up our production MySQL servers. I have a backup server that basically runs rdiff-backup in the morning across several servers, but then does nothing for the rest of the day. It&#8217;s a pretty decent machine, so I&#8217;d like to utilize some resources. Databases are a tough cookie to [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=Backing+up+MySQL+with+Replication+and+Incremental+Files+-+Part+1&amp;rft.source=Ammon+Shepherd&amp;rft.date=2012-07-24&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2012%2F07%2F24%2Fbacking-up-mysql-with-replication-and-incremental-files-part-1.html&amp;rft.language=English&amp;rft.subject=HowTo&amp;rft.subject=Technical&amp;rft.subject=Technology&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>I&#8217;m trying this new idea for backing up our production MySQL servers. I have a backup server that basically runs rdiff-backup in the morning across several servers, but then does nothing for the rest of the day. It&#8217;s a pretty decent machine, so I&#8217;d like to utilize some resources. Databases are a tough cookie to backup. You can&#8217;t just copy the data files and then expect to copy them back over and have them just work. Especially if your databases have a mixture of InnoDB and MyISAM tables. In order to do a clean and accurate database backup, you need to stop the MySQL server, then copy the files, then restart MySQL.</p>
<p>If you have a live production MySQL server, stopping it to make a backup is not really an option. Fortunately there are a few options. Before you decide on which option to choose, here is a list of things to keep in mind when choosing a backup solution (from the MySQL gurus at Percona):</p>
<h3>WHAT TO LOOK FOR</h3>
<p><a href="http://www.mysqlperformanceblog.com/2009/03/03/10-things-you-need-to-know-about-backup-solutions-for-mysql/" target="_blank">http://www.mysqlperformanceblog.com/2009/03/03/10-things-you-need-to-know-about-backup-solutions-for-mysql/</a></p>
<ol>
<li>Does the backup require shutting down MySQL? If not, what is the impact on the running server? Blocking, I/O load, cache pollution, etc?</li>
<li>What technique is used for the backup? Is it mysqldump or a custom product that does something similar? Is it a filesystem copy?</li>
<li>Does the backup system understand that <em>you cannot back up InnoDB by simply copying its files</em>?</li>
<li>Does the backup use FLUSH TABLES, LOCK TABLES, or FLUSH TABLES WITH READ LOCK? These all interrupt processing.</li>
<li>What other effects are there on MySQL? I’ve seen systems that do a RESET MASTER, which immediately breaks replication. Are there any FLUSH commands at all, like FLUSH LOGS?</li>
<li>How does the system guarantee that you can perform point-in-time recovery?</li>
<li>How does the system guarantee consistency with the binary log, InnoDB logs, and replication?</li>
<li>Can you use the system to set up new MySQL replication slaves? How?</li>
<li>Does the system verify that the backup is restorable, e.g. does it run InnoDB recovery before declaring success?</li>
<li>Does anyone stand behind it with support, and guarantee working, recoverable backups? How strong is the legal guarantee of this and how much insurance do they have?</li>
</ol>
<p>&nbsp;</p>
<h3>BACKUP PROGRAMS</h3>
<p>There are a few MySQL backup products out there as well. I have used the first two on this list.</p>
<ul>
<li><a href="http://sourceforge.net/projects/automysqlbackup/" target="_blank">AutoMySQLBackup</a> script (handy for making a rotating incremental backup of your MySQL databases).</li>
<li><a href="http://www.percona.com/software/percona-xtrabackup/" target="_blank">Percona XtraBackup</a> (nice way to ensure InnoDB and MyISAM tables are backed up properly, also does it incrementally)</li>
<li><a href="https://zmanda.com/backup-mysql.html" target="_blank">Zmanda</a> (seems to be similar to Percona&#8217;s set up)</li>
</ul>
<p>There&#8217;s probably a gazillion more out there. Google&#8217;s your friend in finding things you need.</p>
<h3>HOW TO DO IT</h3>
<div id="attachment_1279" class="wp-caption alignright" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/07/master-and-slave.png"><img class="size-medium wp-image-1279" title="master-and-slave" alt="" src="http://mossiso.com/wp-content/uploads/2012/07/master-and-slave-300x125.png" width="300" height="125" /></a><p class="wp-caption-text">How to get a copy of the master to the slave?</p></div>
<p>There are several options. You could use a script above, or create a slave of the database (basically an exact copy of the production MySQL server &#8211; all changes that occur in the master are sent to the slave), or some combination. I&#8217;ll use a combination. I&#8217;ll replicate the production server onto the backup server, then run the incremental backups from there. This first part will walk through the process of setting up MySQL replication.</p>
<p>To give proper credit, here are several other how to&#8217;s I found helpful.</p>
<ul>
<li><a href="http://www.badllama.com/content/mysql-backups-using-lvm-snapshots" target="_blank">http://www.badllama.com/content/mysql-backups-using-lvm-snapshots</a></li>
<li><a href="http://www.mysqlperformanceblog.com/2006/08/21/using-lvm-for-mysql-backup-and-replication-setup/" target="_blank">http://www.mysqlperformanceblog.com/2006/08/21/using-lvm-for-mysql-backup-and-replication-setup/</a></li>
<li><a href="http://www.softwareprojects.com/resources/programming/t-how-to-move-copy-a-live-mysql-database-and-what-1257.html" target="_blank">http://www.softwareprojects.com/resources/programming/t-how-to-move-copy-a-live-mysql-database-and-what-1257.html</a></li>
<li><a href="http://www.clusterdb.com/mysql-cluster/get-mysql-replication-up-and-running-in-5-minutes/" target="_blank">http://www.clusterdb.com/mysql-cluster/get-mysql-replication-up-and-running-in-5-minutes/</a></li>
</ul>
<h3>On the master server</h3>
<p><strong>Step 1.</strong> Edit the my.cnf file to include at least the following (if needed) lines. Note: you will have to restart MySQL for these changes to take affect.</p>
<div style="padding-left: 30px; margin-bottom: 50px;">
<pre>
[mysqld]
server_id=1
innodb_flash_log_at_trx_commit=1
log_bin=mysql-bin.log
sync_binlog=1
</pre>
</div>
<p><strong>Step 2.</strong> Make a MySQL user for the slave to use.</p>
<div style="padding-left: 30px; margin-bottom: 50px;">In a MySQL session on the terminal, type in the command:</p>
<pre>GRANT REPLICATION SLAVE ON *.* TO 'rep_user'@'localhost' IDENTIFIED BY 'passwordhere';</pre>
</div>
<p><strong>Step 3.</strong> Open a terminal session and log in to a MySQL prompt. Type the following command and hit enter.</p>
<div style="padding-left: 30px; margin-bottom: 50px;">
<pre>FLUSH TABLES WITH READ LOCK</pre>
<p>Note: This will lock your database so that no changes can be made from any web applications or other programs. This session should remain open, and the database locked for the next few steps.</p>
</div>
<p><strong>Step 4.</strong> After the FLUSH TABLES command finishes, run the following command and press enter.</p>
<div style="padding-left: 30px; margin-bottom: 50px;">
<pre>SHOW MASTER STATUS</pre>
<p>Record the information under &#8220;File Name&#8221; and &#8220;Position&#8221;.</p>
</div>
<p><strong>Step 5. </strong> Make a copy of the database files.</p>
<div style="padding-left: 30px; margin-bottom: 50px;">
<p><strong>5.1 LVM Snapshot:</strong></p>
<p>In another terminal session, run the following command to make an LVM snapshot of the database.</p>
<pre>lvcreate -L10G -s -n mysql-backup /dev/mapper/dbases</pre>
<p>This creates a snapshot of the database files very quickly. We can use the snapshot later to copy the data to the backup server without interfering with the original database files.</p>
<p>After this command finishes, you can unlock the database as shown in the next step. Then you can mount the new LVM partition and copy the files to the backup server.</p>
<pre>mkdir -p /mnt/mysql-backup</pre>
<pre>mount -o nouuid /dev/mapper/mysql-backup /mnt/mysql-backup</pre>
<pre>rsync -avz -e "ssh -c blowfish" /mnt/mysql-backup user@remote.host:/backup/location</pre>
<p><strong>5.2 RSYNC:</strong></p>
<p>If you don&#8217;t have your database files on an LVM partition, you can just copy the files to the backup server now using rsync, scp or what have you. This will take significantly longer (depending on the size of your database), leaving the database in a locked state.</p>
<pre>rsync -avz -e "ssh -c blowfish" /dbases/mysql user@remote.host:/backup/location</pre>
<p><strong>5.3 MySQL Dump:</strong></p>
<p>You could also take a mysqldump of the database and copy that SQL file to the other server.</p>
<pre>mysqldump -uuser -p --all-databases &gt; mysql-backup.sql</pre>
<pre>scp mysql-backup.sql user@remote.host:/backup/location</pre>
</div>
<p><strong>Step 6.</strong> Once the lvcreate command has finished, you can unlock the database.</p>
<div style="padding-left: 30px; margin-bottom: 50px;">
<pre>UNLOCK TABLES</pre>
</div>
<p><strong>Step 7.</strong> If you haven&#8217;t already, copy the copy of the database files to the backup server.</p>
<h3>On the slave server</h3>
<p><strong>Step 1.</strong> Edit the my.cnf file to include at least the following (if needed) lines. Note: you will have to restart MySQL for these changes to take affect.</p>
<div style="padding-left: 30px; margin-bottom: 50px;">
<pre>
[mysqld]
server_id=2
</pre>
</div>
<p><strong>Step 2.</strong> Start MySQL and run the following commands in a mysql session to start the MySQL slave.</p>
<div style="padding-left: 30px; margin-bottom: 50px;">
<pre>
CHANGE MASTER TO
MASTER_HOST = "master.server.com",
MASTER_USER = "rep_user",
MASTER_PASSWORD = "passwordhere",
MASTER_LOG_FILE = "mysql-bin.log",
MASTER_LOG_POS = 2341234;
</pre>
<p>The MASTER_HOST is the domain name or IP address of the master server. MASTER_USER, MASTER_PASSWORD were created on the master server in <strong>Step 2</strong>. MASTER_LOG_FILE and MASTER_LOG_POS were gathered in <strong>Step 4</strong>.Then, finally, to start the slave, issue the following command in mysql.</p>
<pre>START SLAVE;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2012/07/24/backing-up-mysql-with-replication-and-incremental-files-part-1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>THATCamp 2012</title>
		<link>http://mossiso.com/2012/06/18/thatcamp-2012.html</link>
		<comments>http://mossiso.com/2012/06/18/thatcamp-2012.html#comments</comments>
		<pubDate>Mon, 18 Jun 2012 21:05:51 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Dissertation]]></category>
		<category><![CDATA[humanities]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[digital archives]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[nazis]]></category>
		<category><![CDATA[proceedings]]></category>
		<category><![CDATA[THATCamp]]></category>
		<category><![CDATA[weka]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1258</guid>
		<description><![CDATA[Believe it or not, this was my first ever THATCamp experience. Seems hard to imagine since I have worked at CHNM since before the inception of THATCamp.  Ah, well, the stars finally aligned, and was able to attend this year. And it was great. &#160; I attended three workshops on Friday, and a couple of [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=THATCamp+2012&amp;rft.source=Ammon+Shepherd&amp;rft.date=2012-06-18&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2012%2F06%2F18%2Fthatcamp-2012.html&amp;rft.language=English&amp;rft.subject=Academic&amp;rft.subject=Dissertation&amp;rft.subject=humanities&amp;rft.subject=Technical&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>Believe it or not, this was my first ever <a href="http://thatcamp.org/">THATCamp</a> experience. Seems hard to imagine since I have worked at CHNM since before the inception of THATCamp.  Ah, well, the stars finally aligned, and was able to attend this year. And it was great.</p>
<p>&nbsp;</p>
<p>I attended three <a href="http://chnm2012.thatcamp.org/workshops/">workshops</a> on Friday, and a <a href="http://chnm2012.thatcamp.org/06/11/a-better-blogging-assignment/">couple</a> of <a href="http://chnm2012.thatcamp.org/06/15/shell-tutorial/">sessions</a> on Saturday. Here are some thoughts&#8230;</p>
<p><a href="http://chnm2012.thatcamp.org/workshops/#data-mining">Digital Data Mining with Weka</a>: This was a neat <a href="http://www.cs.gmu.edu/~hrangwal/dhdm">crash course</a> on what data mining is and is not, and one free tool to help do some of that. It was more of a &#8220;here&#8217;s what&#8217;s out there, how does it apply to the humanities&#8221; than a hands on, hands dirty, do some real work type of work shop. But it was good in that it opened up the possibility to do some data mining in the future. Since they were relatively small, here my notes:</p>
<p>What is data mining?</p>
<p>examples:</p>
<ul>
<li>recommend ads, products to users based on purchases</li>
<li>finding patterns in large amounts of text (writing algorithms to find those patterns)</li>
</ul>
<p>Goal of data mining is to predict what users/people will do based on data from other users/people</p>
<p>Data mining Tasks: classification, clustering, association rule discovery, sequential pattern discovery, regression, deviation detection</p>
<p>Goal is to predict the classification (or whatever) of future data, based on the current data that you analyze.</p>
<p>Cross validation (when done correctly you get true results, when not done correctly you get false results)</p>
<p>have multiple sets of data, one for training and the other for testing. Build the algorithm on the training data, then run it on the test. Then cycle through each testing data set and have it act as a training set. Do this way because you know the results for each, so you can tell if your algorithm is correct. When it&#8217;s good then you can use it on future data where you don&#8217;t know the result.</p>
<p><a href="http://chnm2012.thatcamp.org/workshops/#git">Interesting Things You Can Do With Gi</a>t: This one was highly anticipated. I have been wanting/needing to learn git for a while now. For being in the IT field, having written some code, and even having a GitHub account with code on it, I&#8217;m ashamed to say I still don&#8217;t know how to use git effectively. There is not much you can do in 1.5 hours, and this was more a theoretical &#8220;here are some ideas&#8221;, than a &#8220;here is how to do it&#8221; approach.</p>
<p>The session on using <a href="http://chnm2012.thatcamp.org/06/11/a-better-blogging-assignment/">blogs as assignments</a> was maybe a bit premature for me. The session was really good, great ideas, tips, etc. But me teaching is still too far away for me to have put the mental effort in to following along much. I spent most of the time trying to find a good twitter client, but in the end just stuck with <a href="http://adium.im/">Adium</a>.</p>
<p>Then I took some time to enjoy the hacker space. I decided it was time, and this was the perfect place to set up a transcription tool for my dissertation archive. So sitting at the very table where it is coded, I installed the <a href="http://scripto.org/">Scripto</a> plugin for Omeka. That&#8217;s a bit of a misnomer, since it is really a wrapper that lets Omeka and a Wikimedia install play nicely together. I went ahead and transcribed one of the documents in the archive as well. The archive is just in the testing phase, but here it is anyways: <a href="http://nazitunnels.org/archive">http://nazitunnels.org/archive</a></p>
<div id="attachment_1261" class="wp-caption aligncenter" style="width: 790px"><a href="http://nazitunnels.org/archive/"><img class=" wp-image-1261  " title="Screen Shot 2012-06-18 at 4.50.06 PM" src="http://mossiso.com/wp-content/uploads/2012/06/Screen-Shot-2012-06-18-at-4.50.06-PM.png" alt="" width="780" height="658" /></a><p class="wp-caption-text">Nazi Tunnels Archive</p></div>
<p>The final event of THATCamp for me was one last session proposed by a fellow &#8220;camper&#8221;. She wanted help <a href="http://chnm2012.thatcamp.org/06/15/shell-tutorial/">learning about the shell</a>/terminal/command line. So I volunteered to help out with that. It ended up that there were about eight people that wanted help learning the command line, and four of us that knew what we were doing. So it ended up being a great ratio of help needed to those who could offer it. We started with the very basics, didn&#8217;t get much past a few commands (ls, cd, rm, nano, grep, cat), but we went slow enough that everybody who was trying to follow along was able to, and they all left with a clearer understanding of what the shell is for, and why it is useful. The proposer found a <a href="http://cli.learncodethehardway.org/book/">great tutorial/book for learning the command line</a> that I&#8217;ll have to go through as well. You can always learn something new.</p>
<p>What was also great about that session, since it was basically ran by those who needed the help, I saw how those who struggle with these concepts learn them, so I will hopefully be better able to teach them to others in the future.</p>
<p>&nbsp;</p>
<p>UPDATE: I forgot to mention the many cool sites and projects mentioned during Saturday morning&#8217;s Dork Shorts. Here&#8217;s a list of the ones I took notice of.</p>
<p><a href="http://afripod.aodl.org/">http://afripod.aodl.org/</a><br />
<a href="https://github.com/AramZS/twitter-search-shortcode">https://github.com/AramZS/twitter-search-shortcode</a><br />
<a href="http://cowriting.trincoll.edu/">http://cowriting.trincoll.edu/</a><br />
<a href="http://www.digitalculture.org/2012/06/15/dcw-volume-1-issue-4-lib-report-mlaoa-and-e-lit-pedagogy/">http://www.digitalculture.org/2012/06/15/dcw-volume-1-issue-4-lib-report-mlaoa-and-e-lit-pedagogy/</a><br />
<a href="http://luna.folger.edu/luna/servlet/BINDINGS~1~1">http://luna.folger.edu/luna/servlet/BINDINGS~1~1</a><br />
<a href="http://www.insidehighered.com/blogs/gradhacker">http://www.insidehighered.com/blogs/gradhacker</a><br />
<a href="http://hacking.fugitivetexts.net/">http://hacking.fugitivetexts.net/</a><br />
<a href="http://jitp.commons.gc.cuny.edu/">http://jitp.commons.gc.cuny.edu/</a><br />
<a href="http://www.neh.gov/">http://www.neh.gov/</a><br />
<a href="http://penn.museum/">http://penn.museum/</a><br />
<a href="http://www.playthepast.org/">http://www.playthepast.org/</a><br />
<a href="http://anglicanhistory.org/">http://anglicanhistory.org/</a><br />
<a href="http://podcast.gradhacker.org/">http://podcast.gradhacker.org/</a><br />
<a href="http://dhcommons.org/">http://dhcommons.org/</a><br />
<a href="http://ulyssesseen.com/">http://ulyssesseen.com/</a><br />
<a href="http://m.thehenryford.org/">http://m.thehenryford.org/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2012/06/18/thatcamp-2012.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Filling in the missing dates with AWStats</title>
		<link>http://mossiso.com/2012/04/25/filling-in-the-missing-dates-with-awstats.html</link>
		<comments>http://mossiso.com/2012/04/25/filling-in-the-missing-dates-with-awstats.html#comments</comments>
		<pubDate>Wed, 25 Apr 2012 19:23:58 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bash code]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1226</guid>
		<description><![CDATA[Doh! Sometimes AWStats will miss some days in calculating stats for your site, and that leaves a big hole in your records. Usually, as in my case, it&#8217;s because I messed up. I reinstalled some software on our AWStats machine, and forgot to reinstall cron. Cron is the absolutely necessary tool for getting the server [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=Filling+in+the+missing+dates+with+AWStats&amp;rft.source=Ammon+Shepherd&amp;rft.date=2012-04-25&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2012%2F04%2F25%2Ffilling-in-the-missing-dates-with-awstats.html&amp;rft.language=English&amp;rft.subject=Technical&amp;rft.subject=Websites&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><h3>Doh!</h3>
<p>Sometimes AWStats will miss some days in calculating stats for your site, and that leaves a big hole in your records. Usually, as in my case, it&#8217;s because I messed up. I reinstalled some software on our AWStats machine, and forgot to reinstall cron. Cron is the absolutely necessary tool for getting the server to run things on a timed schedule. I didn&#8217;t notice this until several days later, leading to a large gap in the stats for April.</p>
<h3>What to do?</h3>
<p>Fortunately, there is a fix. Unfortunately, it&#8217;s a bit labor intensive, and depends on how you rotate your apache logs (if at all, which you should). The <a href="http://awstats.sourceforge.net/docs/awstats_faq.html#OLDLOG">AWStats Documentation</a> (see FAQ-COM350 and FAQ-COM360) has some basic steps to fix the issue, outlined below:</p>
<ol>
<li>Move the AWStats data files for months newer to a temporary directory.</li>
<li>Copy the Apache logs with all of the stats for the month with the missing days to a temporary directory.</li>
<li>Run the AWStats update tool, using AWStat&#8217;s logresolvemerge tool and other changed paramaters, to re-create the AWStats data file for that month</li>
<li>Replace the AWStats data files for the following months (undo step 1).</li>
</ol>
<h3>The Devil&#8217;s in the Details</h3>
<p>Again, depending on how you have Apache logs set up, this can be an intensive process. Here&#8217;s how I have Apache set up, and the process I went through to get the missing days back into AWStats.</p>
<p>We have our Apache logs rotate each day for each domain on the server (or sub-directory that is calculated separately). This means I&#8217;ll have to do this process about 140 times. Looks like I need to write a script&#8230;</p>
<h3>Step 1. Move the data files of newer months</h3>
<p>AWStats can&#8217;t run the update on older months if there are more recent months located in the data directory. So we&#8217;ll need to move the more recent month&#8217;s stats to a temporary location out of the way. So, if the missing dates are in June, and it is currently August, you&#8217;ll need to remove the data files for June, July, and August (they look like this <code>awstatsMMYYYY.domain-name.com.txt</code> where MM is the two digit month and YYYY is the four digit year) to a temporary directory so they are out of the way.</p>
<h3>Step 2. Get the Apache logs for the month.</h3>
<p>First step is to get all of the logs for each domain for the month. This will work out to about 30 or 31 files (if the month is already past), or however many days have past in the current month. For me, each domain archives the days logs in the following format <code>domain.name.com-access_log-X.gz</code> and <code>domain.name.com-error_log-X.gz</code> where the X is a sequential number. So the first problem is how to get the correct file name without having to look in each file to see if it has the right day? Fortunately for me, nothing touches these files after they are created, so their mtime (the <strong>time</strong> stamp of when they were last <strong>m</strong>odified) is intact and usable. Now, a quick one-liner to grab all of the files within a certain date range and put their content in a new file.</p>
<p>We&#8217;ll use the find command to find the correct files. Before we construct that command, we&#8217;ll need to create a couple of files to use for our start and end dates.</p>
<pre>touch --date YYYY-MM-DD /tmp/start</pre>
<pre>touch --date YYYY-MM-DD /tmp/end</pre>
<p>Now we can use those files in the actual find command. You may need to create the <code>/tmp/apachelogs/</code> directory first.</p>
<pre>find /path/to/apache/logs/archive/ -name "domain-name.com-*" -newer /tmp/start -not -newer /tmp/end -exec cp '{}' /tmp/apachelogs/ \;</pre>
<p>Now unzip those files so they are usable. Move into the <code>/tmp/apachelogs/</code> directory, and run the gunzip command.</p>
<pre>gunzip *log*</pre>
<p>If you are doing the current month, then copy in the current apache log for that domain.</p>
<pre>cp /path/to/apache/logs/current/domain-name.com* /tmp/apachelogs/</pre>
<p>This puts all of the domains log files for the month into a directory that we can use in the AWStats update command</p>
<p>Things to note: You need to make sure that each of the log files you have just copied use the same format. You also need to make sure they only contain data for one month. You can edit the files by hand or throw some fancy sed commands at the files to remove any extraneous data.</p>
<h3>Step 3. Run the AWStats logresolvemerge and update tool</h3>
<p>Now comes the fun part. We first run the logresolvemerge tool on the log files we created in the previous step to create one single log file for the whole month. While in the &lt;code&gt;/tmp/apachelogs/&lt;/code&gt; directory, run:</p>
<pre>perl /path/to/logresolvemerger.pl *log* &gt; domain-name.com-YYYY-MM-log</pre>
<p>Now, we need to run the AWStats update tool with a few parameters to account for the location of the new log file.</p>
<pre>perl /path/to/awstats.pl -update -configdir="/path/to/awstats/configs" -config="domain-name.com" -LogFile="/tmp/apachelogs/domain-name.com-YYYY-MM-log"</pre>
<h3>Step 4. Move back any remaining files</h3>
<p>If you moved any of the AWStats data files (<code>awstatsMMYYYY.domain-name.com.txt</code> like for July and August in our example) now&#8217;s the time to move them back where they go.</p>
<p>&nbsp;</p>
<p>Yeah, that fixed it!</p>
<p>&nbsp;</p>
<div id="attachment_1245" class="wp-caption aligncenter" style="width: 668px"><a href="http://mossiso.com/wp-content/uploads/2012/04/awstats-fixed.png"><img class="size-full wp-image-1245" title="awstats-fixed" src="http://mossiso.com/wp-content/uploads/2012/04/awstats-fixed.png" alt="" width="658" height="160" /></a><p class="wp-caption-text">Phew! The missing dates are back!</p></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2012/04/25/filling-in-the-missing-dates-with-awstats.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scrivener and Zotero</title>
		<link>http://mossiso.com/2012/04/12/scrivener-and-zotero.html</link>
		<comments>http://mossiso.com/2012/04/12/scrivener-and-zotero.html#comments</comments>
		<pubDate>Thu, 12 Apr 2012 20:51:43 +0000</pubDate>
		<dc:creator>ammon</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Dissertation]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[libreoffice]]></category>
		<category><![CDATA[scrivener]]></category>
		<category><![CDATA[writing]]></category>
		<category><![CDATA[zotero]]></category>

		<guid isPermaLink="false">http://mossiso.com/?p=1190</guid>
		<description><![CDATA[Scrivener is awesome software for writing, that I&#8217;ve mentioned before, but I had yet to really test out the integration with Zotero (my citation manager of choice). So now that I have finally started on my dissertation writing in earnest (and not grant writing), I needed to make sure that footnotes are usable in my [...]]]></description>
				<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=Scrivener+and+Zotero&amp;rft.source=Ammon+Shepherd&amp;rft.date=2012-04-12&amp;rft.identifier=http%3A%2F%2Fmossiso.com%2F2012%2F04%2F12%2Fscrivener-and-zotero.html&amp;rft.language=English&amp;rft.subject=Academic&amp;rft.subject=Dissertation&amp;rft.subject=History&amp;rft.subject=Technical&amp;rft.aulast=Shepherd&amp;rft.aufirst=Ammon"></span><p>Scrivener is awesome software for writing, that I&#8217;ve <a title="Nazi Tunnels" href="http://nazitunnels.org/2011/04/digging-in-to-the-dissertation.html" target="_blank">mentioned</a> before, but I had yet to really test out the integration with <a title="Zotero" href="http://www.zotero.org" target="_blank">Zotero</a> (my citation manager of choice). So now that I have finally started on my dissertation writing in earnest (and not grant writing), I needed to make sure that footnotes are usable in my work flow. So this is a quick write up of the tools I will use in writing my dissertation, and how I will use them.</p>
<h3>The Tools</h3>
<p><a title="Libre Office" href="http://www.libreoffice.org/" target="_blank"><img class="alignleft size-thumbnail wp-image-1191" title="images-1" src="http://mossiso.com/wp-content/uploads/2012/04/images-1.jpg" alt="" width="150" height="47" />LibreOffice</a>: Free and Open Source document software. Who knows how long I will have access to free Microsoft Word? LibreOffice (the fork of OpenOffice) will always be free and freely available. The steps will be basically the same if you are using Microsoft Word, just substitute that program for LibreOffice when it comes to it.</p>
<p><a title="Zotero" href="http://www.zotero.org" target="_blank"><br />
</a></p>
<p><a title="Zotero" href="http://www.zotero.org" target="_blank"><img class="alignleft size-thumbnail wp-image-1192" title="images-2" src="http://mossiso.com/wp-content/uploads/2012/04/images-2-150x150.jpg" alt="" width="150" height="150" />Zotero</a>: I&#8217;m certainly biased, but Zotero is the greatest citation management software evar! Also free and open source. I&#8217;m using the stand alone version, but you can use the Firefox extension as well. Should work the same.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a title="Scrivener" href="http://www.literatureandlatte.com/scrivener.php" target="_blank"><img class="alignleft size-thumbnail wp-image-1193" title="images" src="http://mossiso.com/wp-content/uploads/2012/04/images-150x150.jpg" alt="" width="150" height="150" />Scrivener</a>: The greatest writing software I&#8217;ve seen. So good I even paid for it. I don&#8217;t usually do that with software (as you can see, I like <strong>free</strong> and <strong>open source</strong>).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>The Process</h3>
<p>Here I will try to outline the process I found that will save footnotes from existing documents into Scrivener, and Scrivener created footnotes into exported documents. From there, it&#8217;s easy to create Zotero connected footnotes.</p>
<h4>1. Copy existing documents with footnotes into Scrivener</h4>
<div id="attachment_1213" class="wp-caption alignright" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/copy-from-libreoffice.png"><img class="size-medium wp-image-1213" title="copy-from-libreoffice" src="http://mossiso.com/wp-content/uploads/2012/04/copy-from-libreoffice-300x289.png" alt="Copy from LibreOffice" width="300" height="289" /></a><p class="wp-caption-text">Copy from LibreOffice</p></div>
<p>The first issue to run across is to put your existing documents into scrivener. I wrote a paper for Hist 811 that is basically the bulk of Chapter 1 and Chapter 2 of the dissertation. It&#8217;s needs some finessing in order to fit in the dissertation. It would be a shame to lose the footnotes, which is what happens if you just use Scrivener&#8217;s import file process. This is an easy fix. Just copy the text from your document and paste it into a Scrivener text area.</p>
<p>Then with your Scrivener project open, create a new text area, or select an existing one, which ever, and paste it in. Nothing special there.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h4>2. Create new footnotes in Scrivener</h4>
<div id="attachment_1212" class="wp-caption alignright" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/paste-into-scrivener.png"><img class="size-medium wp-image-1212" title="paste-into-scrivener" src="http://mossiso.com/wp-content/uploads/2012/04/paste-into-scrivener-300x168.png" alt="Scrivener makes a Footnote" width="300" height="168" /></a><p class="wp-caption-text">See how Scrivener makes a footnote!</p></div>
<p>What is special, though is what Scrivener does with that footnote. See there, footnote number 20, right after the quote about the cocktail of causes and rearmament being one of the ingredients? Now in Scrivener we have the word &#8220;ingredient&#8221; highlighted and underlined, and on the right side of the Scrivener window, there is a new footnote with all of the content of the original footnote. Sweet!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1216" class="wp-caption alignright" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/insert-footnote-scrivener.png"><img class="size-medium wp-image-1216" title="insert-footnote-scrivener" src="http://mossiso.com/wp-content/uploads/2012/04/insert-footnote-scrivener-300x233.png" alt="" width="300" height="233" /></a><p class="wp-caption-text">Easy as Format-&gt;Footnote, or use the shorcut keys Ctrl-Cmd-8</p></div>
<p>That&#8217;s all well and good. What if we want to edit the text a little bit, add some good stuff and add another footnote in there? What do we do? Well, Scrivener has a way to add a footnote. Just highlight some text (the footnote will be inserted after the last word), and go to the Format menu and select Footnote. Or you can use the fancy shortcut keys, for faster typing and footnote inserting, Ctrl-Cmd-8 (⌃⌘8).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1208" class="wp-caption alignright" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/new-footnote-scrivener.png"><img class="size-medium wp-image-1208" title="new-footnote-scrivener" src="http://mossiso.com/wp-content/uploads/2012/04/new-footnote-scrivener-300x181.png" alt="" width="300" height="181" /></a><p class="wp-caption-text">Look, Ma! A new footnote!</p></div>
<p>Now you have a new, blank, footnote area to put a footnote reverence in.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1209" class="wp-caption alignright" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/drag-zotero-scrivener.png"><img class="size-medium wp-image-1209" title="drag-zotero-scrivener" src="http://mossiso.com/wp-content/uploads/2012/04/drag-zotero-scrivener-300x198.png" alt="" width="300" height="198" /></a><p class="wp-caption-text">Select the reference in Zotero and drag it into the footnote box in Scrivener.</p></div>
<p>Zotero makes it easy to put the reference in that new empty footnote with drag and drop citations. Just pull up your Zotero (either from Firefox, or if you have the standalone version). Select the reference you want, and drag it into the empty footnote section.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h4>3. Moving from Scrivener to a document, and keeping your footnotes!</h4>
<p>So, ideally, you would be able to export your text document, and all of these lovely footnotes you have made in Scrivener, using Zotero, would just magically work in a Word or LibreOffice document. It doesn&#8217;t, yet (or ever?). So here is how to get your footnotes into a document, and then get those footnotes to be Zotero enabled.</p>
<div id="attachment_1207" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/scrivener-export-file.png"><img class="size-medium wp-image-1207" title="scrivener-export-file" src="http://mossiso.com/wp-content/uploads/2012/04/scrivener-export-file-300x162.png" alt="" width="300" height="162" /></a><p class="wp-caption-text">Srivener-&gt;File-&gt;Export-&gt;Files</p></div>
<p>First, you export your Scrivener document to RTF format.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1206" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/scrivener-export-rtf.png"><img class="size-medium wp-image-1206" title="scrivener-export-rtf" src="http://mossiso.com/wp-content/uploads/2012/04/scrivener-export-rtf-300x129.png" alt="" width="300" height="129" /></a><p class="wp-caption-text">Select RTF format</p></div>
<p>Select the plain RTF format, and the first check box for only the selected files (although, you could un check this if you want to do all of your files at once. No other check boxes are needed. Then just hit the Export button.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1205" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/open-with-libreoffice.png"><img class="size-medium wp-image-1205" title="open-with-libreoffice" src="http://mossiso.com/wp-content/uploads/2012/04/open-with-libreoffice-300x47.png" alt="" width="300" height="47" /></a><p class="wp-caption-text">Open it up with your favorite document program, LibreOffice or Word.</p></div>
<p>Next, you will want to open your new RTF document in LibreOffice (or Word if you&#8217;re using that program).</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1204" class="wp-caption alignleft" style="width: 228px"><a href="http://mossiso.com/wp-content/uploads/2012/04/insert-zotero-citation.png"><img class="size-medium wp-image-1204" title="insert-zotero-citation" src="http://mossiso.com/wp-content/uploads/2012/04/insert-zotero-citation-218x300.png" alt="" width="218" height="300" /></a><p class="wp-caption-text">All my citations are in the house!</p></div>
<p>You will notice that all of your footnotes are in this file. Yeah! Sometimes the text had odd font sizes and styles. So a quick &#8216;Select All&#8217; and change it to default style and Times New Roman, 12 pt should fix that right up. Now here is the labor intensive part. For each footnote, we&#8217;re going to have to recreate it so that it is handled by Zotero. Then we&#8217;ll delete the original footnote. It would be nice of Scrivener could export the footnotes in a way that Zotero could detect them, but alas it is not to be.</p>
<p>&nbsp;</p>
<p>Now you add a citation through the zotero buttons to make a zotero-aware citation.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1204" class="wp-caption alignleft" style="width: 228px"><a href="http://mossiso.com/wp-content/uploads/2012/04/insert-zotero-citation.png"><img class="size-medium wp-image-1204" title="insert-zotero-citation" src="http://mossiso.com/wp-content/uploads/2012/04/insert-zotero-citation-218x300.png" alt="" width="218" height="300" /></a><p class="wp-caption-text">All my citations are in the house!</p></div>
<p>Insert a Zotero citation using the Zotero buttons in your document program&#8217;s menu bar.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1203" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/zotero-classic-view-find-citation.png"><img class="size-medium wp-image-1203" title="zotero-classic-view-find-citation" src="http://mossiso.com/wp-content/uploads/2012/04/zotero-classic-view-find-citation-300x222.png" alt="" width="300" height="222" /></a><p class="wp-caption-text">I prefer the Zotero classic view.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1202" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/zotero-new-view-find-citation.png"><img class="size-medium wp-image-1202" title="zotero-new-view-find-citation" src="http://mossiso.com/wp-content/uploads/2012/04/zotero-new-view-find-citation-300x132.png" alt="" width="300" height="132" /></a><p class="wp-caption-text">The new citation find view is pretty slick, though.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1201" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/zotero-new-view-add-page.png"><img class="size-medium wp-image-1201" title="zotero-new-view-add-page" src="http://mossiso.com/wp-content/uploads/2012/04/zotero-new-view-add-page-300x34.png" alt="" width="300" height="34" /></a><p class="wp-caption-text">You can add pages with a coma, space, number.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1200" class="wp-caption alignleft" style="width: 306px"><a href="http://mossiso.com/wp-content/uploads/2012/04/two-citations.png"><img class="size-medium wp-image-1200" title="two-citations" src="http://mossiso.com/wp-content/uploads/2012/04/two-citations-296x300.png" alt="" width="296" height="300" /></a><p class="wp-caption-text">Now you have two citations.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>With two citations in the document, you&#8217;ll need to delete the one that was not made by zotero.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1199" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/delete-duplicate-citation.png"><img class="size-medium wp-image-1199" title="delete-duplicate-citation" src="http://mossiso.com/wp-content/uploads/2012/04/delete-duplicate-citation-300x294.png" alt="" width="300" height="294" /></a><p class="wp-caption-text">Just make sure you delete the non-zotero aware citation. The Zotero citation is usually highlighted.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1198" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/libreoffice-saveas.png"><img class="size-medium wp-image-1198" title="libreoffice-saveas" src="http://mossiso.com/wp-content/uploads/2012/04/libreoffice-saveas-300x107.png" alt="" width="300" height="107" /></a><p class="wp-caption-text">Now you can save the document as a different file format: odt, doc, docx</p></div>
<p>Now save the document as an ODT document. If it is saved as anything else, it will not be Zotero aware.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1197" class="wp-caption alignleft" style="width: 260px"><a href="http://mossiso.com/wp-content/uploads/2012/04/Screen-Shot-2012-04-10-at-6.09.56-PM.png"><img class="size-medium wp-image-1197" title="Many file types to choose from." src="http://mossiso.com/wp-content/uploads/2012/04/Screen-Shot-2012-04-10-at-6.09.56-PM-250x300.png" alt="" width="250" height="300" /></a><p class="wp-caption-text">Take your pick of file types.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1195" class="wp-caption alignleft" style="width: 310px"><a href="http://mossiso.com/wp-content/uploads/2012/04/zotero-warning.png"><img class="size-medium wp-image-1195" title="zotero-warning" src="http://mossiso.com/wp-content/uploads/2012/04/zotero-warning-300x122.png" alt="" width="300" height="122" /></a><p class="wp-caption-text">Save as the correct file format if you want Zotero to be able to edit them again.</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>One alternative method is to create footnotes in Scrivener using the format {Author, Year, Page#}. Then export as an RTF document as before. Then, in Zotero, use the &#8216;RTF Scan&#8217; tool in the Preferences menu. Zotero will see all of the citations and replace them nicely with formatted citations (using Ibid. and short notation for repeat books, and such). Zotero will not be aware of these citations at all, so if you need them to be Zotero aware, you might as well use the steps outlined above. If you do not expect to update citations or the text once done in Scrivener, then this may be the easiest way to go.</p>
<p>Now I can happily transfer existing documents into Scrivener and save the footnotes!</p>
]]></content:encoded>
			<wfw:commentRss>http://mossiso.com/2012/04/12/scrivener-and-zotero.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
