Thursday, June 14, 2007

Saladrex is bored

My server and network machine Saladrex is really bored. It barely reaches a CPU workload of 1%. Therefore I decided to help him out: I downloaded and installed BOINC via ports and it is now constantly calculating things for the FightAIDS@home project. It is really depressing though... I use BOINCView to monitor it's working and it tells me that Saladrex is able to make 538 MFLOPS. My Core 2 Duo machine Scylandara makes 766 MFLOPS but is only running on half work load. Here are some statistics:


BoxCPU(s)MemoryMFLOPS (at 50%)MFLOPS (at 100%)
ScylandaraCore 2 Duo @ 2,3 GHz1GB DDR27661632
SaladrexIntel Pentium 4 @ 1,8GHZ512MB DDR-SDRN/A538



And here we go:

Monday, June 11, 2007

TODO tags in Qt 3.8.x

I recently tried to rescale a QPixmap containing a PNG with alpha values via resize(). Do you think it worked? No it didn't:
QPixmap::resize: TODO: resize alpha data
I tried to overlay a battery icon with a fully transparent image just containing a blue bar which I tried to resize according to the percent of battery power left. Ha! Now I have to crop the image to the bar and place it directly in the image... damn.

Friday, June 1, 2007

I screwed with my MySQL

I have some problems with my MySQL client on my workstation though. Everytime I wish to connect to my MySQL server it wrongly assumes the IP of my workstation instead of the remote peer and connects to the wrong one. Though when I ping the server manually and through the error dialog of the MySQL Administrator the IP is correct. Is this normal?

Saturday, May 26, 2007

Remains CD

I got my hard copy of Muddasheeps Remains today. It was packed with some nice artwork, which I am going to show off in a few days: My sister took our camera to Pullman City, therefore I was not able to take a picture of it, yet.

Tuesday, May 15, 2007

Turning off the bell in FreeBSD

It's that simple:

$ echo hw.syscons.bell=0 >> /etc/sysctl.conf
$ sysctl hw.syscons.bell=0

Monday, May 7, 2007

HuaWeiClient under FreeBSD

I recently got mailed up by an Chinese student who wished to run the HuaWeiClient under FreeBSD. Though he could not compile it for two reasons:

A wrong pragma pack in the global.h header file. GCC 3.4.6 did not like it:
#pragma pack(push)
#pragma pack(1)

As GCC suggested:
warning: malformed '#pragma pack(push[, id], )' - ignored

I corrected it:
#pragma pack(push, 1)

And the code used some Linux specific ioctl() code named SIOCGIFHWADDR to get the mac address of the interfaces.
if (!(ioctl (fd, SIOCGIFHWADDR, (char *) &buf[i])))

I replaced it with the proper sysctl() calls:
if ( sysctl(mib, 6, 0, &len, 0, 0) == 0 )
{
buf = new char[len];
if ( sysctl(mib, 6, buf, &len, 0, 0) == 0 )
{
ifm = reinterpret_cast(buf);
sdl = reinterpret_cast(ifm+1);
ptr = reinterpret_cast(LLADDR(sdl));
// Now copy it into our destination buffer
for ( int j = 0; j < 6; ++j )
{
infoarray[i].macaddr[j] = (int)ptr[j];
}
}
}


I know... the struct keyword is not necessary or may be even not pure C++... but it is my style; go with it.
The patches are available for download here. Just download the original software from the SorceForge project site and extract it. Then download my patches and extract them into the directory where your HuaWeiClient sources are located and type the following into a shell:
$ patch global.h < global.h.patch
$ patch networkoperation.cpp < networkoperation.cpp.patch

After you have finished patching the source files, compile it as usual. By typing:
$ qmake
$ make

If the patches do not work for you, please feel free to contact me.

Sunday, May 6, 2007

HQ:Amen Kitty

Ha, Ha, Ha, staying alive, staying alive; Ha, Ha, Ha, staying alive, staying alive... >)

Sadistic Kitty

Saturday, May 5, 2007

Wednesday, April 18, 2007

Tetrinetstats (former tnet2html) rewritten

I have completely rewritten the tnet2html perl script and renamed the project to "tetrinetstats". It is now capable of showing more than one winlist file and even to sum them up. Neat, isn't it? For an example of it's output take a look here.

Download (sample templates and CSS included).

Thursday, March 29, 2007

Tetrinet-X scores on a webpage

