sobota 19. dubna 2008

Where to change which X server Ubuntu 7.10 uses

If you have multiple X servers installed like me, you might need to change between them. The configuration file is stored at /etc/X11/xorg.conf. The X server is located in section "Device" at line Driver:


Section "Device"
Identifier "Generic Video Card"
Driver "vesa"
# Driver "fglrx"
Option "VideoOverlay" "on"
Option "OpenGLOverlay" "off"
BusID "PCI:1:0:0"
EndSection

neděle 6. dubna 2008

HawkWikiEx Open Source Wiki Engine in C# - 0.6.0 released

You can download the 0.6.0 version from CodePlex. It adds diff file generation and very simple authentication with commercial barcode generator.

The upcoming release will be 0.7.0. It will add really modular architecture and the email authentication provider. It will be released when the code cleanup is completed and when my wiki will be able to run on this version.

sobota 5. dubna 2008

How to deploy HawkWikiEx on Linux (Ubuntu 7.10)

1. Create a directory let's say /var/www/wiki.sample.com
2. Depending on your Apache2 configuration, create or open your site file e.g. /etc/apache2/sites-available/default on Ubuntu 7.10 and add a new virtual host:

<VirtualHost *>
ServerName wiki.sample.com
ServerAdmin your@yourmail.net

DocumentRoot /var/www/wiki.sample.com

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/wiki.sample.com>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
SetHandler mono
DirectoryIndex Default.aspx
AddType application/x-asp-net .wiki
AddType application/x-asp-net .showcode
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access_wiki.log combined
ServerSignature On

<Location /mono>
SetHandler mono-ctrl
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>

</VirtualHost>


3. Depending on your Mono-server configuration create a new WebApp file let's say /etc/mono-server/wiki.sample.com.webapp and add:

<apps>
<web-application>
<name>HawWikiEx on my domain</name>
<vpath>/</vpath>
<path>/var/www/wiki.sample.com</path>
<vhost>wiki.sample.com</vhost>
</web-application>
</apps>

4. Download a binary release of HawkWikiEx from Releases and put it in /var/www/wiki.sample.com
5. Restart Apache2 and Mono-server with (on Ubuntu 7.10)

sudo /etc/init.d/apache2 restart
sudo /etc/init.d/apache2 reload

6. Open your favorite browser and navigate to http://wiki.sample.com. HawkWikiEx StartPage should appear.

Introducing HawkWikiEx

As I have written before, I have been modifying HawkWiki to work under Ubuntu 7.10 with Apache2 and mod_mono.

Now welcome to HawkWikiEx! It adds new features like

  • Rendering done by NVelocity. It allows really easily to change the layout etc.

  • Standard ASP.NET authentication with built-in very simple authentication mechanism based on email authentication

  • change management and diff document generation between changes with Diff

  • simple built-in search based on NLucene



It already powers http://wiki.podhola.net.

neděle 2. března 2008

HawkWiki - patch to run under Mono

UPDATE!
If you are interested in HawkWiki successor, please have a look at HawkWikiEx.


I wanted to have HawkWiki running under Mono as my wiki. I have created a small patch and uploaded it to the HawkWiki source code repository. Hopefully it gets to the official source code :-)

If you want to download it, you can get the patch either from CodePlex or here. I have also uploaded just the three changed files, so you can grab WikiRenderer/WikiGenerator.cs, SampleWiki/WikiDataProvider.cs and SampleWiki/WikiHandler.cs.

neděle 17. února 2008

How to highlight a phrase on results from Lucene.Net

You came here probably because of Google search or mentioning this page on Stack Overflow. However this down is from 2008 and I am pretty sure it is not working anymore, last time I checked, there were no Lucene.Net.Highlight in Lucene.Net 2.4, sorry...

If you are Outlook, Remember The Milk or Producteev user interested in synchronization, you may have a look at my Outlook synchronization pages.



----------------------------------------------------------------------------------

Adding Lucene.Net based search to HawkWiki was really easy. The results page was showing only the links and I wanted to see also a part of the resulting page. I decided to use the highlighting feature in Lucene.Net.Highlight. I have not found Lucene.Net.Highlight.dll compiled, so I have compiled version 2.0.0 and you can download it. The code to highlight part of the page was also very simple. First instantiate the highlighter based on you search query:


Lucene.Net.Highlight.QueryScorer scorer = new Lucene.Net.Highlight.QueryScorer( query, reader, ContentsField );
Highlighter highlighter = new Highlighter( scorer );


If you are going through search hits, open the content and let highlighter to highlight the content:


StreamReader sr = File.OpenText(path);
string content = sr.ReadToEnd();
sr.Close();

string fragment = highlighter.GetBestFragment( analyzer, ContentsField, content );
result[ i ] = new Result();
string relPath = path.Replace( rootDir, "" );
result[ i ].Path = relPath;
result[ i ].Title = relPath.Remove( 0, 1 ).Replace( ".wiki", "" );
result[ i ].Fragment = fragment;


Simple, isn't it.

pondělí 11. února 2008

Wiki

UPDATE!
If you are interested in source code of wiki.podhola.net, please have a look at HawkWikiEx.

I have started a wiki on wiki.podhola.net. Why? You can find it on the start page there. The other reason was to have a wiki implementation working on Mono. I have started with HawkWiki and changed it a little bit. You can downloadit if you want.