neděle 28. prosince 2008

How to use MonoDevelop for Maemo

I needed to create a simple application for Nokia N810 running maemo. Because I am used to C# and Microsoft.NET and I knew that there is Mono available for Maemo, I decided to write it in C# using MonoDevelop.

Everything is working fine, but you have to change the GTK# support exactly for 2.10.3 in MonoDevelop, Project Options, General, GTK# Settings, Options. If you do not do that, when you run the application on your Nokia, you get The following assembly referenced from ... could not be loaded.

neděle 23. listopadu 2008

The advantages of crisis



redinews stock chart bar


Nowadays when the financial crisis is slowly changing into recession, we are reading more a more positive news about what this is bringing to us. Not only anti-cyclical sector is starting to grow as people are remodeling their houses instead of buying new ones, dealers of used cars are selling more and people are going more to the sport centers, but at least this helps us understand more what has happened.

These days investors are mostly putting money into safe investments like gold, bonding funds or state bonds.

But business needs to take actions as well and there are four areas you should concentrate on:

1. Save time
2. Increase revenue
3. Cut costs
4. Improve efficiency


There are many ways how to get this done, but there are three main domains that may help fast and may be achieved easily:

1. Make sales force productive sooner
2. Eliminate travel and delivery costs
3. Improve the productivity of channel partners


Although it might not be clear, you can make a lot with with a sales force automation tool. If you allow the sales people to fill prepared forms instead of writing sales order, activity reports and call sheets and that saves a lot of time. And if you are using not only a sales force automation tool, but CRM, not only it allows you sell more because of the reduction of non-selling time, but there are other people benefiting - mainly marketing. And if we are in the middle of crisis, where would a business owner invest more then in the marketing? Did you know that many successful marketing agencies and consultancies were actually started during a recession?

Have you heard that CRM is not easy to work with, you have to enter tons of data and is it costly? Have a look at SprinxCRM and see for yourself.

Campaign detail in SprinxCRM

sobota 22. listopadu 2008

The end of silence

I know I know ... I have not been posting anything here for another 3 month, but I was really extremely busy with all the changes that were needed as the result of the financial crisis that started so long ago and nowadays even we here in the Central Europe feel the consequences.

But things are changing a lot, I promise :-)

sobota 30. srpna 2008

How to run X Server and Maemo environment in Scratchbox

From Prog80X.blog:

1. in a new terminal window run: Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -extension Composite

2. in Scratchbox run: export DISPLAY=:2
af-sb-init.sh start

Ubuntu preparation for Scratchbox

I use Scratchbox to setup an environment for developing for my Nokia N810. I have created a small script to setup few system variables to get Scratchbox working.


sudo sh -c "echo 0 > /proc/sys/vm/vdso_enabled"
sudo sh -c "echo 4096 > /proc/sys/vm/mmap_min_add"
sudo sh -c "echo 4096 > /proc/sys/vm/mmap_min_addr"

I am back ....

OK, so I am back and lots have changed during the last ... Uhm ... Let me ... 3 months? Yes, is is sad but true.

I am writing this from my Nokia N810 and I must say that along with the switch I am very happy with all this.

What do I use an why? The first three are here.

MaemoWordPy to write blog posts like this one. This is one of the biggest advantages of the tablet - is is instantly ready for use.

Mauku to microblogging on Jaiku and Twitter. I am a fan of microblogging as an alternative to instant messaging.

Pidgin for instant communication with friends. I will write few words about the difference between IM and u-blogging.

pátek 30. května 2008

Switched all to the Google Apps

Although it might look very funny, I have "created" about the third reincarnation of my home page. Finally I have found out Google Apps the least painful way.

More to come as I use it.

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.

sobota 9. února 2008

Ubuntu 7.10: server install from network on software RAID1

Okay, so I am writing the steps I took to get Ubuntu 7.10 Server on my computer. I had to use the installation from the network as I am not able to boot from CD (have a look here why). As I was unsuccessful last time I started from scratch.

