<?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>trac Archives - Alexandros Georgiou</title>
	<atom:link href="https://www.alexgeorgiou.gr/tag/trac/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.alexgeorgiou.gr/tag/trac/</link>
	<description>Balancing brackets for a living</description>
	<lastBuildDate>Wed, 18 Sep 2024 16:05:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.alexgeorgiou.gr/wp-content/uploads/2021/07/cropped-alexgeorgiou-icon-32x32.png</url>
	<title>trac Archives - Alexandros Georgiou</title>
	<link>https://www.alexgeorgiou.gr/tag/trac/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>⎘ Copying markdown from ChatGPT or Gemini to TracWiki using pandoc</title>
		<link>https://www.alexgeorgiou.gr/markdown-to-trac-wiki/</link>
					<comments>https://www.alexgeorgiou.gr/markdown-to-trac-wiki/#respond</comments>
		
		<dc:creator><![CDATA[alexg]]></dc:creator>
		<pubDate>Wed, 18 Sep 2024 15:40:58 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[ChatGPT]]></category>
		<category><![CDATA[Gemini]]></category>
		<category><![CDATA[pandoc]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[TracWiki]]></category>
		<category><![CDATA[ZimWiki]]></category>
		<guid isPermaLink="false">https://www.alexgeorgiou.gr/?p=1702</guid>

					<description><![CDATA[<p>How to easily copy simple markdown from AI chatbots such as ChatGPT or Gemini and paste it into the Trac issue tracker and wiki.</p>
<p>The post <a href="https://www.alexgeorgiou.gr/markdown-to-trac-wiki/">⎘ Copying markdown from ChatGPT or Gemini to TracWiki using pandoc</a> appeared first on <a href="https://www.alexgeorgiou.gr">Alexandros Georgiou</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Although I lately do various stuff, such as <a href="https://flutter.dev/">flutter</a> app development, video editing, and even digital marketing, I remain at heart a WordPress plugin developer. And as such, I of course use <a href="https://trac.edgewall.org/"><code>Trac</code></a> for project management.</p>



<p>I don&#8217;t just use generative AI such as <a href="https://chatgpt.com/"><code>ChatGPT</code></a> and <a href="https://gemini.google.com/"><code>Gemini</code></a> for code prototyping, but at all stages of development, starting from analysis and all the way to test generation and even deployment. Very often, especially during the feasibility/analysis stage of product development, I find that an entire answer from our AI overlords is so good, that it can be copied verbatim into a ticket, as part of the analysis.</p>



<p>Chatbots output <a href="https://daringfireball.net/projects/markdown/"><code>markdown</code></a>, but <code>Trac</code> uses <a href="https://trac.edgewall.org/wiki/WikiFormatting"><code>TracWiki</code></a> as its markup format.</p>



<h2 class="wp-block-heading">pandoc writers</h2>



<p>There is no TracWiki <a href="https://pandoc.org/custom-writers.html">writer for <code>pandoc</code></a> that I know of. Writers are <a href="https://www.lua.org/"><code>lua</code></a> scripts that you can use with pandoc to extend its output format capabilities. A writer simply tells <code>pandoc</code> how to output different typographic elements such as paragraph, list, code block, headings, etc.</p>



<p><code>ChatGPT</code> is capable enough to create a rudimentary <code>TracWiki</code> writer for you, but it&#8217;s not perfect. It needs some manual work before it can be called complete. Paragraphs and lists are easy, but writing more complex elements, such as image links, requires some manual work. A fun side-project that I may get to at some time in the future.</p>



<h2 class="wp-block-heading">ZimWiki ≈ TracWiki</h2>



<p>But chatbots only output very basic markdown. A custom writer is not necessary for copying simple markdown from <code>ChatGPT</code> or <code>Gemini</code> to <code>Trac</code>. Instead, you can leverage the fact that the <code>TracWiki</code> markup format is very similar to <a href="https://zim-wiki.org/"><code>ZimWiki</code></a>. And <code>pandoc</code> has a built-in <code>ZimWiki</code> writer. (Incidentally both formats are similar to <a href="http://www.wikicreole.org/"><code>WikiCreole</code></a>).</p>



<h2 class="wp-block-heading">Online tool</h2>



<p>There&#8217;s two ways to do this. The simplest one is to use the online tool for trying out <code>pandoc</code>:</p>



<p><a href="https://pandoc.org/try">https://pandoc.org/try</a></p>



<p>Just copy the markdown and paste it into the tool, select the output format to be <code>zimwiki</code> and click <code>Convert</code>.</p>



<h2 class="wp-block-heading">Shell</h2>



<p>You can also do this on the command line. If you have <code>xclip</code> installed, you can do it with the following one-liner that you can store as an alias:</p>



<pre class="wp-block-code"><code>alias md2trac="xclip -selection clipboard -o | pandoc --from markdown --to zimwiki --no-highlight | xclip -selection clipboard"</code></pre>



<p>Now you can copy the markdown output from ChatGPT, run <code>md2trac</code>, then paste the clipboard contents directly into your <code>Trac</code> ticket or wiki page.</p>
<p>The post <a href="https://www.alexgeorgiou.gr/markdown-to-trac-wiki/">⎘ Copying markdown from ChatGPT or Gemini to TracWiki using pandoc</a> appeared first on <a href="https://www.alexgeorgiou.gr">Alexandros Georgiou</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.alexgeorgiou.gr/markdown-to-trac-wiki/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to migrate trac MySQL-based project from trac 1.0.12 to trac 0.11.7</title>
		<link>https://www.alexgeorgiou.gr/migrate-trac-1-0-12-to-0-11-7/</link>
					<comments>https://www.alexgeorgiou.gr/migrate-trac-1-0-12-to-0-11-7/#respond</comments>
		
		<dc:creator><![CDATA[alexg]]></dc:creator>
		<pubDate>Mon, 13 Mar 2017 20:25:14 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[downgrade]]></category>
		<category><![CDATA[issue tracking]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[trac]]></category>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=199</guid>

					<description><![CDATA[<p>How to migrate trac project from 1.0.12 to a 0.11.7 installation if your project is MySQL based.</p>
<p>The post <a href="https://www.alexgeorgiou.gr/migrate-trac-1-0-12-to-0-11-7/">How to migrate trac MySQL-based project from trac 1.0.12 to trac 0.11.7</a> appeared first on <a href="https://www.alexgeorgiou.gr">Alexandros Georgiou</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In a world dominated by <a href="https://www.atlassian.com/software/jira" target="_blank" rel="noopener noreferrer"><code>JIRA</code></a>, some still dare to use <a href="https://trac.edgewall.org/" target="_blank" rel="noopener noreferrer"><code>trac</code></a>&#8230; Here&#8217;s how to migrate <code>trac</code> to an earlier version, assuming this was a good idea, which of course it is not!</p>
<h2>Versions</h2>
<p>On my Ubuntu 16 installation (let&#8217;s call it <code>example1.com</code>) I have a project on this version of <code>trac</code>:</p>
<pre>$ lsb_release  -d
Description:    Ubuntu 16.10
$ tracd --version
tracd 1.0.12</pre>
<p>I had good(-ish) reasons to migrate the entire project to a copy on an Ubuntu 10 machine.</p>
<pre>$ lsb_release -d
Description:    Ubuntu 10.04.4 LTS</pre>
<h2>Installing trac</h2>
<p>These are the resources that you need to be aware of:</p>
<ul>
<li><a href="https://trac.edgewall.org/wiki/TracOnUbuntu" target="_blank" rel="noopener noreferrer">https://trac.edgewall.org/wiki/TracOnUbuntu</a></li>
<li><a href="https://trac.edgewall.org/wiki/MySqlDb" target="_blank" rel="noopener noreferrer">https://trac.edgewall.org/wiki/MySqlDb</a></li>
</ul>
<p>I first installed <code>trac</code> via the <code>old-releases.ubuntu.com</code> repository.</p>
<pre>$ sudo apt-get install trac</pre>
<p>This installed an earlier version than the one I had.</p>
<pre class="wiki">$ tracd --version
tracd 0.11.7</pre>
<h2>Setting up the new (old) trac</h2>
<p>Rather than upgrading the entire system with <code>do-release-upgrade</code>, I decided to work with this version.</p>
<p>You will need the <code>python-mysqldb</code> module on <code>example2.com</code> to access a MySQL database. If you&#8217;re using PostgreSQL the procedure <em>should</em> be similar. YMMV.</p>
<pre class="wiki">$ sudo apt-get install python-mysqldb</pre>
<p>First, copy the assets of the project environment. This is a directory tree that you can copy over using <code>rsync</code>.</p>
<pre class="wiki">rsync -r example1.com:/path-to-trac-env example2.com:/path-to-trac-env</pre>
<p>For simplicity we&#8217;ll keep everything the same: file directories, database name and database credentials, although you could change these. Your database settings are in the <code>/path-to-trac-env/conf/trac.ini</code> file. You want the database variable under the <code>[trac]</code> section, which should look something like:</p>
<pre>[trac]

database = mysql://tracuser:tracpassword@localhost:3306/trac-env</pre>
<p>You will want to create an empty MySQL database where your project will live. You will need the MySQL client on <code>example2.com</code>, so if you don&#8217;t have it, install it with:</p>
<pre>sudo apt-get install mysql-client</pre>
<p>You will then want to login as root</p>
<pre>mysql -u root -p</pre>
<p>and create the database, (using the <code>utf8_bin</code> collation)</p>
<pre class="wiki">CREATE DATABASE `trac-env` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;</pre>
<p>and finally create the user:</p>
<pre class="wiki">GRANT ALL ON `trac-env`.* TO tracuser@localhost IDENTIFIED BY 'tracpassword';</pre>
<p>Exit the MySQL client with <code>Ctrl-D</code> and import a standard SQL dump of your database from <code>example1.com</code>. For instance, if you like one-liners, you might do this on <code>example2.com</code>:</p>
<pre class="wiki">ssh example1.com "mysqldump -u tracuser -ptracpassword --single-transaction trac-env | gzip -9" | zcat | mysql -u tracuser -ptracpassword trac-env</pre>
<h2>Nasty hack FTW</h2>
<p>Now start <code>tracd</code> and visit the installation via your web browser. You should see an error like this:</p>
<pre class="wiki"> Trac detected an internal error:

ValueError: timestamp out of range for platform time_t</pre>
<p>This is because all timestamps in this newer version of <code>trac</code> are in microseconds, rather than seconds. Here is <a href="https://trac.edgewall.org/ticket/9314">a (somewhat) relevant ticket</a>.</p>
<p>I went ahead and hacked the DB thusly:</p>
<pre class="wiki">update ignore attachment set time = floor( time / 10000000);
update ignore auth_cookie set time = floor( time / 10000000);
update ignore revision set time = floor( time / 10000000);
update ignore ticket set time = floor( time / 10000000);
update ignore ticket set changetime = floor( changetime / 10000000);
update ignore ticket_change set time = floor( time / 10000000);
update ignore version set time = floor( time / 10000000);
update ignore wiki set time = floor( time / 10000000);</pre>
<p>These are all the timestamp columns in the DB. Dividing by a million converts millionths of a second to seconds and the <code>floor</code> function makes sure that the result is still an integer.</p>
<p>The <code>ignore</code> argument is there only because I had one single collision in one ticket comment. Needless to say, this is a nasty hack, so don&#8217;t rely on it too much.</p>
<p>But, for my purposes, <strong>&#8220;It Works<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" />&#8221;!</strong></p>
<p>The post <a href="https://www.alexgeorgiou.gr/migrate-trac-1-0-12-to-0-11-7/">How to migrate trac MySQL-based project from trac 1.0.12 to trac 0.11.7</a> appeared first on <a href="https://www.alexgeorgiou.gr">Alexandros Georgiou</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.alexgeorgiou.gr/migrate-trac-1-0-12-to-0-11-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bash alias to create a TracGit link to your latest commit</title>
		<link>https://www.alexgeorgiou.gr/tracgit-link-latest-commit/</link>
					<comments>https://www.alexgeorgiou.gr/tracgit-link-latest-commit/#respond</comments>
		
		<dc:creator><![CDATA[alexg]]></dc:creator>
		<pubDate>Thu, 22 Sep 2016 15:49:29 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[changeset]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[TracGit]]></category>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=118</guid>

					<description><![CDATA[<p>I'd like to share with you a handy bash alias to create a TracGit link to your latest commit.</p>
<p>The post <a href="https://www.alexgeorgiou.gr/tracgit-link-latest-commit/">Bash alias to create a TracGit link to your latest commit</a> appeared first on <a href="https://www.alexgeorgiou.gr">Alexandros Georgiou</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I&#8217;d like to share with you a handy bash alias to create a <em>TracGit</em> link to your latest commit.</p>
<h2>Don&#8217;t forget to add the TracGit link</h2>
<p>Who doesn&#8217;t use <em>git</em>? Nobody, that&#8217;s who. And who doesn&#8217;t use <a href="https://trac.edgewall.org/"><em>trac</em></a>? Well, actually, a lot of people. Nowadays <em>Joomla</em> seems to be all the rage. But <em>trac</em> is pretty cool and I use it for all the things! <em><a href="https://trac.edgewall.org/wiki/TracGit">TracGit</a></em> lets you setup your <em>git</em> repos so that you can <a href="http://stackoverflow.com/questions/9034099/how-can-i-make-a-link-to-a-git-changeset-in-trac-when-there-is-more-than-one-rep/9040055#9040055">link to your source from the trac tickets and wiki pages</a>.</p>
<p>As we all know by now, it&#8217;s a very, very good habit to link to your source changes when you close a ticket. In fact, I get to do that all the time. And whether it&#8217;s a single commit, or a merge from an entire branch of commits, it&#8217;s almost always the last change that you want to link to. So here&#8217;s a bash alias that gives you the exact <em>trac</em> syntax that you can copy from the shell and paste into your ticket.</p>
<pre>alias git-trac='echo [changeset:$(git log -1 --format="%h")/$(basename $(git rev-parse --show-toplevel))];';</pre>
<p>It&#8217;s nothing fancy, but I find myself using it all the time so I decided to share. Add it to your <code>~/.bashrc</code>, or better yet, to <code>~/.bash_aliases</code>, if you&#8217;re the organized type.</p>
<h2>One less step&#8230;</h2>
<p>If you&#8217;re anything like me, you&#8217;re way too busy to copy <em>and</em> paste stuff. If only you could skip one of those two steps and save valuable time&#8230;</p>
<p>Luckily, you can automate the copy to clipboard part! First install <em><a href="https://github.com/astrand/xclip">xclip</a></em>:</p>
<pre>sudo apt-get install xclip</pre>
<p>Then, your alias becomes:</p>
<pre>alias git-trac='echo [changeset:$(git log -1 --format="%h")/$(basename $(git rev-parse --show-toplevel))] | xclip -selection clipboard';</pre>
<p>Unfortunately, you&#8217;ll have to paste the string into <em>trac</em> yourself. If you&#8217;re thinking about automating that part, well, then I&#8217;ve got to ask, <em>what&#8217;s wrong with you?</em></p>
<p>The post <a href="https://www.alexgeorgiou.gr/tracgit-link-latest-commit/">Bash alias to create a TracGit link to your latest commit</a> appeared first on <a href="https://www.alexgeorgiou.gr">Alexandros Georgiou</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.alexgeorgiou.gr/tracgit-link-latest-commit/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
