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 »

Problem checking out SVN repository to Samba share

I had a problem in OSX when i tried to check out a SVN repository to a samba share. I tried everything, setting force permissions etc.
Finally i found a post which solved my problem. All i needed to do is add this line to the smb.conf:

delete readonly = yes

See the original post here:

http://www.svnforum.org/2017/viewtopic.php?t=3980

No Comments »

Alternate PHP exec() function bypassing cmd.exe

I had a problem running executables (like identify.exe and convert.exe from ImageMagick) from php under windows using the exec() funciton. The solution provided by others was kind off stupid... Give full permisions on cmd.exe to IURS... Like you wanna do that.....
I wrote a exec() replacement function using the bypass_shell option proc_open has. It works great for me. Do your favour with it.

 
<?php
 
	function executeCommand($cmd) {
 
		if(DEBUG === true) {
			echo "Command: ".$cmd;
			echo "<br>";
			echo "Tempdir: ".TEMP_DIR;
			echo "<br>";
		}
 
		$descriptorspec = array(
		   0 => array("pipe", "r"),
		   1 => array("pipe", "w"),
		   2 => array("pipe", "w")
		);
 
		$process = proc_open(
				$cmd,
				$descriptorspec,
				$pipes,
				TEMP_DIR,
				NULL,
				array('bypass_shell' => TRUE)
		);
 
		if(!is_resource($process)) {
			return false;
		}
 
		if(!$pipes[1]) {
			if(DEBUG === true) {
				echo "No STDOUT<br>";
			}
			return false;
		}
		$output = stream_get_contents($pipes[1]);
		fclose($pipes[1]);
		$err = stream_get_contents($pipes[2]);
		fclose($pipes[2]);
 
		$x = proc_get_status($process);
 
		$return_value = proc_close($process);
 
		if($return_value == 0) {
			if(DEBUG === true) {
				echo "Return value {$return_value}<br>";
				print_r($x);
				echo "<br><br><br>";
			}
			return explode("\n", str_replace("\r", '', $output));
		} else {
			if(DEBUG === true) {
				echo "Return value {$return_value}<br>";
				print_r($x);
				echo "Output: ".$output;
				echo "Error: ".$err;
				echo "<br><br><br>";
			}
			return false;
		}
 
	}
?>
 

2 Comments »

Next »