bloginfo('name');

bloginfo('description');

Archives Posts

No access for unloved business partners

Januar 21st, 2009 by Blu:RayNe

Corporate Wars. No, i don’t wanna give you access to my website (even if that means denying all iPhone users). Only problem on this .htaccess: it still throws HTTP 403 but and noaccess.html tells him about maintainence work on the website. Anyway, Noobs won’t recognize that.

# No access for this wannbe elitist
Order allow,deny
Deny from 217.7.144.10 # Business Static IP
Deny from 80.154.24.18 # Home Static IP
Allow from all

<Files ~ "(js|jpg|css|jpg|png)$">
    Allow from all
</Files&gt:

# Catch iPhone-users
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} .*Mobile.*Safari
RewriteCond %{REQUEST_URI} !(js|jpg|css|jpg|png)
RewriteRule ^(.*)$ noaccess.html [L]
Filed under Allgemein having No Comments »

Archives Posts

VAMP – Apache, MySQL and PHP in a Virtual Box (sponsered by Sun)

Januar 20th, 2009 by Blu:RayNe

Coworkers. A horror! They demand everything to be easy. And then they array with questions about XAMPP (especially WAMP), and why windows has path problems or why sendmail doesn’t work on Windows and so forth. But I don’t do bloody support on Windows!

Nothing is better than a real linux or unix. Windows just can’t do the job! So we’re here to provide two alternative solutions: andLinux or a real Linux inside a VM as WAMP replacement.

andLinux runs smoothly here, but everything I hear around is, that it doesn’t run smooth elsewhere. So, it’s probably better to check out some VMs…

So, open the curtain for…

VAMP – Virtual Apache MySQL, PHP (and Perl)

VAMPI had another good time today trying Sun’s VirtualBox with install of Ubuntu-install with KDE 4.1 (oh gawdamnit –  or bloated than Windows Vista!), than with XFCE (still no file shares in the filemanger?) and then again with good old GNOME ;) But still i had a hard time explaining the Admin-GUIs of Apache, BIND and so forth to my collegues. WAMP was still easier too use – a yeah :(

So my goal so far is to set up a VirtualBox installation with an easy to use LAMP enivronment, based on some features of Sun’s VirtualBox (which indeed is faster than VMware):

  • You setup a transient folder within VirtualBox (a folder that is used on and  by your host OS as well as the VM the same time – no SAMBA fileserver!)
  • This transient folder is mounted into Linux by using the Virtual Box FS (vboxfs)
  • From there project homepages will be delivered.
  • So, we need a DNS server to provide the host a valid domain name.
  • And will use Apache dynamic virtual hosts to route the domain names to associated document root.
  • The VAMP-VM shows it’s IP address after boot, to insert for you as DNS server.
  • The user uses MySQL or SSH to administer the server and still can add other software just as needed.

Well, i started again with Debian, which suddenly grew from a 70MB HD image to over 900MB – just by installing PEAR, PHP5, MySQL, Perl, BIND9 and Apache2!  I don’t like the idea to install Linux XAMPP tarballs on the server either, but i expect the final HD image will have finaly  less than 100MB in compressed format…  well this is a good start for the VAMP-project ;)

Filed under Allgemein having No Comments »

Archives Posts

mod_rewrite and .htaccess: advanced tricks

Januar 20th, 2009 by Blu:RayNe

It’s actually called mod_rewrite and not .htaccess! If you want to do rewrite rules have, do yopurself a favor and have first a look at the Apache documentation:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond

Look inside varaible/what apache gets:

RewriteCond %{REQUEST_URI} !inside
RewriteRule ^(.+)$ %{THE_REQUEST} [C]
RewriteRule ^(.+)$ /inside:$1/ [R,QSA]

…or …

RewriteCond %{REQUEST_URI} !SEE
RewriteCond %{THE_REQUEST} ^(.+)
RewriteRule ^(.+)$ /SEE:%1/ [R,QSA]

Replace THE_REQUEST with one of the variables presented here.

user1234.mystuff.de -› www.mystuff.de/account.php?user=user1234

