<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>quant0r.com</title>
	<link>http://blog.quant0r.com</link>
	<description></description>
	<pubDate>Thu, 05 Jun 2008 14:55:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>MP3 to ogg, preserving tags</title>
		<link>http://blog.quant0r.com/2008/04/20/mp3-to-ogg-preserving-tags/</link>
		<comments>http://blog.quant0r.com/2008/04/20/mp3-to-ogg-preserving-tags/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 14:51:48 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/04/20/mp3-to-ogg-preserving-tags/</guid>
		<description><![CDATA[I personally don&#8217;t like all those insane 320kbit bitrates, I&#8217;m perfectly fine with listening to 80kbit ogg(which sounds like 128kbit mp3 occupying less space at the same time). As it&#8217;s impossible to convert from inside iTunes(oh, Foobar, where art thou?) I had to resort to command line tools. The tools we&#8217;ll need are

 LAME - [...]]]></description>
			<content:encoded><![CDATA[<p>I personally don&#8217;t like all those insane 320kbit bitrates, I&#8217;m perfectly fine with listening to 80kbit ogg(which sounds like 128kbit mp3 occupying less space at the same time). As it&#8217;s impossible to convert from inside iTunes(oh, Foobar, where art thou?) I had to resort to command line tools. The tools we&#8217;ll need are</p>
<ul>
<li> <a href=http://lame.sourceforge.net/download.php>LAME</a> - mp3 encoder
<li> <a href=http://xiph.org/downloads/>eggenc</a> - ogg encoder(you&#8217;ll need to build libogg, libvorbis, vorbis-tools but it builds out-of-box)
<li> <a href=http://nekohako.xware.cx/id3tool/>id3tool</a> - mp3 tag viewer(and editor) - also builds successfully
<li> Grep and sed</a> - text manipulators, powerful standard tools
</ul>
<p>Now the bash script which will convert all the supplied mp3 files to ogg(mp32ogg):</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="re3">#!/bin/sh</span><br />
<br />
<span class="kw1">for</span> file <span class="kw1">in</span> <span class="st0">&quot;$@&quot;</span><br />
<span class="kw1">do</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="kw3">test</span> ! -f <span class="st0">&quot;$(basename &quot;</span><span class="re1">$file</span><span class="st0">&quot; .mp3).ogg&quot;</span> <br />
&nbsp; &nbsp; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; lame --decode <span class="st0">&quot;$file&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">ARTIST=</span>`id3tool <span class="st0">&quot;$file&quot;</span> | grep Artist | sed s/Artist:// | sed <span class="st0">'s/[^A-Za-z0-9]*//'</span>`<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">ALBUM=</span>`id3tool <span class="st0">&quot;$file&quot;</span> | grep Album | sed s/Album:// | sed <span class="st0">'s/[^A-Za-z0-9]*//'</span>`<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">TRACK=</span>`id3tool <span class="st0">&quot;$file&quot;</span> | grep Track | sed s/Track:// | sed <span class="st0">'s/[^A-Za-z0-9]*//'</span>`<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">YEAR=</span>`id3tool <span class="st0">&quot;$file&quot;</span> | grep Year | sed s/Year:// | sed <span class="st0">'s/[^A-Za-z0-9]*//'</span>`<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">GENRE=</span>`id3tool <span class="st0">&quot;$file&quot;</span> | grep Genre | sed s/Genre:// | sed -e <span class="st0">'s/[^A-Za-z0-9]*//'</span> -e <span class="st0">'s/(.*)$//'</span>`<br />
&nbsp; &nbsp; &nbsp; &nbsp; oggenc -a <span class="st0">&quot;$ARTIST&quot;</span> -G <span class="st0">&quot;$GENRE&quot;</span> -d <span class="st0">&quot;$YEAR&quot;</span> -N <span class="st0">&quot;$TRACK&quot;</span> -l <span class="st0">&quot;$ALBUM&quot;</span> -b <span class="nu0">80</span> <span class="st0">&quot;$file.wav&quot;</span> -o <span class="st0">&quot;$(basename &quot;</span><span class="re1">$file</span><span class="st0">&quot; .mp3).ogg&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; rm <span class="st0">&quot;$file.wav&quot;</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span><br />
<span class="kw1">done</span></div></div>
<p>In case you wonder why it uses such strange long lines, the process of getting the artist for example can be described as follows:</p>
<ul>
<li> <b>id3tool &#8220;$file&#8221;</b> - get tags
<li> <b>grep Artist</b> - get line containing word Artist
<li> <b>sed s/Artist://</b> - remove the preceding string &#8220;Artist:&#8221; from the line
<li> <b>sed &#8217;s/[^A-Za-z0-9]*//</b> - remove the unnecessary spaces/tabs/etc&#8230; before the artist name itself(the actual meaning is remove all characters before encountering alphanumerical - A-Z or a-z or 0-9)
</ul>
<p>Btw, <b>basename &#8220;$file&#8221; .mp3</b> is just a neat way to strip mp3 extension preserving the filename itself.</p>
<p>The syntax is straightforward - you could use built-in wildcards - e.g. <b>mp32ogg T*.mp3</b> will convert all mp3 files starting with T.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/04/20/mp3-to-ogg-preserving-tags/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using CMake with vim</title>
		<link>http://blog.quant0r.com/2008/04/13/using-cmake-with-vim/</link>
		<comments>http://blog.quant0r.com/2008/04/13/using-cmake-with-vim/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 15:08:23 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/04/13/using-cmake-with-vim/</guid>
		<description><![CDATA[I&#8217;ve recently moved from make to CMake which is a cross-platform build system. It&#8217;s quite nice if you want to be able to build for mac/win with the same makefile(CMakeLists.txt for CMake). The CMakeLists syntax is quite powerful and I haven&#8217;t regretted moving since.
One of the main ideas of CMake is out-of-source build - that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently moved from make to <a href=http://www.cmake.org>CMake</a> which is a cross-platform build system. It&#8217;s quite nice if you want to be able to build for mac/win with the same makefile(CMakeLists.txt for CMake). The CMakeLists syntax is quite powerful and I haven&#8217;t regretted moving since.</p>
<p>One of the main ideas of CMake is out-of-source build - that is you use cmake like this</p>
<div class="codecolorer-container bash" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">cmake directory</div></div>
<p>where <i>directory</i> contains the CMakeLists.txt and it builds everything in the current directory you are in. This is mostly because CMake is quite messy - it uses lots of files to build.</p>
<p>I use Vim for my development and its awesome &#8216;make&#8217; compatibility which allows to build programs using make inside vim and view errors with special vim commands. Now as CMake uses unix makefiles on mac, it works quite well from vim. But then you&#8217;ll have to first generate makefiles with cmake inside the source directory for that to function. Not a nice idea really&#8230;</p>
<p>My solution to this is to use <a href=http://linux.com.hk/penguin/man/1/makeobj.html>Makeobj</a>. It is a script used to build using normal make outside of source directory. It uses OBJ_SUBDIR environment variable which defines the name of subdirectory where the build will take place.</p>
<p>How can it be used with CMake and vim? Here is the <b>maker</b> script I use</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="re3">#!/bin/bash</span><br />
<br />
<span class="kw1">if</span> <span class="br0">&#91;</span> -e makefile <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; make<br />
<span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="kw3">export</span> <span class="re2">OBJ_SUBDIR=</span>build<br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span> -e CMakeLists.txt <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span> -d build <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">cd</span> build<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rm CMakeCache.txt<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mkdir build<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">cd</span> build<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">fi</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; cmake ../<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">cd</span> ..<br />
&nbsp; &nbsp; &nbsp; &nbsp; makeobj $<span class="nu0">1</span> $<span class="nu0">2</span> $<span class="nu0">3</span> $<span class="nu0">4</span> $<span class="nu0">5</span><br />
&nbsp; &nbsp; <span class="kw1">fi</span><br />
<span class="kw1">fi</span></div></div>
<p>Now in vim you just go</p>
<div class="codecolorer-container text" style="height:35px;">:set makeprg=maker</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/04/13/using-cmake-with-vim/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RPM&#8217;s on OsX</title>
		<link>http://blog.quant0r.com/2008/03/19/rpms-on-osx/</link>
		<comments>http://blog.quant0r.com/2008/03/19/rpms-on-osx/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 12:18:42 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/03/19/rpms-on-osx/</guid>
		<description><![CDATA[Recently one of the ways to distribute packages(binary and source) is by using RPM. That&#8217;s all very good and everything but what to do if the rpms aren&#8217;t supported - as on osX? It gets a bit trickier but still manageable. 
First grab the perl script - rpm2cpio.pl. Its usage is pretty straightforward
rpm2cpio, perl version [...]]]></description>
			<content:encoded><![CDATA[<p>Recently one of the ways to distribute packages(binary and source) is by using <http://en.wikipedia.org/wiki/RPM_Package_Manager>RPM</a>. That&#8217;s all very good and everything but what to do if the rpms aren&#8217;t supported - as on osX? It gets a bit trickier but still manageable. </p>
<p>First grab the perl script - <a href='http://blog.quant0r.com/wp-content/uploads/2008/03/rpm2cpio.pl' title='rpm2cpio.pl'>rpm2cpio.pl</a>. Its usage is pretty straightforward</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;">rpm2cpio, perl version by orabidoo &lt;odar@pobox.com&gt; +sw<br />
dumps the contents to stdout as a cpio archive<br />
<br />
use: rpm2cpio <span class="br0">&#91;</span>file.rpm<span class="br0">&#93;</span> &gt; file.cpio<br />
<br />
Here<span class="st0">'s how to use cpio:<br />
&nbsp; &nbsp; list of contents:&nbsp; &nbsp;cpio -t -i &lt; /file/name<br />
&nbsp; &nbsp; &nbsp; &nbsp;extract files:&nbsp; &nbsp;cpio -d -i &lt; /file/name</span></div></div>
<p>Thankfully, cpio is natively available on osx, so that&#8217;s pretty much it all amounts to.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/03/19/rpms-on-osx/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Par2 on OsX</title>
		<link>http://blog.quant0r.com/2008/03/19/par2-on-osx/</link>
		<comments>http://blog.quant0r.com/2008/03/19/par2-on-osx/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 12:08:45 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/03/19/par2-on-osx/</guid>
		<description><![CDATA[There&#8217;s a handy tool for correcting data errors - Par2
The command line utility for linux is included in most packages, but alas not so on macos. There are still two ways to go - there is a port over at MacPorts but I already have Fink installed and I didn&#8217;t really want to get another [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a handy tool for correcting data errors - <a href =http://en.wikipedia.org/wiki/Par2>Par2</a></p>
<p>The command line utility for linux is included in most packages, but alas not so on macos. There are still two ways to go - there is a port over at <a href=http://www.macports.com>MacPorts</a> but I already have Fink installed and I didn&#8217;t really want to get another clutter in the system. So I just found the <a href=http://sisyphus.ru/srpm/Sisyphus/par2/get>ALT Linux Source</a>, extracted the rpm and built it.</p>
<p>You can grab the source here <a href='http://quant0r.com/files/par2.tar.gz' title='Par2 source'>Par2.tar.gz</a><br />
Now just extract it and build it</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;">tar -xvf par2.tar.gz<br />
<span class="kw3">cd</span> par2cmdline<span class="nu0">-0.4</span><br />
chmod +x configure<br />
./configure<br />
make</div></div>
<p>Now you can just move par2 utility to your path directory of choice.<br />
Just in case you don&#8217;t want to bother building it - grab the binary here - <a href='http://blog.quant0r.com/wp-content/uploads/2008/03/par2.bz2' title='par2.bz2'>par2.bz2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/03/19/par2-on-osx/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vim &#038; LaTeX on a mac</title>
		<link>http://blog.quant0r.com/2008/02/26/vim-latex-on-a-mac/</link>
		<comments>http://blog.quant0r.com/2008/02/26/vim-latex-on-a-mac/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 21:38:05 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/02/26/vim-latex-on-a-mac/</guid>
		<description><![CDATA[Since I&#8217;ve moved to mac not so long ago, I was happy that most of the apps I normally use are ported to os x.
As I&#8217;ve been writing a lot of mathematical stuff in LaTeX it soon got quite annoying constantly recompiling, closing previous Preview.app instance and opening it again so that the pdf file [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;ve moved to mac not so long ago, I was happy that most of the apps I normally use are ported to os x.<br />
As I&#8217;ve been writing a lot of mathematical stuff in LaTeX it soon got quite annoying constantly recompiling, closing previous Preview.app instance and opening it again so that the pdf file gets properly reloaded(on Windows dvi viewer reloaded automatically). Seems like this wasn&#8217;t only my problem as there turned out to be a pdf/dvi viewer out there with automatic reloading - <a href = http://skim-app.sourceforge.net/>Skim</a>.</p>
<p>I&#8217;ve also learned about <a href=http://itexmac.sourceforge.net/pdfsync.html>pdfsync</a> which is quite neatly handled in Skim - just Shift-Command-Click and it opens Vim at the corresponding line in tex file, nice&#8230; </p>
<p>While at it, I&#8217;ve switched to <a href=http://code.google.com/p/macvim/>MacVim</a> because of better <a href=http://phaseportrait.blogspot.com/2007/12/pdfsync-inverse-searches-in-macvim.html>integration with pdfsync</a>, along with nicer aqua interface, tab support etc&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/02/26/vim-latex-on-a-mac/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cave story - multiple saves</title>
		<link>http://blog.quant0r.com/2008/02/21/cave-story-multiple-saves/</link>
		<comments>http://blog.quant0r.com/2008/02/21/cave-story-multiple-saves/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 00:44:55 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/02/21/cave-story-multiple-saves/</guid>
		<description><![CDATA[There is a very old-skool platformer style game called Doukutsu Monogatari or Cave story. You can read more about it here. It has multiple endings but the main drawback is that it has very limited save support - there is only one save slot available - which is quite similar to another old-skool game ADOM.
But [...]]]></description>
			<content:encoded><![CDATA[<p>There is a very old-skool platformer style game called Doukutsu Monogatari or Cave story. You can read more about it <a href=http://en.wikipedia.org/wiki/Cave_Story>here</a>. It has multiple endings but the main drawback is that it has very limited save support - there is only one save slot available - which is quite similar to another old-skool game <a href=http://www.adom.de>ADOM</a>.<br />
But it doesn&#8217;t take a super-guru to right things for this one. Here is a quick-coded bash script which adds the capability for multiple saves. It&#8217;s based on the fact that the save progress is stored in file <b>~/Library/Preferences/com.nakiwo.Doukutsu.plist</b><br />
What is done precisely is just saving the current file to a <i>Save</i> directory with a description supplied by the user. </p>
<p>Installation:<br />
- Download <a href='http://blog.quant0r.com/wp-content/uploads/2008/04/doukutsu' title='doukutsu'>doukutsu</a> script here<br />
- <b>chmod +x doukutsu</b> in case it&#8217;s not executable<br />
- create a directory named <b>Saves</b> in the directory where you put <b>doukutsu</b> script<br />
- you are done</p>
<p>The usage is straightforward, just follow the instructions when running the script.</p>
<p>P.S. It will locate the Cave Story .app file on its own if it has been put in /Applications folder</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/02/21/cave-story-multiple-saves/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OS X SVN Clients - SvnX &#038; ZigVersion</title>
		<link>http://blog.quant0r.com/2008/01/21/os-x-svn-clients-svnx-zigversion/</link>
		<comments>http://blog.quant0r.com/2008/01/21/os-x-svn-clients-svnx-zigversion/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 13:38:17 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/01/21/os-x-svn-clients-svnx-zigversion/</guid>
		<description><![CDATA[On windows the most popular client is TortoiseSVN, but the situation isn&#8217;t as clear on the mac.
 SvnX 
The first one i tried was SvnX. It&#8217;s free open-source subversion client which is quite popular.Read more&#8230;
ZigVersion
So I&#8217;ve decided to switch over to ZigVersion. It&#8217;s not open-source, but free for personal use which suits me just fine.Read [...]]]></description>
			<content:encoded><![CDATA[<p>On windows the most popular client is TortoiseSVN, but the situation isn&#8217;t as clear on the mac.</p>
<h1> SvnX </h1>
<p>The first one i tried was <a href=http://www.lachoseinteractive.net/en/community/subversion/svnx/features/>SvnX</a>. It&#8217;s free open-source subversion client which is quite popular.<a href="http://blog.quant0r.com/2008/01/21/os-x-svn-clients-svnx-zigversion/#cut-1">Read more&#8230;</a></p>
<h1>ZigVersion</h1>
<p>So I&#8217;ve decided to switch over to <a href=http://zigversion.com>ZigVersion</a>. It&#8217;s not open-source, but free for personal use which suits me just fine.<a href="http://blog.quant0r.com/2008/01/21/os-x-svn-clients-svnx-zigversion/#cut-2">Read more&#8230;</a></p>
<h1>Conslusions</h1>
<p>All in all, I do prefer Zigversion, though I&#8217;ll be on lookout for other mac svn clients - there is java <a href=http://www.syntevo.com/smartsvn/index.html>SmartSvn</a> and upcoming <a href=http://www.versionsapp.com>VersionsApp</a> which looks quite promisiing. For now, the choice is yours what to use&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/01/21/os-x-svn-clients-svnx-zigversion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing wiki on a2hosting with latex support on A2Hosting</title>
		<link>http://blog.quant0r.com/2008/01/20/installing-wiki-on-a2hosting-with-latex-support-on-a2hosting/</link>
		<comments>http://blog.quant0r.com/2008/01/20/installing-wiki-on-a2hosting-with-latex-support-on-a2hosting/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 20:37:29 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[A2Hosting]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/01/20/installing-wiki-on-a2hosting-with-latex-support-on-a2hosting/</guid>
		<description><![CDATA[Installing MediaWiki
Getting MediaWiki up and running is pretty simple. Here is the installation script which will download mediawiki 1-11.0 and do the necessary preconfiguration (see more here on that)
Setting up database for Wiki
Go to CPanel->MySQL Databases and add new database(e.g wikidb - I&#8217;m not sure but to be on the safe side I recommend to [...]]]></description>
			<content:encoded><![CDATA[<h1>Installing MediaWiki</h1>
<p>Getting MediaWiki up and running is pretty simple. <a href='http://blog.quant0r.com/wp-content/uploads/2008/01/installwiki.sh' title='Wiki installation script'>Here</a> is the installation script which will download mediawiki 1-11.0 and do the necessary preconfiguration (see more <a href=http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Linux>here</a> on that)</p>
<h2>Setting up database for Wiki</h2>
<p>Go to CPanel->MySQL Databases and add new database(e.g wikidb - I&#8217;m not sure but to be on the safe side I recommend to select name which isn&#8217;t the same as one of subdomains on your website). Then Add User(e.g wikiuse) and Add User to database with all privileges.</p>
<h2>Configuring</h2>
<p>You can try to do the first part automatically by running the script in the intended wiki directory - <b>bash installwiki.sh</b><br />
If everything went ok, then just point your browser to the config directory. Follow the direction on-screen - you should enter the data you used when creating the database in the Database config section - don&#8217;t forget to add your a2hosting username to db name and db username.<br />
Now some postinstallation stuff</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;">mv ./config/LocalSettings.php ./<br />
rm -rf ./config</div></div>
<p>It will just delete ./config directory and move localsettings.php to its intended place</p>
<h1>Enabling TeX</h1>
<p>To enable tex you need to have texvc compiled in your <b>wiki/math</b> subdirectory. Unfortunately, a2hosting doesn&#8217;t have ocaml installed so you won&#8217;t be able to compile it on-site. But I managed to find the precompiled binary for CentOS 5 for x86_64 platform which is what a2hosting runs. You can grab it <a href ='http://quant0r.com/files/texvc.el5.x86_64.tar.gz' title='texvc.el5.x86_64'>here</a>. You&#8217;ll need to put it into your <b>wiki/math</b> subdirectory and maybe do <b>chmod 777 ./texvc</b> on it.<br />
Then you&#8217;ll have to add the following lines(or change the value if they exist already) to your <b>LocalSettings.php</b> file</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="re1">$wgUseTex</span> = true;<br />
<span class="re1">$wgTmpDirectory</span> = <span class="st0">&quot;/home/your_username/www/your_wiki_directory/images/tmp&quot;</span>;<br />
<span class="re1">$wgMathDirectory</span> = <span class="st0">&quot;/home/your_username/www/your_wiki_directory/images/math&quot;</span>;</div></div>
<p>You&#8217;ll also have to actually create the directories in question by ssh&#8217;ing to your server and executing</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="kw3">cd</span> ~/www/your_wiki_directory/images<br />
mkdir tmp<br />
chmod <span class="nu0">777</span> tmp<br />
mkdir math<br />
chmod <span class="nu0">777</span> math</div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/01/20/installing-wiki-on-a2hosting-with-latex-support-on-a2hosting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting up single-user synced SVN repositories</title>
		<link>http://blog.quant0r.com/2008/01/17/setting-up-single-user-synced-svn-repositories/</link>
		<comments>http://blog.quant0r.com/2008/01/17/setting-up-single-user-synced-svn-repositories/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 21:30:37 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/01/17/setting-up-single-user-synced-svn-repositories/</guid>
		<description><![CDATA[First you&#8217;ll need to follow the SVN wiki entry to set up svn repository and passwordless ssh access at A2Hosting.
 
As this is only for one user, then the easiest way is to use svn dump functionality which allows for incremental dumps. Using post-commit hooks we&#8217;ll just save the new commits since last sync to [...]]]></description>
			<content:encoded><![CDATA[<p>First you&#8217;ll need to follow the <a href=http://wiki.a2hosting.com/index.php/SVN>SVN wiki entry</a> to set up svn repository and passwordless ssh access at A2Hosting.</p>
<h1> </h1>
<p>As this is only for one user, then the easiest way is to use <b>svn dump</b> functionality which allows for incremental dumps. Using post-commit hooks we&#8217;ll just save the new commits since last sync to a dump file. Furthermore, apart from manual update of repositories from dump we&#8217;ll also write a script which will sync the repositories nightly(e.g using cron). But the main thing is to be able to switch from using remote(main) repository to its local copy to continue developing if for some reason we don&#8217;t have network access. </p>
<h1> Setting up repositories </h1>
<p>I assume that you&#8217;ve got one repository completely set up and ready. Now we only need to dump the repository,</p>
<div class="codecolorer-container bash" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">svnadmin dump repository_path &gt;dumpfile</div></div>
<p>copy the <b>dumpfile</b> and run</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;">svnadmin create repository_path<br />
svn load repository_path &lt;dumpfile</div></div>
<h1>Setting up automatic dumping</h1>
<p>The next thing is installing post-commit hook, which is just an executable program put into <b>repository_path/hooks</b>. Consult <b>post-commit.tmpl</b> for more info.<br />
<b>post-commit</b></p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="re3">#!/bin/sh</span><br />
<span class="re2">REPOS=</span><span class="st0">&quot;$1&quot;</span><br />
<span class="re2">REV=</span><span class="st0">&quot;$2&quot;</span><br />
<span class="re2">DUMP=</span>path_to_dump_to<br />
<br />
svnadmin dump <span class="re1">$REPOS</span> --incremental --revision <span class="re1">$REV</span> &gt;<span class="re1">$DUMP</span>/newsvn.dump<br />
cat <span class="re1">$DUMP</span>/svn.dump <span class="re1">$DUMP</span>/newsvn.dump &gt;<span class="re1">$DUMP</span>/svn_.dump<br />
mv -f <span class="re1">$DUMP</span>/svn_.dump <span class="re1">$DUMP</span>/svn.dump</div></div>
<p>And don&#8217;t forget to make it executable with chmod.</p>
<h1>Synchonizing the repositories</h1>
<p>This is the script to sync from remote to local<br />
<b>sync2local</b></p>
<div class="codecolorer-container bash" style="height:350px;"><div class="codecolorer" style="font-family: monospace;"><span class="re3">#!/bin/bash</span><br />
<span class="re2">FTP_USER=</span><br />
<span class="re2">FTP_PASS=</span><br />
<span class="re2">FTP_SERVER=</span><br />
<span class="re2">SSH_SERVER=</span><br />
<span class="re2">SSH_USER=</span><br />
<span class="re2">DUMPFILE=</span>svn.dump<br />
<span class="re2">REPO=</span>/svn<br />
<span class="re2">PORT=</span>-p <span class="nu0">7822</span><br />
<br />
<span class="re3">#delete old dump file</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> -e <span class="re1">$DUMPFILE</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; rm <span class="re1">$DUMPFILE</span><br />
<span class="kw1">fi</span><br />
<span class="re3">#get current dump file</span><br />
wget --<span class="re2">password=</span><span class="re1">$FTP_PASS</span> --<span class="re2">user=</span><span class="re1">$FTP_USER</span> ftp://<span class="re1">$FTP_SERVER</span>/<span class="re1">$DUMPFILE</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> $? != <span class="nu0">0</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> No dumpfile available<br />
&nbsp; &nbsp; <span class="kw3">exit</span><br />
<span class="kw1">fi</span><br />
<br />
<span class="re3">#update <span class="kw3">local</span> repository</span><br />
svnadmin load <span class="re1">$REPO</span> &lt;<span class="re1">$DUMPFILE</span><br />
<br />
<span class="re3">#delete dump file <span class="kw1">if</span> sucessful</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> -e <span class="re1">$DUMPFILE</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp;ssh <span class="re1">$SSH_USER</span>@<span class="re1">$SSH_SERVER</span> <span class="re1">$PORT</span> rm <span class="re1">$DUMPFILE</span><br />
&nbsp;rm <span class="re1">$DUMPFILE</span><br />
<span class="kw1">fi</span></div></div>
<p>And the script to sync from local to remote<br />
<b>sync2remote</b></p>
<div class="codecolorer-container bash" style="height:350px;"><div class="codecolorer" style="font-family: monospace;"><span class="re3">#!/bin/bash</span><br />
<span class="re2">FTP_USER=</span><br />
<span class="re2">FTP_PASS=</span><br />
<span class="re2">FTP_SERVER=</span><br />
<span class="re2">SSH_SERVER=</span><br />
<span class="re2">SSH_USER=</span><br />
<span class="re2">PORT=</span><span class="st0">&quot;-p 7822&quot;</span><br />
<span class="re2">REPO=</span><br />
<span class="re3">#dumpfile with full path</span><br />
<span class="re2">DUMPFILE=</span><br />
<span class="re3">#test <span class="kw1">if</span> dump file exists</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> ! -e <span class="re1">$DUMPFILE</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;No dump file available&quot;</span><br />
&nbsp; &nbsp; <span class="kw3">exit</span><br />
<span class="kw1">fi</span><br />
<br />
<span class="re3">#upload dump file</span><br />
<span class="kw3">echo</span> <span class="st0">&quot;put $DUMPFILE $(basename $DUMPFILE)&quot;</span> | ftp ftp://<span class="re1">$FTP_USER</span>:<span class="re1">$FTP_PASS</span>@<span class="re1">$FTP_SERVER</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> $? != <span class="nu0">0</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;Can't upload dumpfile&quot;</span><br />
&nbsp; &nbsp; <span class="kw3">exit</span> <br />
<span class="kw1">fi</span><br />
<span class="re3">#update remote repository</span><br />
ssh <span class="re1">$SSH_USER</span>@<span class="re1">$SSH_SERVER</span> <span class="re1">$PORT</span> <span class="st0">&quot;svnadmin load $REPO &lt;$(basename $DUMPFILE)&quot;</span><br />
<span class="re3">#delete dump file <span class="kw1">if</span> sucessful</span><br />
rm <span class="re1">$DUMPFILE</span><br />
ssh <span class="re1">$SSH_USER</span>@<span class="re1">$SSH_SERVER</span> <span class="re1">$PORT</span> rm $<span class="br0">&#40;</span>basename <span class="re1">$DUMPFILE</span><span class="br0">&#41;</span></div></div>
<h1>Switching between repositories</h1>
<p>These 2 scripts <b>svn2remote</b> and <b>svn2local</b> can be used to switch a working copy between repositories. Before switching it will sync to the most recent copy, which is precisely what we need.<br />
<b>svn2remote</b></p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="re3">#!/bin/bash</span><br />
<span class="re2">REPO=</span>/svn<br />
sync2remote<br />
svn switch --relocate file://<span class="re1">$REPO</span> svn+a2hosting://zedr0n@quant0r.com/home/zedr0n/svn .</div></div>
<p><b>svn2local</b></p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;"><span class="re3">#!/bin/bash</span><br />
<span class="re2">REPO=</span>/svn<br />
sync2local<br />
svn switch --relocate svn+a2hosting://zedr0n@quant0r.com/home/zedr0n/svn file://<span class="re1">$REPO</span> .</div></div>
<p>So, basically, whenever you want to work on some projects, you just <i>check it out</i> by doing svn2local and merge the changes with svn2remote when you are done. If you are confident in remote repository then you can just work with it all the time. It&#8217;s quite flexible really&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/01/17/setting-up-single-user-synced-svn-repositories/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing OpenID with WordPress</title>
		<link>http://blog.quant0r.com/2008/01/16/installing-openid/</link>
		<comments>http://blog.quant0r.com/2008/01/16/installing-openid/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 17:14:13 +0000</pubDate>
		<dc:creator>zedr0n</dc:creator>
		
		<category><![CDATA[A2Hosting]]></category>

		<guid isPermaLink="false">http://blog.quant0r.com/2008/01/16/installing-openid/</guid>
		<description><![CDATA[The first part is to allow openID users to post comments on your blog, this can be easily achieved by installing Wordpress OpenID plugin. The installations is simplicity itself - just copy the plugin and activate it, nothing else required.
The other part is being able to use your blog as an openID server. I wasn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>The first part is to allow openID users to post comments on your blog, this can be easily achieved by installing <a href=http://wordpress.org/extend/plugins/openid/>Wordpress OpenID plugin</a>. The installations is simplicity itself - just copy the plugin and activate it, nothing else required.</p>
<p>The other part is being able to use your blog as an openID server. I wasn&#8217;t able to find this as a plugin so I decided to go with a standalone<br />
<a href=http://siege.org/projects/phpMyID/>phpMyID</a>. Grab the 0.7 beta <a href =http://siege.org/projects/phpMyID/phpMyID-0.7.tgz>here</a> and follow the instructions in README file, they are pretty straightforward and they worked for me with no problems.</p>
<p>Just to note that if you want it to work with your wordpress blog you need to add to the header.php file of your current theme</p>
<div class="codecolorer-container bash"><div class="codecolorer" style="font-family: monospace;">&lt;link <span class="re2">rel=</span><span class="st0">&quot;openid.server&quot;</span> <span class="re2">href=</span><span class="st0">&quot;http://&lt;your-blog&gt;/MyID.config.php&quot;</span> /&gt;<br />
&lt;link <span class="re2">rel=</span><span class="st0">&quot;openid.delegate&quot;</span> <span class="re2">href=</span><span class="st0">&quot;http://&lt;your-blog&gt;/MyID.config.php&quot;</span> /&gt;</div></div>
<p>If your blog is on a subdomain then MyID.config.php and MyID.php should be uploaded to the subdomain root(i.e. your-domain/subdomain).<br />
Otherwise if you just put it into your root, it will point to your openID server - i.e. the root of your domain</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quant0r.com/2008/01/16/installing-openid/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
