Projects Section cleaned up
On my projects section I added some new projects.
The projects at "Active Projects" are active in development and even lots of new features will be added.
The new projects section "Maintained Projects" instead is meant to be used for projects, which have no active feature development, but are still maintained in case of version upgrade of the parent project or if a bug is filled.
The projects at "Previous Projects" are projects, which are not developed actively and currently not maintained. They may be revived someday :).
How to use postgres with nodeJS
With NodeJS (built on V8) it's pretty simple to access libraries written in C/C++.
Since NodeJS is 100% non-blocking I/O you'll need to tell your libraries to do the same. Even though libmysql is not yet capable of doing that, you may use postgres for this.
Ryan's node_postgres is a binary binding.
Compiling is easy as usual:
This may not work if a bug in node-waf is still present. So you get the error: Version mismatch: waf 1.5.9 <> wafadmin 1.5.10.
To fix that edit /usr/local/bin/node-waf and change 1.5.9 to 1.5.10.
If you receive the error: The program pk_config could not be found, you'll need to install postgres dev libraries package first. On debian/ubuntu you do that the following way:
It may fail to build then with the message: "Build failed", "cxx binding.cc -> binding_1.o". I am currently running into the same issue and will post an update as soon as I got this fixed.
There is also an pure Javascript implementation of the Postgres API available at postgres-js.
Installing jsl (JavascriptLint) on Linux
I tried to figure out how to compile and run jsl. As I just needed the binary, here is how I finally got it working in a pretty nice way:
First of all download latest JavaScript Lint.
Extract all files in that folder and go right into the src folder.
Run:
If all dependencies are there, you'll have a folder Linux_ALL_DBG.OBJ created. Go right into that and there is a file called "jsl". Copy that file to your bin folder (~/bin, /usr/local/bin, /usr/bin, /usr/sbin ... wherever you appriciate).
Now you are capable of running:
whereever you want!
Encode/Decode special xml characters in Javascript
When you want to convert htmlspecialchars in javascript to not so dangerous text and decode those html entities back again, you may have some convenient methods on a dom entity (like mootools .get('html') and .get('text')).
If you want to do that simple work on simple strings, I use the following functions:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'&': '&',
'"': '"',
'<': '<',
'>': '>'
};
var escaped_one_to_xml_special_map = {
'&': '&',
'"': '"',
'<': '<',
'>': '>'
};
function encodeXml(string) {
return string.replace(/([\&"<>])/g, function(str, item) {
return xml_special_to_escaped_one_map[item];
});
};
function decodeXml(string) {
return string.replace(/("|<|>|&)/g,
function(str, item) {
return escaped_one_to_xml_special_map[item];
});
}
amx/amxfile.c, fails in fputs_cell:
When trying to run my pawn script on a new linux server, I received the following error:
2
Assertion `fp!=((void *)0)' failed.
This was actually caused by a missing scriptfiles directory (or the directory was not writeable).
So take care in your scripts if an fopen really gives you a vaild file pointer and handle the situation if it does not!
Running Dedicated XServer applications on your Windows
Today I came across the problem that I had to run a Linux X-Server application on a Server, which has no X-Server installed.
Since I didn't want to mess around with the installation (by installing a fullblown xserver and all it's friends), I thought using XForward configuration should do it.
As extra challenge, I ran the X-Server on a windows machine.
First of all, download + install cygwin. When installing, be sure to select xauth package (it's not enabled by default, but important for the XForward process).
You may have to do some changes to your server configuration like the Cygwin FAQ says, but on the remote ubuntu machine XForwardTrusted was already set to yes.
Now open your cygwin console and type:
Now open yet another cygwin console and type:
where name is your username, example.org is your server name (or ip) and 12345 is the servers ssh port (default is 22, though).
The -Y (the capital Y is important) tries to connect with ForwardXTrusted, thats what we enabled some lines earlier.
You'll be right on the ssh server and can type xterm or whatever application you want to run. No extra configuration!
The best about all that, you don't have forward router ports or anything!




