Top posts

Latest articles


Multithreaded difficult, try multi-server multi-threaded!

Posted by Jongerius under General Rant
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

Any developer of multithreaded systems will know the following problem. You have a nice program that is working on a shared memory and shared data. Now you don’t want to get dirty reads, or worse yet dirty writes. So you build in techniques to prevent this. But what if you have the same problem accross multiple fisical computers.

You could try using semaphores, a technique used to synchronize multiple threads in one system. This means you enable a flag to indicate something is doing a critical process that should not be interrupted. Another way could be to set a generic flag that indicates what state the information is in.

For example if you use a file you could use the following statuses:

  1. Some application is reading the data for analysis
  2. An application is writing to the file
  3. An application is purging processed data

Pending on what status is set a computer can do some work or not.  If the flag is set to 1 that means another application should not purge data nor should it append data. As this could lead to incomplete information.

Doing so accross multiple computers means that you have to build a messaging system of sorts. If you’re on one network and running Windows you could use windows messaging services for this.

But if you’re on the internet or on different physical networks you’re going to have to use something like SOAP or a database to achieve the same result. Using SOAP means you will have to build a PoolManager that will store the status for you. And where applications can ask what the current status is.

None of the above is simple, and some are very slow (like SOAP calls). So try out what ever works best for you.


Configuring a Debian Sarge Server, part III

Posted by Jongerius under Internet, Webdevelopment
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

In this third part of the series I will be taking you through some security issues of having your own server. It will be a short one, thank god, compared to the other articles. But very crucial. We’ll be restricting access to SSH.

First things first. What is SSH. Well it’s full name is Secure Shell, which means that you log in to the command line (for windows kids) of your server. You’ll probably need two tools to work with it:

  • Putty, which gives you shell access
  • Winscp, which enables you to copy files to the server

When you’re already running Linux these tools, or comparable ones should already be installed.

Now that you have the tools you can log in to your server from any system in the world. Gaining root access straight away. Which is fun, but also very dangerous. So your next step should be to disable the login of the root from the server. You can do this by modifying the file ‘/etc/ssh/sshd_config’.

DenyUsers root

That’s it. No more nasty root access from putty. Now you will have to have a seperate user account to log in, so don’t restart SSH just yet. First do the following:

adduser remoteuser
passwd remoteuser

This will create a new user and set it’s password, and please change the remoteuser to the name of the user you want it to have ;). After this you will have to restart SSH to make sure root can no longer log in. Do this by executing the following line:

:>/etc/init.d/ssh restart

Once you logout you won’t be able to login using root any more. But to install applications or change system files you will need to be able to gain root access. You can do this by using the command ‘su <program>’ .

Linux will ask you for the root password and execute the line after su with root access. That’s it for know. More next time.


Back from break

Posted by Jongerius under General Rant
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

I’m back and ready to post some more fancy articles. I’ve been sorta. More acurately I’ve been dealing with the hassle around buying a house. Which left me with very little time for writing interesting posts for you all.

Now that the mortage is taken care of and the contracts are all signed it’s time to continue some of the promised articles:

So a lot more to come…


Setting up Windows Mobile 6 on HTC p3300

Posted by Jongerius under General Rant
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (4 votes, average: 5.25 out of 6)
Loading ... Loading ...

Today I will be sharing with you how to install windows mobile 6 on your p3300. But first a disclaimer. It is possible to brick your phone if the upgrade is done incorrectly or tried on a device without at least 50% battery power. If you brick it you can try and send it in for repair.

First get going by downloading the Windows Mobile 6 ROM. Please note that this one used below is the official HTC ROM released for Japan, Australia and other eastern countries, but it is english.

  • Download the USPL here, the upsl will be used to unlock the device for the upgrade. This is a critical tool!
  • Download the Windows Mobile 6 ROM here. This is the official ROM released by HTC for the eastern parts of the world (don’t worry it’s in english)

Getting started
Before you even attempt to upgrade to Windows Mobile 6 please make sure of the following things:

  • Your battery is at least 50% full, otherwise you may brick your device
  • You have Active Sync installed and the icon of it is green, which means it is connected to your device.
  • You have an unbranded version of the P3300, it may also work on branded ones but I haven’t tested it.

Installing UPSL
The first thing you will need to install is USPL, if you’ve done so already you can skip this step. Here’s what to do:

  • Connect your device to the computer
  • Make sure it’s properly connected and Active Sync recognizes it (battery must be at least 50%!!)
  • Run start_uspl.exe to initiate the upgrade process.
  • Walk through the steps of the application that pops up. Do not disconnect the device during the upgrade or it will end up bricked.
  • You’re done :)

Upgrading to Windows Mobile 6
Now that UPSL is installed you can install Windows Mobile 6 on your device. Please make backups of all files on your device before proceeding. During the upgrade all of your settings will be erased.

Just follow these steps:

  • Backup all critical files of your P3300 to your computer
  • Write down all settings related to GPRS or you’ll loose them
  • Connect the device and make sure the battery is not below 50%
  • Run RUU_Artemis_DOPODASIA_WWE_3.7.707.1_4.1.13.30_02.69.90_Ship.exe to start the upgrade
  • Follow all the instructions on screen
  • You’re done

Congratulations you’ve just joined the group of Windows Mobile 6 users. If you received a message about incompatibility during the upgrade you did not install USPL first!

If you got problems during the upgrade then post them, I’ll try to help where ever I can.


Configuring a Debian Sarge Server, Part II

Posted by Jongerius under Development, General Rant
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

Today it’s time to post the second in the series of how to configure your own VPS (Virtual Private Server). For the basics on setting up Apache and the configuring the server see part I of configuring a debian server.

In this part I’ll guide you through setting up PHP and MySQL. Which I believe are the basic things you’ll need for running any kind of webserver. And yes I know ASP is also beautifull, it’s just useless on Linux sofar.

Installing PHP
First the easy things. Installing PHP is probably one of the easiest steps. Just update your apt cache by running the following command:

:> apt-get update

Though this may not always be necessary, it’s better to update then get a nasty suprise later on. After this you should be able to search for PHP5. Why use version 5 rather then 4, well because there’s a rumor going round that support is being dropped for version 4. So lets install the needed libraries:

:> apt-install php5 php5-mysql

If everything goes correctly this will also install MySQL v14.12, it at least did that for me. Must be a dependancy for php5-mysql. However if it is not installed correctly then just run:

:> apt-install mysql-server5

Configuring PHP and MySQL
This step should be pretty straight forward since it’s pretty much done for you when installing the applications. However we just want to make sure about it. We first want to make sure that PHP is properly attached to Apache. This is done by adding (or checking if it already exists) the following lines to httpd.conf:

LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
<IfModule mod_php5.c>
    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
</IfModule>

What this does is pretty simple. It loads the module and then attaches the .php extension to the module so that PHP now handles all requests ending on ‘.php‘.

To test if PHP is setup correctly you can create a page called ‘test.php’ in any of the websites you’ve configured in part 1 of the series. Add the following content to the page:

<?php
   echo phpinfo();
?>

If everything is setup correctly you should see a listing of the configuration of PHP. If not then you need to walk through all the steps again to find the problem. If you’re still having problems after this then please post them and I’ll try and help you were ever I can.