Adjust memory usage by using configuration options in SQL Server

Submitted by Jochus on Thu, 24/09/2015 - 21:19 | Posted in: Windows
Posted in

  • Open SQL Server Management Studio
  • Right click database server and choose Properties
  • Choose tab: Memory
  • By default, the value is set to 2147483647, which is the integer's max value. Adjust the Maximum/minimum server memory (in MB) to any number you would like

Rotating Apache HTTPD access.log and error.log on Windows

Submitted by Jochus on Thu, 24/09/2015 - 21:07 | Posted in: Windows
Posted in

By default, access requests, errors, and some other segmented data, is written into separate log files, which are not rotated by Apache.

These log files grow in size as new log data is appended with each additional access request made. And it’s left to the user to (once in a while) stop Apache, and rotate (i.e., rename) or delete the log files, so everything starts from size-zero again.

To automatically rotate a website's access.log (and other log files such as the error.log) every 24 hours (daily), Apache's included rotatelogs.exe tool can be used.

Example configuration:

ErrorLog "|bin/rotatelogs.exe -l #PATH_TO_ERROR_FILE%/errorlog.%Y-%m-%d.txt 86400"
CustomLog "|bin/rotatelogs.exe -l #PATH_TO_ACCESS_FILE%/accesslog.%Y-%m-%d.txt 86400" combinedtrueout_host

Enable and reset password of built-in Administrator user account on Windows 10

Submitted by Jochus on Sun, 13/09/2015 - 17:12 | Posted in: Windows
Posted in

  • Press the Windows + R keys to open the Run dialog, type lusrmgr.msc, and click/tap on OK.
  • In the left pane, click/tap on the Users folder, then in the middle pane, double click/tap on Administrator
  • To enable the built-in elevated "Administrator" account, uncheck the Account is disabled box, click/tap on OK.
  • To reset the password, right click the "Administrator" account and choose Reset password

Second RDP session can't open a Chrome window if first session runs Chrome already

Submitted by Jochus on Sun, 13/09/2015 - 17:07 | Posted in: Windows
Posted in

When opening multiple RDP sessions on a server (for the same credentials), the second RDP session was not able to open a Chrome window if the first session already fired up Chrome.

The problem is exactly that the two RDP sessions do not share the desktop although they are logged in with the same credentials. The desktop meaning not the "Desktop" folder but the logical entity in windows where the applications run. Therefore the instances running in both sessions can't see each other and the first one locks the profile for exclusive use which is critical to ensure no profile corruption can occur.

This problem has been discussed in the past and the best solution for this problem is to modify the startup link of Chrome to make sure every logged in user gets his own profile. this can be achieved using the --user-data-dir flag (or UserDataDir GPO policy). For example using this command line to start chrome will even guarantee that every client will reach the very same profile every time he/she logs in from the same client machine:

chrome.exe --user-data-dir=%LOCALAPPDATA%\Google\Chrome\%SessionName%

This will create unique folder for every user under the default profile location for Chrome. Right now there is no way to specify the client name variable in a policy therefore this particular example will work only as a command line flag.

Source: Chromium support issue #160676

Windows login form fields color black during startup

Submitted by Jochus on Sat, 12/09/2015 - 21:57 | Posted in: Windows
Posted in

I recently had a strange login issue when firing up an old Windows 2003 Server. When I wanted to login, the form fields were colored black (see screenshot on top). The text color was black. When you typed a letter, you could not see what exactly you were typing.

After Googling a while, I ended up on this article.


This issue occurs if all the values under the following registry subkey are set to "0 0 0":

HKEY_USERS\.Default\Control Panel\Colors


The correct colors