My home server (saladrex, FreeBSD machine) is now running a TetriNET server (tetrinet-x). Today I have written a small script which parses the game.winlist file the TetriNET server produces and displays it as HTML you design. Generally it does the following:
  1. Blindly sending a 'header.htm' to the client.
  2. Reading and parsing the score file.
  3. Sending out the content of a 'bit.htm' for each score field, and replacing $name with the name of the score holder and $score with the score value.
  4. Blindly sending a 'footer.html' to the client.
So far it can only cover one winlist file. Though I am working on it! Tested on IIS and Apache 2; and sorry for the missing help file: Too lazy!

Download (Sample HTML/CSS included)

Tuesday, March 20, 2007

flv2mpg utility

I have written a small but useful utility today: flv2mpg.pl. A perl script which tries to convert flash video files (.flv) specified via the command line to mpg files. The script uses ffmpeg do accomplish its task. I tested it both with the ffmpeg which is in the FreeBSD ports, and with a 'ffmpeg.exe' (win32 obviously) I downloaded somewhere. It is really useful when it comes to convert YouTube videos:

flv2mpg
flv2mpg - with ffmpeg.exe (Win32)

Monday, March 19, 2007

OpenBSD T-Shirt

Wow, it's finally here. And it looks awesome! Here are some pictures:




And I got the following:
  • Puffy transparent sticker.
  • A flyer for the OpenCON 2007 on 30th of November.
  • Flyer for the Chaos Communication Camp 2007
  • ... and a flyer for the EuroBSDCon 2007
I definitely try to come the latter two.

Tuesday, March 13, 2007

XSS on Aon.At

I recently discovered an XSS security hole on my ISPs website: aon.at. It can be used to create a "type 1" XSS attack against their search engine: POC. My email explaining my exposure has been accepted friendly by their support:

Thank you for informing us directly. After we have checked your link and/or input data ourselfs, we totally agree with the existence of this issue. We have redirected this issue it to our local administration. We will try to react to it as fast as possible.


Good work guys, and good luck.
P.S: @Aon Support: Please stop writing HTML emails. My spine shivers to the thought that YOU guys send out HTML emails. ;-) Just kidding!

Wednesday, March 7, 2007

CISCO CCNA Final

Hey, final tests today. I made it up 70% without learning anything. Cool ey? The others haven't learned anything either, though they have cheated and were thus possible to reach the 90% percent (and above). I did not cheat at all and reached 70% without learning anything. Yeah, I am proud of it.

Sunday, March 4, 2007

Chat functionality almost complete.

I have written public methods for leaving a room and for sending a room message today. The receiving of room messages also works now, and the LoneSeekGUI project (my test application) shows how to use it! The only things which are missing missing by now, are:
  • Room tickers (not really important though)
  • Private messages (they are important)
  • And the notifications when someone leaves/joines a room where you are in (important too, since I have to keep the user list in sync).
Good new stuff, isn't it? :). I also made some improvements on LoneChat (the IRC alike SoulSeek chat client), though it is not yet usable.

Friday, March 2, 2007

Even more LoneSeek improvements.

While our teacher explained the inner workings of Oracle 10g today, I made some improvements. And I introduced so many new features! Like joining a chatroom (it now works), and storing all users of the chatroom in a list. There is also code for sending/retrieving chat messages and leaving a chatroom behind the scenes, though they lack a public method. By the way, I also found out how to read the tickers of a room; I have updated my protocol documentation with a section explaining how to get the tickers for a room. Last but not least: My source code is in the BerliOS SVN repository.

Wednesday, February 28, 2007

LoneSeek improvements

Although I should have learned for my Cisco skill based test tomorrow I have improved LoneSeek. I am now working the chat functionality, and I have implemented the following things today:
  • Support for listing all available chat rooms.
  • Code for joining a chat room is there but not tested, I suppose there are still some bugs in it.
And I have fixed some bugs:
  • Removed a bug in the code which reads String arrays off a SoulSeek packet which caused the LoneSeek framework to hang up.
  • Using ReadBytes() now instead of Read() since Read() might not read ALL data as requested but just what it can. Read() was causing huge packets to be splitted up when the data were received with a little delay.
  • Fixed a bug where an event is being invoked without being checked if it is null.
There is still one issue I cannot resolve though: I am using a seperated thread to handle the incoming data and another one to process the packets. The first thread is reading the data, assembling the packet ships it to a queue. The second thread then dequeues the packets and dispatches them. The dispatching progress also requires the call of the events, so the event listeners get notified. But the use of threads require the event listener to use Invoke() everytime it is updating GUI controls. Has anyone a fix for that?

Tuesday, February 27, 2007

LoneSeek goes BerliOS and CodePlex

I guess I will move LoneSeek to BerliOS for normal developing (their SVN is pretty stable), publishing releases and for the website hosting. But I will also put in on CodePlex. I guess I will port major releases to CodePlex. Well here we go.

