Redirect naar primaire domein met .htaccess

Als je bijvoorbeeld een .com en .nl domein hebt gekoppeld hebt aan een hostingsaccount wil je dat men (en google) altijd naar het primaire domein wordt doorverwezen. In dit voorbeeld wordt de .com naar de .nl geredirect.

RewriteEngine On
RewriteCond %{HTTP_HOST} blaaaaaaat.com [NC]
RewriteRule ^(.*)$ http://blaaaaaaat.nl/$1 [L,R=301]

No Comments »

VMware 6.5.4 and Ubuntu vmnet compile problems and cursor flaw fix

VMware seems to go the Microsoft way of doing things; They create a flawed installer and no KB to fix this.
Fortunately there are some smart dudes who know their stuff and place it on the www. I was lazy to find out this time myself so this is some sort of "placeholder" for the next time when I run into this, or when VMware has sorted their stuff out with a new version, or fix.

Thanks to digital-scurf blog author; Sorry to copy this but this really makes sense. Short and clear:

I recently updated vmware on my desktop to workstation 6.5.4 having previously upgraded the machine to Ubuntu 10.04. This resulted in interesting issues so I thought I’d collate them all here.

1. vmware’s installer remains flawed wrt. output generated during module compile—to fix this, create a gcc wrapper script which removes the -W flags, e.g.

#!/usr/bin/python
import sys
import copy
import os
argv = copy.copy(sys.argv)
i = len(argv)
for i in range(i-1, 0, -1):
if len(argv[i]) > 4 and argv[i][:2] == "-W" and argv[i][3] != ",":
del argv[i]
argv[0] = "/usr/bin/gcc"
os.execv(argv[0], argv)

2. Pop that somewhere like /tmp/gcc and chmod +x it.
3. Run sudo env PATH=/tmp:$PATH sh /wherver/VMware-Installer.bundle
4. When the installer finishes, cd into /etc/vmware and add export VMWARE_USE_SHIPPED_GTK="force" to the bootstrap file. (This fixes the mouse-broken in fullscreen mode, two pointers visible, vmware losing grab blahblahblah problem)
5. cd into /usr/lib/vmware/modules/source
6. untar the vmci and vmnet tarballs
7. in vmci-only/include/pgtbl.h add compat_sched.h to the includes
8. in vmnet-only/vnetUserListener.c add compat_sched.h to the includes
9. tar those up again
10. run sudo vmware-modconfig—console—install-all
11. Assuming all is well, vmware will now work properly.

No Comments »

IE7 max tabindex problem #microsoft #fail

It took me an hour to debug some jquery in IE7. I was making a tab-navigation. When you click a tab it hides the content of the other tabs and shows the content of the clicked tab. Quite easy with jquery right? In all browsers except IE7 (I banned IE6 a long time ago..)

One of the tabs had a tabindex of 99999.
I added an alerts to display the value of tabindex attribute...
IE7 seems to have a max tabindex value of 16959!

Why? Only Bill Gates knows why....

No Comments »

FastCGI process exceeded configured activity timeout

I found the solution here: http://forums.iis.net/t/1076662.aspx

Here is how to set the configuration with IIS 7.0:

%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /[fullPath='C:\php\php-cgi.exe'].activityTimeout:600

You need to change the 'C:\php\php-cgi.exe' to the actual location PHP that you registered with IIS.

If you want to make double-check that the configuration worked properly, you can check it like this:

%windir%\system32\inetsrv\appcmd list config -section:system.webServer/fastCgi

No Comments »

How to change the DirectAdmin server IP address

#cd /usr/local/directadmin/scripts
#./ipswap.sh <oldip> <newip>

Now alle the directadmin config files are changed.
Now apache needs a restart to activate this.

No Comments »

IIS7 Impersonate PHP Fast-CGI as local user

The problem i had that i had to talk to a dll through COM on a windows server in PHP.
I needed to run the site as another user than the standard IURS.
I tried setting the identity of the application pool, no success.

Finaly i found the solution;

The (default) website advanced settings page has the option to specify the Physical Path Credentials.
I set this to a regular system account, and checked within PHP with:

echo get_current_user();

Everything worked!

No Comments »

SVN and Mac OSX hidden .DS_Store ._ .AppleDouble files

If you work on a mac (as i do) your directories get poluted with .DS_Store, ._ and .AppleDoubel files. Apple (this is THE missing Finder feature!) has no option to turn this crap off.
Now when you use svn, you will also import all these useless files.

Thank god there is a option in svn to globally ignore specific files.
Just edit the file:

~/subversion/config

Find the line global-ignores, uncomment it and make it something like this:

global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .AppleDouble ._*

Whoot!

No Comments »

Iptables active and passive FTP in CentOS

This is how to make sure active AND passive FTP work flawlessly with IPtables, in this case, on CentOS. In this case it was for a DirectAdmin server.
You have to look up in your ftpd config which passive FTP ports your daemon uses and use those. In my case the portrange was 35000-35999.

This is /etc/sysconfig/iptables

# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#active and passiev ftp
-A RH-Firewall-1-INPUT -p tcp --syn --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp --syn --dport 20 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp --syn --dport 35000:35999 -j ACCEPT

#ssh only for me
-A RH-Firewall-1-INPUT -s 1.2.3.4 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

#other useful ports available to the public
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 110 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 2222 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT

Now we have to make sure some iptables modules are loaded.
Edit /etc/sysconfig/iptables-config
Make sure this line is looking like this:

IPTABLES_MODULES="ip_conntrack_netbios_ns ip_nat_ftp ip_conntrack_ftp"

Restart your iptables and test your ftp connection. It should work as expected.

2 Comments »

sprint_r PHP function

 
<?php
function sprint_r($v) {
	ob_start();
	print_r($v);
	return ob_get_clean();
}
?>
 

1 Comment »

TSVNCache.exe throws your computer to it’s knees!

If you ever used tortoiseSVN on a windows PC you might have had the same problems.
After some time your system becomes so slow you're about to throw it out of the window!

After some digging around I found out the one and only cause for this slowness is TSVNCache.exe! It consumes ALL resources somehow.

The solution is simple, just search for this file on your C: drive and rename it to TSVNCrap.exe.

Your computer will be lightning fast again!

No Comments »

Next »