Having a good time at lunch at an Irish pub in my hotel.
Category Archives: Uncategorized
RedMine due date with offset value
Another RedMine plugin of mine to automatically set the due date with a specified offset. So here is my github repo with the plugin necessary to fill in the due date for all projects. I have some plans to improve the plugin into being a module for custom project based settings. Perhaps some settings of setting the offset value in a field and a checkbox for making sure it falls on a weekday or not.
ColdFusion error message File Not Found
If you are staring at a error message produced by ColdFusion that reads “File Not Found” but you know the file is available from you Linux apache service, you would be having a similar day that I had last week. While searching around on the net, I found many many other posts that described this same problem, and their solutions where of no help. Most these articles talked about having the correct installation, disabling caching, or applied to an earlier version of ColdFusion, but I could not find any solution that applied to my situation:
I have many virtual hosts in Apache on a Linux server with two virtual hosts serving CFM files correctly from a ColFusion Multisite installation. But any new virtual hosts would produce the error “File not Found”.
This message is very deceiving, but I noticed that in the directory of:
/opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/
there is a CFM file, then the file is located. Bizarre! Anyways, the solution to this problem was really simple but I was thrown off by the error message. The solution is to make sure the ColdFusion user has executable rights on the directory being provided by Apache.
node.js how to pipe a output from child process into a webpage
This is a simple Node.js server that prints the output from a system command (in this example, its a tail program):
// how to pipe a output from child process into a webpage
// start with importing an http server
var http = require('http');
// import the spawn function
var spawn = require('child_process').spawn;
// create the server bound to port at bottom
http.createServer(function(request, response) {
// write the header with 200 okay with content-type
response.writeHead(200, {
'Content-Type': 'text/plain'
});
// everytime there is a new request, spawn an child process
var tail_child = spawn('tail', ['-f', '/var/log/system.log']);
// kill tail_child everytime the connection ends to keep from many processes being created
request.connection.on('end', function() {
tail_child.kill();
})
// observe the output by binding to the data event
//
// because javascript is not good at handling buffers, use the function for buffering data
tail_child.stdout.on('data', function(data) {
// write it on the console
console.log(data.toString());
// send it to the browser because the browser will be waiting for the next chunk of data
response.write(data);
});
}).listen(4000);
node.js hello world example with simple bootstrap
My first step into learning about Node.js and I here is my hello world example:
var http = require(‘http’)
http.createServer(function(request, response) {
console.log(‘new request’);
response.writeHead(200, {
‘Content-Type’: ‘text/plain’
});
response.end(‘Hello World!’);
}).listen(4000);