RewriteCond %{http_host} !^www\.example\.com
RewriteCond %{http_host} ^(www\.)?(.+)\.example\.com
RewriteRule ^([0-9]+}/$ /account.php?user=%2&message=$1 [L]

Rewriting the fragment part of an URI or anker

Anyway, there is no way that you can user the fragmet part of the URI to rewrite your URL. It is internally stripped away by Apache. It’s not in REQUEST_URI nor in THE_REQUEST. You cannot use PHP nor Perl for that!

See also: http://www.tedpavlic.com/post_apache_rewriting_examples.php

UPDATE: Ah.. yeah… better look into the documentation again ;9 This could save you much time:

RewriteLog "/var/log/apache/rewrite.log"

Filed under Allgemein having No Comments »

Archives Posts

MSIE8 is not a modern web browser!

Januar 14th, 2009 by Blu:RayNe

Let’s have a look at what Microsoft promises us with MSIE8 – the revelation for all web developers! Nah, as developer you might have enough reasons to complain about that piece of broken software, or as i call it “the browser from hell”:

MSIE8 doesn’t have JavaScript. It has JScript and it isn’t as good as JavaScript. While others implement ECMAScript 4 or partly already have, Microsoft makes idiotic proposals for ECMAScript 3.2. And they even wonder why there’s so much heavy critics on it!

In native JavaScript i can extend all my objects. I can’t do that with XMLHTTPRequest because it’s not a native object, but links to an ActiveX-control instead.

Bullshiting the customer is one thing Microsoft can really do well. MSIE still has about 50% visits on our web sites. And about 40% of all MSIE users still use MSIE 6.0. It’s also great downloading a new VirtualPC test image all 3 months [as of summer 2007].

JScript in MSIE ist still pain in the ass. Probably it supports now some part of DOM – but it does not correctly.

Debugging JavaScript in MSIE ist still pain in the ass. I got enough enough errors in „line 0?, or the line of in the middle of nowhere where MSIE shows the line number in generated code. I even got an „Unexpected error in line -237322? once!

Debug tools do not always work correctly in MSIE because the browser doesn’t work correctly.

Then, on ACID3 most stabil browser do 50-60 points at the moment, Firefox 3 does 68 and Webkit does now 100 points! And what the fuck does MSIE8? Correct. 17 points out of 100. That’s 3 points more than MSIE7 but far below what other browser do at the moment.

MSIE8 does not pass ACID2! That’s because Microsoft has to load some ActiveX-Controls to pass. For the official ACID2-test site they deactivated the checks, on other sites you may encounter a warning that the site is not safe.  ACID2 has to be passed on whatever URL the test is!

Even PNG isn’t working correctly in MSIE and not to speak about SVG support…

Wheew, and then we have now 6 downloads per host. Great increasement over the 4 pipes in the older version.

Wikipedia lists some nice tables about comparison of layout engines, including HTML, XML, XHTML, Graphics, CSS, DOM, HTML5, ECMAScript and SVG-capabilities.

Well, at least they made one thing correct: MSIE8 still outputs Mozilla/4.0 in his UserAgent string. So i can say without any doubt, that it ia still not a modern web browser!

P.S.: Hey Microsoft, get Gecko or Webkit and just shut the fucking MSIE-Thing down! You will probably be faster in implementing the bugs of the former MSIEs than making your MSIE/Trident do run correctly. And if you haven’t realised there’s also a Gecko ActiveX-Control!

I wrote this article because i had an MSIE8 testdrive and now have three stylesheets for MSIE browsers. Ah yeah, the website runs without pages and even faster in really standard-compliant browser such as Opera, Safari, Firefox, Konquerer…

Archives Posts

SUBSTRING_COUNT() FOR MySQL

Januar 13th, 2009 by Blu:RayNe

Just as needed…

DROP FUNCTION IF EXISTS SUBSTRING_COUNT;
CREATE FUNCTION SUBSTRING_COUNT (haystack TEXT, needle VARCHAR(255)) RETURNS INT DETERMINISTIC
BEGIN
    RETURN LENGTH(haystack) – LENGTH(REPLACE(haystack, needle, ""));
