Quicksearch |
Thursday, August 14. 2008
Perl hash tree helper Posted by Filip Van Raemdonck
in programming at
19:59
Comments (0) Trackbacks (0) Perl hash tree helper
Last week I needed a way of converting a two-dimensional array, in perl, into a tree-like datastructure.
While seemingly trivial, the convoluted use of references when passing around arrays and hashes between perl function calls -- recursive calls, in this case -- made this a mind-boggling exercise to me. (the fact that I hadn't seriously used perl in the last eight years might have had part in that, too) Below the jump is my implementation, debugging info left in and all. If it's useful for someone, that's great; if not, ... well, except for my mental sanity no harm was done in writing this, either :) Continue reading "Perl hash tree helper" Wednesday, March 26. 2008Lilo LVM fixed root
One annoyance with the lilo bootloader that I've ran into a few times recently, is that it apparently turns any
root configuration arguments into a device number. Which is then passed to the kernel at boot.So if the kernel decides to assign a different device number to the supposed root device, your system may no longer boot. Yesterday I once again ran into this: when I added an additional disk to a system, the LVM volumes which were on that new disk got assigned device numbers before the existing system LVM volumes. Giving the problem a little thought, I realized that the solution — though silly — is really simple: add an “ append="root=/dev/yournode"” directive to lilo.conf, and this boot-time argument will always override the root device set by lilo.No more changing root devices for me… Sunday, March 16. 2008Blog migration
For a while now I had been planning to move this blog a different server and URL; a URL that I would have full control over instead of the user directory it was deployed in.
I also had been longing for a different blog platform some time. While the primary reason for choosing Blosxom.PHP, that it did not depend on a database server, still held, I also had gotten tired of having to dig into it's code (usually in several places) for things that in my opinion should not require having to make changes all over the place. So when the ageing server that held the old blog had temporary IO problems last weekend, I considered the time ready for making the move. Continue reading "Blog migration" Wednesday, March 12. 2008
Debian firewire support Posted by Filip Van Raemdonck
in Debian at
07:07
Comments (0) Trackbacks (0) Debian firewire support
Christian, you forgot to mention the Linux kernel, where a member of the kernel team deliberately broke hardware support.
Thanks to Holger for these links, he has listed several more. I disagree with the suggestion that shipping the old firewire stack in the linux-extra-modules package is sufficient workaround; unless this is not prohibiting it from being included in the installer to support ethernet over firewire? (though in such case it will certainly have implications due to the fact that this package should be pulled in when the installer used eth1394) So Adrian, you too may want to reconsider if Debian really does have less compatibility regressions than other distributions. Friday, February 29. 2008
PyGTK/glade object reuse Posted by Filip Van Raemdonck
in Python at
12:29
Comments (2) Trackbacks (0) PyGTK/glade object reuse
Someone asked on the PyGTK mailinglist if it is possible to reuse certain parts of a libglade window several times within an application.
It certainly is, and it's not even hard to do! I've quickly written a demo application to show how it's done. The user interface designed in glade is really simple, a textbox with two toggle buttons underneath. Activating one button will display a second, disparate textbox beside the original one. Deactivating it will remove that second textarea. The other button will display and remove a copy of the first textbox which was there from application startup. The full widget tree of this interface is shown in the first screenshot. The actual code to the demo application is rather brief. Continue reading "PyGTK/glade object reuse" Monday, February 18. 2008
PHP and SSL with Lighttpd on Debian Etch Posted by Filip Van Raemdonck
in Web at
21:43
Comment (1) Trackback (1) PHP and SSL with Lighttpd on Debian Etch
First, a question: dear lazyweb, how do I completely disable non-SSL access with lighttpd? I can't seem to find how to have a lighttpd SSL-only configuration. (and only binding port 80 on localhost does not count for an answer)
On to the subject. While it's easy to add SSL to lighttpd and enable PHP (through fastcgi) — and Debian makes it even easier with it's lighty-enable-mod tool — if you only do it once in a blue moon then it's not exactly resident knowledge. So here are the steps to do it, on Debian Etch:
That's all there is to it. Well, strictly speaking there's a step 4a: install a certificate; but that's arguably not a part of the configuration process. (for reference: openssl req -new -x509 -keyout /etc/lighttpd/selfcert.pem -out /etc/lighttpd/selfcert.pem -days 365 -nodes will generate a self-signed certificate)
Wednesday, February 6. 2008
PyGTK exception handler Posted by Filip Van Raemdonck
in Python at
22:03
Comments (0) Trackbacks (0) PyGTK exception handler
A little utility that has been collecting dust on my harddrive over the past two years is an enhanced version of a PyGTK exception handling module that was originally posted to the PyGTK mailing list by Gustavo Carneiro. I've now uploaded it to the sysfs download area; it is essentially unlicensed, considered public domain by Gustavo according to his email message.
Besides fixing a API incompatibility with recent PyGTK releases, there are two main differences with the original functionality. First, I've modified the traceback formatting to include two lines of context to each line in the traceback, one before and one after the called line. Also included is a printout of the identifiers referenced in the traceback lines — variables, usually. On my personal wishlist was also syntax coloring in the debug window, but this was both non-trivial to implement, and it would likely add considerably to the complexity of the error handler, thus increasing the chances that the error handler itself would fail. The other main functionality change is possibility to email feedback to a predefined address — mainly meant for deployment and debugging of company-internal applications. To enable this feature, two identifiers feedback and smtphost must be set on the module. This can be either by modifying the code, or, better, by adding them after module import:import gtkexcepthook gtkexcepthook.feedback = 'valid@email.address.here' gtkexcepthook.smtphost = 'relay.smtp.hostname' Bugfixes, enhancements and feedback welcome at mechanix on rack66.net. Friday, February 1. 2008
Read between the lines Posted by Filip Van Raemdonck
in Microsoft at
22:58
Comments (0) Trackbacks (0) Read between the lines
Recently I've been debugging a SQL Server 2005 replication setup, where the "Distribution clean up" job for the distributor database was failing. The error message in the agent history was:
Executed as user: <sqlagent_serviceuser>. Could not remove directory <UNC_path_to_snapshot_directory>. Check the security context of xp_cmdshell and close other processes that may be accessing the directory. [SQLSTATE 42000] (Error 20015). The step failed. The “<sqlagent_serviceuser>” was the Windows user that the SQL Server Agent service was running under, while the “<UNC_path_to_snapshot_directory>” was the network path to the directory where snapshots where created. Looking around on some discussion forums, I found the same message reported several times but without any real solution; at least no solution that would work when I tried to apply it to this particular setup. Most answers to the problem focused on the xp_cmdshell procedure mentioned in the error, and how it would require certain configuration at the server end.However, one answer on the MSDN forums did give a useful clue — it pointed to the SQL Books Online article about Securing the Snapshot Folder (which I should've read right away, really). In a note, this page reads: If a publication is dropped, replication attempts to remove the snapshot folder under the security context of the SQL Server service account. [...] It's the SQL Server service account reference which is essential: even though the SQL Agent service account may be the one mentioned in the error message, the actual account that is used to try and delete the snapshot directories is the SQL Server service account instead. Giving that service account the necessary access rights fixed the problem; as in the Task Scheduler case, accurate error reporting on Microsoft's side might go a long way towards people disliking their software less. Tuesday, January 29. 2008Why globals suck
To the people looking for a way of converting from metres per seconds to metres per days: multiply your value by 86400 (60 for seconds in a minute, times 60 for minutes in an hour, times 24 for hours in a day).
One of the disadvantages of using dynamic web pages, is that you might end up serving pages (depending on how the application works) that basically say: "I can't find what you're looking for". Over the last hour I've kept half an eye onto the webserver logs for this weblog, and noticed that the Google crawler tried to index pages which simply aren't there, like for example an archive view for the year 2083. But the underlying PHP script happily returns a HTTP 200 status, with the message that filters don't match anything. Hardly useful. I also ran trough a large part of the site, checking if any page could refer to such 2083 archive, but haven't found any links to it. Which leaves me wonder why Google came to it. On faulty pages; for the last couple of days I've also been updating the script code to some extent, and through the log following of the server logs I noticed that some links were broken (and did not return 200 but 404 instead, or, in case of the comment code, made it impossible to post anything at all). Largely due to modification of a global in some code path, which variable was used later to build up these broken links. I think I've covered all faulty links; but if I oversaw any please let me know, I can be reached by email at mechanix on rack66.net. Tuesday, January 29. 2008
Task scheduler annoyances Posted by Filip Van Raemdonck
in Microsoft at
22:07
Comments (0) Trackback (1) Task scheduler annoyances
Apparently, the task scheduler in all Windows NT-derived versions up to (and including) Windows Server 2003 cannot run jobs under the "NT Authority\Network Service" security principal; "NT Authority\System" is the only so-called well-know security principal that can be used with it. Support for running tasks as "Network Service" or "Local Service" was only added in Task Scheduler 2.0, which is the version that ships with Vista and will be also included in Windows Server 2008.
Side note: I wonder why the link above, being a command reference for an administrative tool, is on the MSDN and not on the Technet site. Practical implication is that without being able to use the "Network Service" principal, a distinct network account (domain account or server account) is required for any job that needs to access any network resource. This also means keeping track of another account and password — and taking care of controlling and auditing it's access; whereas the "Network Service" principal cannot normally be used for interactive sessions. Annoyingly, the task scheduler UI also does not tell you that you can't if you try, but rather gives the un-helpful message "Access is denied. You do not have permission to perform the requested operation". The same message is also shown when, for a regular account, the password entered does not match the actual account password. (This happened to me because the keyboard layout on a remote desktop session turned out to be not what I thought it was) Anyone know if the error reporting has improved anything in the new task scheduler? |
about this blogThis weblog contains the ramblings of Filip Van Raemdonck. He is a male system administrator in his early thirties, happily married, and happens to be passionate about fast motorcycles and photography.
Syndicate This BlogArchives |
Comments
Mon, 18.08.2008 20:49 CEST
Congratulations!
Mon, 18.08.2008 09:07 CEST
oh my god, one very beautifull feeling.. I know on me :) The happiness! Ozgur
Thu, 03.07.2008 19:36 CEST
Everything's going great with the pregnancy. Only six weeks left now :) It's a hard tim e when you lose a baby, [...]
Tue, 01.07.2008 22:18 CEST
Robertsonian translocation how's thing turn out since las t Sept? I read your story abo ut the baby thing. I am [...]
Mon, 30.06.2008 14:36 CEST
I didn't know there were these kinds of exams. I am new to l inux and still don't know how to do barely anything in [...]
Sun, 06.04.2008 16:59 CEST
You're right, that not only so me, but many questions in the LPI are not up to date and tha t you probably don't use [...]
Fri, 04.04.2008 13:14 CEST
Sure, it does it's job fine (m ost of the time :). And it's straightforward. Why not us e it?
Thu, 27.03.2008 19:53 CET
You still use LILO?!
Thu, 27.03.2008 00:51 CET
Can't you use UUID-naming?
Tue, 18.03.2008 21:45 CET
If it were the old blog, it /m ight/ have been from some comm ent spam. Then again, I cou ldn't find any reference [...]