Value name Value data
ActiveBorder 212 208 200
ActiveTitle 10 36 106
AppWorkSpace 128 128 128
Background 102 111 116
ButtonAlternateFace 181 181 181
ButtonDkShadow 64 64 64
ButtonFace 212 208 200
ButtonHilight 255 255 255
ButtonLight 212 208 200
ButtonShadow 128 128 128
ButtonText 0 0 0
GradientActiveTitle 166 202 240
GradientInactiveTitle 192 192 192
GrayText 128 128 128
Hilight 10 36 106
HilightText 255 255 255
HotTrackingColor 0 0 128
InactiveBorder 212 208 200
InactiveTitle 128 128 128
InactiveTitleText 212 208 200
InfoText 0 0 0
InfoWindow 255 255 225
Menu 212 208 200
Menubar 212 208 200
MenuHilight 210 210 255
MenuText 0 0 0
Scrollbar 212 208 200
TitleText 255 255 255
Window 255 255 255
WindowFrame 0 0 0
WindowText 0 0 0

Apache HTTD 2.4: Invalid command ‘Order’, perhaps misspelled or defined by a module not included in the server configuration

Submitted by Jochus on Sat, 12/09/2015 - 20:16 | Posted in:

I recently upgraded one of my HTTPD severs from version 2.2 to 2.4. When I tried to start the Apache HTTPD daemon, I got the following exception:

Invalid command ‘Order’, perhaps misspelled or defined by a module not included in the server configuration failed

The problem was related to a change in the configuration specs of the "allow & deny rules". More info was found here. For a 2.4 configruation, you need to enable the following modules to be able to work with "authentication":

LoadModule access_compat_module modules/
LoadModule authz_host_module modules/

Apache HTTD 2.4: AH01630: client denied by server configuration

Submitted by Jochus on Sat, 12/09/2015 - 20:13 | Posted in: Linux
Posted in

I recently upgraded one of my HTTPD severs from version 2.2 to 2.4. When I tried to start the Apache HTTPD daemon, I got the following exception:

AH01630: client denied by server configuration

The problem was related to a change in the configuration specs of the "allow & deny rules". More info was found here:

2.2 configuration:

Order deny,allow
Deny from all

2.4 configuration:

Require all denied

Enable Windows Photo Viewer to open image files in Windows 10

Submitted by Jochus on Sun, 16/08/2015 - 20:30 | Posted in: Windows
Posted in

I'm not really a fan of the app Photo Gallery. Until Windows 8.1, I was using Windows Photo Viewer. I recently upgraded to Windows 10 and I'm unable to open image files with the ancient Windows Photo Viewer.

The good news is - it is still in the operating system! Using a simple hack in the registry, I was able to open image files again with Windows Photo Viewer. Run the followig .reg file, it will create 2 new keys. Repeat the steps for other file formats (png, gif, ...)

Windows Registry Editor Version 5.00



Creating an interceptor which logs every entry/method call on an EJB

Submitted by Jochus on Tue, 11/08/2015 - 22:39 | Posted in: Java
Posted in

I needed to log all the calls to all methods made to a certain EJB (because I wanted to know which methods were called from which place). The reason was locks I received on a stateless session bean. I could use a debugger, but because I'm talking about a lot of functions and a lot of calls, I created a LogInterceptor:

package be.jochenhebbrecht.ejb.interceptor;
import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;
public class LogInterceptor{
	public Object intercept(InvocationContext context) throws Exception {
                // Log to console before executing method
		System.out.println("Entering method:" + context.getMethod().getName());
                // Execute method
		Object result = context.proceed();
                // Log to console after executing method
		System.out.println("Leaving method: " + context.getMethod().getName() );
		return result;

To use the interceptor, simply add the following code

package be.jochenhebbrecht.ejb;
import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
import be.jochenhebbrecht.ejb.interceptor.LogInterceptor;
public class SomeStatelessEJB{
	public String foo(String bar) {
            // Do something ...

Running Jaspersoft iReport Designer on Mac OS X with Java 7.0 (update 71-b14)

Submitted by Jochus on Mon, 10/08/2015 - 22:45 | Posted in: Mac
Posted in

  • Go to your applications folder /Applications
  • Right click on Jaspersoft iReport Designer and select Show package Contents
  • Navigate to /Contents/Resources/ireport/etc/ and open ireport.conf
  • Edit the default JDK location by changing the jdkhome property