END
Filed under Allgemein having 1 Comment »

Archives Posts

MSIE – Dante’s Inferno for Linux (or Web Developers)

Dezember 21st, 2008 by Blu:RayNe

ies4linux is a nice project that brings MSIE 5.0, 5.5, 6.0 and 7 to Linux under WINE.

Filed under Allgemein, Browser, Linux having No Comments »

Archives Posts

FLEX has a new AJAX competitor: SmartGWT

Dezember 3rd, 2008 by Blu:RayNe

smartgwt-main-boFirst, I’m really astonished! SmartGWT – GWT NextGen – is here…

  • is fully done in AJAX, has therefore all the possiblities of XML
  • and so also XHTML and all the browser capabilites
  • is faster then the great Ext.JS
  • offers an increadibly amount of interface widgets
  • keeps beeing fast after loading a couple of examples
  • is easier to use probably easier to use than FLEX
  • because everything is done via server side Java Code
  • and it is licensed under LGPL!

Congratulations! This will set new standards for AJAX driven web applications… we will see how it compares to GWT-EXT 2 ;)

Archives Posts

Mobile Spy: Die neueste Abzocke?

Dezember 3rd, 2008 by Blu:RayNe

„Orte deine Freunde …und schließ gleich für deren Handynummer einen Vertrag ab!“ So jedenfalls läßt das Kleingedruckte auf der Webseite vermuten.Und hiermit warne ich insbesondere meine Freunde, aber auch alle anderen diesen Service zu nutzen!

Dahinter steckt im Übrigen eine Bob Mobile Deutschland GmbH in Düsseldorf, die wohl denkt dass Dritte einen Vertrag für eine Person oder Handy abschließen können. Vielleicht ist dem auch so, möglicherweise benutzen sie einen anderen Trick. Auf jeden Fall riecht es stark nach Abzocke!

Filed under Allgemein having 7 Comments »

Archives Posts

Death to the iPhone! I love the iPhone!

Dezember 2nd, 2008 by Blu:RayNe

„This message was sent from my iPhone.“ How often do I have to read this crap?! Is it so cool to send an eMail from a mobile device? Don’t wonder if you read soemthing like „This message was not sent from an iPhone, but Thudnerbird E-Mail Client“.

The Simpsons sum up what i think about a Apple really well:

But no reason to be sad. Despite all usability gimmnicks on the iPhone, the iPhone Linux guys have now managed to boot Linux on the iPhone. So rescue is on it’s way ;)

And as you probably know i’m a fan of Google ANDROID:

  • I don’t need Mac OSX to develop applications for.
  • ANDROID is OpenSource, so if we don’t like the software we it take from Google and modify it
  • The project is as far i really can use the device (in oppiste to OpenMoko)

This blog post was not posted by an iPhone!

Filed under Allgemein, Netzwelt having No Comments »

Archives Posts

Replacing adding or adding nodes in SimpleXML

November 18th, 2008 by Blu:RayNe

You just can’t! Because you only communicate with SimpleXML by getter and setter methods. It’s possible there is another interface – anywsy i doubt it!

So, the magic of adding nodes is to convert from and to DOMDocument. The snippet below is just something stripped from sourcecode, so you get the idea how it works.

// This document is emtpy –  it just illustrates an example!
$this->xml = simple_xml_load();

// convert base document from simplexml to dom
$dom = dom_import_simplexml($xml)->ownerDocument;

// get our nodes
$newNode = dom_import_simplexml($this->character->xml);
$oldNode = $dom->getElementsByTagName(‘character’)->item(0);

// import replacement node into our working DOM and reassign it
$newNode = $dom->importNode($newNode,true);

// for example: replace the -element in our DOM
$oldNode->parentNode->replaceChild($newNode, $oldNode);

// convert it back
$this->xml = simplexml_import_dom($dom);

Damn ugly but that’s just the way it is! :(

Filed under Allgemein, PHP having No Comments »

« Previous Entries Next Entries »