(The first part is taken from this tutorial)
1. let's say you have Windows XP
2. create folder C:\boot
3. download files linux and initrd.gz to c:\boot
4. Download Grub4Dos from project page on sf.net
5. unzip grub4dos-0.4.3.zip
6. Copy c:\boot\grub4dos-0.4.3\grldr to C:\
7. create folder C:\boot\grub
8. Copy c:\boot\grub4dos-0.4.3\menu.lst to C:\boot\grub
9. Open Command Line: Start - Run - cmd
10. run attrib -a -r -s -h c:\boot.ini in the command line
11. run notepad c:\boot.ini in the command line
12. add C:\grldr="Start GRUB" at the end of boot.ini and save it
12. return to the command line and run notepad c:\boot\grub\menu.lst
13. to the end of the file add
title Ubuntu Installer (hd0,0)
kernel (hd0,0)/boot/linux vga=normal ramdisk_size=14972 root=/dev/rd/0 rw --
initrd (hd0,0)/boot/initrd.gz
and save it
14. remove CD and floppy and restart
15. when booting choose Start GRUB option from Windows loader (press F8 to get there)
16. after a while you should see GRUB4DOS window. Select the last option Ubuntu Installer (hd0,0)
17. Ubuntu installer should start after a while (Choose language)
18. Configure everything and choose also your network mirror
19. The installer should stop at "Partition disks"
20. We need to create 2 same layouts on both disk - the easiest thing how to do this is to create partitions RAID partitions from the end on both disk (8GB let say), do not forget to set the type to Linux raid autodetect
21. We also need to have a partition with root filesystem so let's create it on the second disk from the beginning the same size as Windows partition
22. Once installed, you can reboot and have your system running
23. run sudo fdisk -l to make sure the partitions are the same size and the correct type Linux raid autodetect
24. download the software raid tools sudo apt-get install mdadm
25. create the RAID by sudo mdadm --create /dev/md0 -l 1 -n 2 /dev/sda2 /dev/sdb1
26. format the new disk by sudo mkfs -t ext3 /dev/md0
27. mount the new disk sudo mount /dev/md0 /mnt/
28. we have to copy all the data from current root (e.g. /dev/sdb2) to the new disk: su
tar cl --exclude=/media/sda1 -–exclude=/proc -–exclude=/mnt -–exclude=/sys / | tar xvC /mnt
exit
. You should ommit --exclude /media/sda1 if windows partition is not mounted. You should not ommit the other excludes. You might check the status cat /proc/mdstat
29. we have to change fstab of the newly to-be-booted system by sudo nano /mnt/etc/fstab. Change the beginning of the line with / from something like UUID=03... to /dev/md0.
30. create ommited folders sudo mkdir /mnt/proc /mnt/sys; sudo chmod 555 /mnt/proc
31. it the RAID partition on the same disk as the original bootable partition is not set as bootable, set it sudo fdisk /dev/sdb and then a 1 and w.
32. we have to change booting with GRUB so sudo nano /boot/grub/menu.lst. Find the default entry, copy the lines before the default entry and change root (e.g. from root (hd1,1) to the new RAID partition on the same disk root (hd1,0)). Also change kernel line from root=UUID=xycxcxy... to root=/dev/md0.
33. copy changed file to mnt as well sudo cp /boot/grub/menu.lst /mnt/boot/grub/menu.lst
34. change /etc/mdadm/mdadm.conf by

su
mdadm --examine --scan > /tmp/mdadm.conf
cat /tmp/mdadm.conf >> /etc/mdadm/mdadm.conf
cp /etc/mdadm/mdadm.conf /mnt/etc/mdadm/mdadm.conf
exit

35. change /usr/share/initramfs-tools/init by sudo nano /usr/share/initramfs-tools/init and add line /sbin/mdadm --assemble --scan before mountroot
36. build init by sudo update-initramfs -k all -u. copy sudo cp /boot/initrd.img-2.6.22-14-generic /mnt/boot/initrd.img-2.6.22-14-generic.
37. install grub to the boot sector sudo grub-install /dev/sda and sudo grub-install /dev/sdb.
38. reboot. You should be up and running. Check by mount - the / partition should be /dev/md0, if you check cat /proc/mdstat you should see md0 : active.

Hope you find this helpful and enjoy it. If something is going wrong, you can always boot the second option,mount your RAID on /mnt and go through the files. You still need the original linux partition as it contains boot files.

RAID1 as root filesystem on Ubuntu 7.10

OK, so it was not that easy but following the very nice quide and finding some information how to solve my problems on Ubuntu here, here, here and here, I had RAID up and running for a while...


The most important part was changing /usr/share/initramfs-tools/init and adding mdadm --assemble --scan there. You have to run sudo update-initramfs -k all -u then and also sudo grub-install /dev/md0.
Also do not forget to add something like ARRAY /dev/md0 level=raid1 num-devices=2 UUID=cbc59996:6e0056a8:325ecf68:79913751 at the end of your /etc/mdadm/mdadm.conf.

The strange thing is, that I am still stuck at the boot now, but I hope I will be able to get over it.

pondělí 4. února 2008

.Net Twitter Badge

I needed something very simple to show my twits on my homepage and written in DotNet (C#). I have downloaded the code from RSS.NET, compiled it into .NET 1.1 DLL and created a very simple code that you can embed into your .ASPX page. The library is here and it should be put in /bin folder in your website folder. The code could look somehow like this:


<%
string url = "http://twitter.com/statuses/user_timeline/8607272.rss";
Rss.RssFeed feed = Rss.RssFeed.Read(url);
Rss.RssChannel channel = (Rss.RssChannel)feed.Channels[0];
foreach (Rss.RssItem item in channel.Items)
{
Response.Write( item.Description + "&nbsp;" );
Response.Write( "<small><a href='" +item.Link + "'>" + item.PubDate + "</a></small><br><br>" );
}
%>


Make sure your page has .ASPX extension and starts with famous


<%@ Page Language="C#" Debug="false" %>

úterý 29. ledna 2008

The Silence of the Fans

Inspired by this, I will post what was needed.

sudo aptitude install alien
sudo aptitude install snmpd
sudo aptitude install tcl8.4
sudo aptitude install fakeroot
sudo aptitude install rcconf

Download files from http://h20293.www2.hp.com/portal/swdepot/displayProductsList.do?category=LINUX

sudo apt-get install libstdc++2.10-glibc2.2
sudo dpkg -i hpasm-7.8.0-100.etch26.i386.deb
sudo dpkg -i hpsmh-2.1.7-167.debian.i386.deb

sudo /etc/init.d/hpasm configure

The only thing is, that it has not helped at all... yet...

pondělí 28. ledna 2008

"Network and Sharing Center" "Server execution failed"

Would net localgroup "Administrators" "Local Service" /add from here help?

sobota 26. ledna 2008

Up and running



Is not this nice? I have Boo and MonoDevelop and ASP.NET running on the top of my Ubuntu Desktop installation with Apache2 and mod-mono from Mono...

For today I have started with

sudo aptitude install apache2


sudo /etc/init.d/apache2 restart


sudo aptitude search mono


and finally

sudo aptitude install libapache2-mod-mono

neděle 13. ledna 2008

An article about Pharma CRM

just in case you can read Czech language - here.