The Linux Page

Negative constant ... was passed to a negative sink

Today, as I was working with Coverity, I got this one message...

Negative constant passed to a negative sink.

Although I understood the meaning, I thought that this message was very confusing, How about:

Unexpected negative value in parameter #<position>

TOC test without editor

title 1

Test A

title 2

Testing B

title 3

Weird format

[toc hidden:1]

Auto-Vacuum not working? (and solution)

Since I manage multiple computers and each run a PostgreSQL database system, I can see discrepancies between versions. (i.e. newer versions fix problems in older versions.)

[toc hidden:1]

Taxonomy error generated from invalid nodes

Today I ran in an error that looked like this:

Invalid argument supplied for foreach() in <path>/modules/taxonomy/taxonomy.module on line 1214.

The line number may vary depending on the version you are using. At the time, I had Drupal 6.14 and the line number was 1214.

The problem is with a node that has an invalid definition of its taxonomy field. In other words, the $node->taxonomy is not defined. If it were an empty array, the function would not fail.

I was updating a new Drupal website from an old static website generating nodes automatically with a little module. There were a ...

OpenSSL and PostgreSQL conflict in PHP

All of last week I've been looking for the solution to a bug in one of my numerous websites.

The problem was that after registering, a user would get an error saying that the PostgreSQL connection was lost. I had never had that with Drupal and yet, it would be 100% consistent.

I tested the new code several times and had no problems with it, so I was really dismayed that all of a sudden it stopped working.

After quite some time, I finally decided that my new code was the culprit. Weird. It was. It does the same thing as one of the Core modules and yet it breaks the PostgreSQL ...

3rd button of one of my SGI gray mouse dies...

I've got those 3 button mice from SGI as I was working with Indy's and O2's. I also have keyboards. Those are real good quality!

Yesterday, I tried to right click and somehow, nothing happened. At first I thought maybe it was X going banana, but trying again and restarting did not change anything. I reset my KVM too, just in case. Still nothing.

Using your firewall with Postfix

After a little while (very little) our mail server gets quite clogged. It does not cause much problem to our server, however, legal mail server will have a hard time to connect because all of those illegal mail server connect thousands of times to try sending us spam.

To give you an example, I blocked less than 10 IPs today and I got over 5,000 hits blocked within about 12 hours. That's to give you a picture of the badness of those scam robots.

I thus looked for a solution to automatically block those IPs. I found two things, one is a shell script. I do not recommend it since it is ...

wsprintf() limit under MS-Windows

Today I wanted to check out a set of floating value in my Visual C++ development environment.

You can use the OutputDebugString() to print a debug string in the VC++ output window when running a software. This is quite handy, but when working in C++, string handling can be tedious. I need to create a message and wrote something similar to this:

wchar_t msg[128];
swprintf(msg, "Float: %f\n", my_float);
...

[toc hidden:1]

AddThis weird behaviors

I just switched my websites from one server to another and noticed that on my main company site (http://www.m2osw.com) I would get a # at the end of the URL. Automatically added somehow. Thinking that could be a bad guy I checked the code and could not really see anything.

Hitting "Back" once, I noticed that the # would be transformed to #atssh-digg. I don't have anything specific about digg on that page except the AddThis button. That adds Digg among some 150 different systems where you can share my pages.

Moving a website from one server to another

Moving a website to a new server

Now and again, you have to move a website from one server to another.

There are good and bad things about that, the main problem is with dynamic websites. Why is that? Simple: a dynamic website expects to access a database and if you hit the wrong server, that will go bad.

What's the best solution?

1. Install your website on the new server, make sure it loads okay (you may want to use a test sub-domain name to make sure, although that's not a rock solid proof since some things may use a fully qualified URL)

2. Change the IP address in your ...