Monday, February 26, 2007

My new notebook.

After the monitor of my old Fujitsu-Siemens M1425 broke again (it is pretty dark and seems to have a defective contact - the third time something broke) I decided to buy a new one and plug the Fujitsu-Siemens on my KVM switch. I wanted something around 15" but it does not have to have the newest hardware though. I am just using it for working and for programming. Therefore my voted down for a Lenovo Thinkpad R60E. Yeah, E, I guess what you are thinking, but I hadn't enough money for anything above "R60E". And all above are using a Core 2 Duo Mobile; power I would never really use the advantage of though. It might not be the fastest high end machine but it does its work! I pretty sure I will install a FreeBSD 6.2 with KDE on it, but I am unsure if I should keep the Windows 5.1 Home it came with or reinstall by using a Windows 5.1 Professional.

Sunday, February 25, 2007

LoneSeek improvements.

Just a quick summary on what I have done today on LoneSeek:

  • Improvement on the algorithm which reads the packets: I have completly rewritten the code which parses the packets: It is now centralized as "class PacketStream".
  • I have added some events to the LoneSeekClient class: OnConnect, OnDisconnect and OnLogin. I guess you can figure out when they are called. ;-)
  • File indexing service, which is used for sharing. You can now specify directories, which will be searched for files with file extension you specify. Ha! A functionality the official SoulSeek client doesn't have!
  • Tell the server the number of files and directories we share.
  • Tell the server which port we use.
  • Improved the network code: The last two points above are only invoked when we are successfully logged in.

Well... more code will follow soon. I am aiming for implementing the chat functionality.

Saturday, February 24, 2007

HashCalc: A hash calculation utility.

Oh my was I bored today. After being feed up with programming on LoneSeek and noticing that my laptop's TFT screen is broken (it's hard to program on PC-BSD when you can hardly see what you write) I didn't know what to do. Therefore I picked out my "tools-I-ever-wanted-to-have" list and picked the first item: "Get some utility which can calculate hashes/checksums (md5, sha1) and compare them with existing values".

So here we are: HashCalc, a hash/checksum calculation utility supporting various hash algorithms and forms of input data. Supported hash/checksum algorithms are:
  • MD5
  • SHA1
  • SHA256
  • SHA384
  • SHA512
  • CRC32
  • RIPEMD160

Supported forms of input data are:

  • Raw binary in hex notation (e.g. the output of hexdump)
  • Raw binary in decimal notation (for those who can't read hex)
  • Text in different encodings: ASCII, UTF7, UTF8, UTF16 Big Endian, UTF16 Little Endian, UTF32

Screenshot:

Download links:

HashCalc v100
HashCalc v100 Source Code

LoneSeek: A SoulSeek client

I am currently writing on "LoneSeek" a (hopefuly) fully featured SoulSeek client. But it's a hard work to do, since there is only one document out there describing the protocol of SoulSeek, and this document is pretty outdated. I am on it though to implement the features and try to figure out what has changed since the document was written and the newest version of the SoulSeek (version 156) came out. A very interesting work, and I am sure I will release LoneSeek as soon as the features are useable. Current implementation details are:

  • Library/Frontend implementation to keep the network code abstract.
  • Design is open for a SoulSeek server.

And now what is currently working? Not much though:

  • Connection to official SoulSeek server.
  • Login via username/password.
  • Retrieving the welcoming message.

What am I aiming for?

  • A good threading model that keeps the speed accurate.
  • Full support for chatting, including rooms.
  • Full "privileged user" support.
  • File sharing support, including queueing and browsing.
  • A user friendly GUI.
  • Ports to other platforms than Windows.

Wednesday, February 21, 2007

A nice perl script

I wrote a neat perl script today. Quite helpful, in case someone is interested. The script 'createm3u' creates a M3U playlist with the files of a directory and its subdirectories matching a certain pattern you specify. Really neat to update an existing playlist or to quickly create a playlist:

flo@nolaloth$ ./createm3u.pl mymedia.m3u ~/music/ .mp3 .ogg

This creates a playlist called 'mymedia.m3u' out of all files of the directory '~/music/' which have either .mp3 or .ogg as file ending.

Download the script.

Tuesday, February 20, 2007

Without a voice

It seems like I cannot live without some way of airing my voice, hu? Although I believe no one will actually read it I will go on posting. At least for a moment. I definitely headed into the wrong direction with my first blog; full of broken thoughts never really sanitized to reflect my person. I wrote something, and after it got posted I edited it heavily to feel comfortable with what I wrote. I hope that becomes better.