mod_log_slow is an apache module to provide measures of the time period used for handling each request by the current process. It is a little piece of software that I originated about 4 years ago. Last week I got a good news about it from Cyril Bouthors.
He made the Debian package of mod_log_slow and uploaded it into the official distribution. It will be available in the unstable distribution in the next few weeks after review and in the next Debian release. see Debian Bug report#696319. Also he made a Perl script that parses the log file produced by mod_log_slow and create a CSV file with totals – mod_log_slow-parser
In addition, a new viewsion, mod_log_slow-1.0.7 has been released. Thanks to Cyril, I fixed up GCC compile warnings.
Well, actually it was actively worked on during the year 2009 in which it was originated, but there had been no progress since then. It is quite a while…
Happy holiday!
LINKS
Posted in: Announcement, Programming
Tags: apache, module, mod_log_slow
There is no special reason but I’ve just started learning Chinese. Well, I am a big fan of Chinese food and personally I’ve been to China a couple of times. There must have been a potential desire for learning it. Here is a kind of tips for a beginner like me – “How to Type Chinese”.
First of all, go to System Preferences, then lick on the Language & Text icon. Click on “Chinese – Simplified” flag, and select “Pinyin – Simplified”.

Then you can select “Pinyin – Simplified” as you input language by hitting “Command + Space”. Just hit “Command + Space” until “Pinyin – Simplified” is selected.

Now you can type pinyin and see the corresponding characters popup. You can choose one of the characters by either typing space or the corresponding number. For exsample, let’s type this following pinyin. You’ll see the corresponding Simplified Chinese characters. That’s it!
Posted in: Environment Setup, Random Topics
Tags: chinese, lang, pinyin
About leaving the bottom button open on single breasted suit, there is the following great lessons by The Art of Manliness‘ Art of Manliness Suit School-Part III: A Primer on Suit Buttons:
1) One Button Suits: One button suits are the easiest to remember. The button should always be buttoned when standing and unfastened when one sits down.
2) Two Button Suits: Two button suits are also simple. The top button should remain buttoned, while the bottom button is left undone.
3) Three Button Suits: With three buttons, you have options. You can either button the top two and leave the bottom unfastened, or simply button the center button.
April. It is the season when new employees who wrap the body in a new suit overflow in the town. I often see that a young man buttons all buttons on single breasted suit without knowing the basic suit manners. Each time, I feel like teaching him how to button suit buttons. Yes I was like the young man when I was a new employee. On the other hand, it is every once in a while but there is a time when I see a man old enough to know the basic buttons all the buttons of single brested suits. I will not say anything about it.
Posted in: Random Topics
Tags: business, manner
If the following alert dialog message comes up while you’re running Hyper-V, you probably need to make some BIOS setting for virtualization.
The virtual machine could not be started because the hypervisor is not running. The following actions may help you resolve the problem:
1) Verify that the processor of the physical computer has a supported version of hardware-assisted virtualization.
2) Verify that hardware-assisted virtualization and hardware-assisted data execution protection are enabled in the BIOS of the physical computer. (If you edit the BIOS to enable either setting, you must turn off the power to the physical computer and then turn it back on. Restarting the physical computer is not sufficient.)
3) If you have made changes to the Boot Configuration Data store, review these changes to ensure that the hypervisor is configured to launch automatically.
In the case of Dell Precision T5400, the following 3 BIOS settings change need to be done:
- Security – Execute Disable: On
- Performance – Virtualization: On
- Performance – VT for Direct I/O Access: On
After the BIOS setup made, just choose “Save & Exit” in order to reflect the changes. Then try it again. you will be able to connect & start your Hyper-V Virtual Machine. Enjoy Hyper-V!
Environment Info: Hyper-V/Windows 2008 Server RC2 Enterprise/Dell Precision T5400
Posted in: Environment Setup
Tags: hyper-v, hypervisor, virtualization, win2008server
For those who want to play with Objective-C without having a mac (+ XCode IDE), GNUstep is the way to go. It enables you to develop programs in Objective-C on many platforms like *nix and even Windows. This time, I installed GNUstep on debian, and compiled and ran some Objective-C programs.
What’s GNUstep?
Probably you may know Apple’s Cocoa , Objective-C developmet frameworks(was known as NeXTSTEP many years ago). GNUstep is a GNU clone which not only is compatible with the Cocoa but also supports cross platform!
GNUstep provides a robust implementation of the AppKit and Foundation libraries as well as the development tools available on Cocoa, including Gorm (the InterfaceBuilder) and ProjectCenter (ProjectBuilder/Xcode). GNUstep currently supports Unix (GNU/Linux and GNU/HURD, Solaris, NetBSD, OpenBSD, FreeBSD, Darwin) and Windows. — GNUstep Overview –
Installing GNUstep on debian
First of all install the following 2 debian packages which are very fundamental for GNUstep development. The version of debian on which I tried it is 5.0.4.
- gnustep – The GNUstep Development Environment — user applications
- gnustep-devel – The GNUstep Development Environment — development tools
$ sudo apt-get install gnustep
$ sudo apt-get install gnustep-devel
If you are not debian user, find out GNUstep packages for the platforms you use from here.
Compiling Objective-C code with GNUstep
main.m
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString *noncap = @"how do you like wednesday?";
NSString *cap;
cap = [noncap capitalizedString];
NSLog(@"output = %@", cap);
[pool release];
return 0;
}
I coded a simple program above that captalize a string “how do you like wednesday?”. Now I want to compile it. But before that, make sure that gcc (>4.6) is installed on your platform. If not installed, just install it.
1. Compiling by executing gcc command line
gcc `gnustep-config --objc-flags` `gnustep-config --objc-libs` -lgnustep-base -o main main.m
gnustep-config is a usuful command that provides information on the current gnustep installation. gnustep-config’s –objc-flags option prints all the flags required to compile an ObjC file, and –objc-libs option prints all the flags required to link a GUI ObjC program.
$ gnustep-config --objc-flags
-MMD -MP -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1
-DGNUSTEP_BASE_LIBRARY=1 -D_REENTRANT -fPIC -g -Wall -DDEBUG -fno-omit-frame-pointer
-DGSWARN -DGSDIAGNOSE -Wno-import -g -fno-strict-aliasing -fexceptions
-fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -fgnu-runtime
-fconstant-string-class=NSConstantString -I. -I/home/kawasaki/GNUstep/Library/Headers
-I/usr/local/include/GNUstep -I/usr/include/GNUstep
$ gnustep-config --objc-libs
-rdynamic -shared-libgcc -fexceptions -fgnu-runtime
-L/home/kawasaki/GNUstep/Library/Libraries -L/usr/local/lib -L/usr/lib -lpthread -lobjc -lm
2. Compiling by Makefile, a little more sophisticated way
As a different way, you can create a Makefile for the program to compile. I created the following Makefile using examples from “A GNUstep Programming Tutorial”
GNUmakefile
GNUSTEP_MAKEFILES=$(shell gnustep-config --variable=GNUSTEP_MAKEFILES)
include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME=SampleCode
SampleCode_HEADERS =
SampleCode_OBJC_FILES = main.m
SampleCode_RESOURCE_FILES =
include $(GNUSTEP_MAKEFILES)/tool.make
After you compile it with either way, finally you can execute the compiled program. Its output will be like this:
2012-03-16 01:48:18.355 SampleCode[17756] output = How Do You Like Wednesday?
Enjoy Objective-C programming with GNUStep!
REFERENCES
Posted in: Programming
Tags: cocoa, debian, gcc, gnustep, mac, objective-c