Posted on March 29, 2006 - 07:16 in Uncategorized by steph1 Comment »

heute morgen kam wieder mal eine Anfrage bzgl. einer Programmierung ins Haus

Sehr geehrter Herr Jäkel,

wir wollen aus marketingtechnischen Gründen das Surfverhalten unserer Kunden im Premiumbereich der FM Seite protokollieren (die rechtliche Problematik bearbeitet derzeit unsere Rechtsabteilung).
Hierfür benötigen wir von Ihnen eine entsprechende Weboberfläche und die Einbindung der Protokollierung in jedes einzelne Modul.

Bitte übermitteln Sie uns den Termin der Fertigstellung und eine kurze Kostenübersicht.

Mit freundlichen Grüßen,

***

Schön, das auf einen gesetzt wird. .. und schön das die Kosten nebensächlich sind ;-) (so sind sie, die Marketingleute - Hauptsache viele Informationen über den [potentiellen] Kunden).
Nur tut sich da ein kleines Problem auf, ca 4/5 der Webseite bestehen aus Flashanimationen.

Mal schauen was ich da machen kann, ich habe aber schon eine Idee :-)

Einfach vom Flash beim Klicken auf ein Modul eine PHP Datei mit einigen Informationen (Sitzungs-ID, Modulname, Uhrzeit) via GET/POST aufrufen lassen. Für das Eröffnen einer Sitzung gibt’s dann noch einen Aufruf der nur den eingeloggten Benutzernamen übermittelt und eine Sitzungs-ID (die brauche ich für das Tracken der Sitzung - Auswertung pur) zurückliefert.
Ich muss nur hoffen, das der Flasher fähig ist und die GET-Aufrufe ausführen kann *gg*

Hm, ich sollte öfter über Anfragen und Probleme meiner Kunden bloggen - ich habe gerade aus dem nichts herraus das komplette Problem theoretisch gelöst. Das ist toll. Da kann ich mich ja direkt an’s entwickeln der Datenbank machen.. Das blogge ich aber nicht sondern machs direkt im DBWrench.

Beste Grüße,

Posted on December 9, 2005 - 01:05 in Uncategorized by stephNo Comments »

.. because a friend of mine wants to migrate his nameservers from powerdns to bind9, i wrote two really evil but working scripts to help him creating the zones from the database of powerdns..

the first is for the primary nameserver, it will create the zones available at the database and a file to include the zones into the named.conf

< ?
$serial = 2005120801;
$ttl = 604800;
$refresh = 28800;
$retry = 7200;
$min = 39600;
$dbh = "localhost";
$dbd = "powerdns";
$dbu = "powerdns";
$dbp = "";
$destdir = "./test";

mkdir($destdir, 0755);
mkdir($destdir."/zones", 0755);

mysql_connect($dbh, $dbu, $dbp);
mysql_select_db($dbd);

$domains = mysql_query("select id,name from domains");

while($dom = mysql_fetch_assoc($domains)) {
$zones[] = $dom[name];
unset($soa); unset($ns); unset($mx); unset($r); unset($cn);
unset($cnames); unset($arecords); unset($sdom_exists);
unset($ptr); unset($r6);

$zone = mysql_query("select * from records where domain_id=".$dom[id]);
while($row=mysql_fetch_assoc($zone))
switch($row[type]) {
case "SOA": $soa[] = array("domain"=>$row[name], “content”=>$row[content]); break;
case “NS”: $ns[] = array(”ns”=>$row[content]); break;
case “MX”: $mx[] = array(”name”=>$row[name], “mx”=>$row[content], “prio”=>$row[prio]); break;
case “A”: $r[] = array(”name”=>$row[name], “dest”=>$row[content]); break;
case “PTR”: $ptr[] = array(”name”=>$row[name], “dest”=>$row[content]); break;
case “AAAA”: $r6[] = array(”name”=>$row[name], “dest”=>$row[content]); break;
case “CNAME”: $cn[] = array(”name”=>$row[name], “dest”=>$row[content]); break;
}

$soa = $soa[0];
$domain = $soa[domain];
$content = explode(” “, $soa[content]);

$file = “\$TTL “.$ttl.”\n”;
$file .= “\$ORIGIN .\n”;
$file .= $domain.”\tIN SOA “.$content[0].”. “.$content[1].”. (\n\t\t”.$serial.”\n\t\t”.$refresh.”\n\t\t”.$retry.”\n\t\t”.$ttl.”\n\t\t”.$min.”\n\t\t)\n”;

foreach($ns as $nr)
$file .= “\t\tNS\t”.$nr[ns].”.\n”;

$file .= “\n”;

foreach($mx as $mr)
$file .= $mr[name].” \tMX\t”.$mr[prio].” “.$mr[mx].”.\n”;

$file .= “\n”;
$file .= “\$ORIGIN “.$domain.”.\n”;

foreach($cn as $cr) {
$subdom = explode($domain, $cr[name]);
$sdom = rtrim($subdom[0],”.”);
if ($sdom == “”) $sdom = “@”;
$cnames .= $sdom.” \t\tIN CNAME\t”.$cr[dest].”.\n”;
$sdom_exists[$sdom] = “true”;
}

foreach($r as $rr) {
$subdom = explode($domain, $rr[name]);
$sdom = rtrim($subdom[0],”.”);
if ($sdom == “”) $sdom = “@”;
if ($sdom_exists[$sdom] != “true”) $arecords .= $sdom.” \t\tIN A\t”.$rr[dest].”\n”;
}

foreach($r6 as $rr6) {
$subdom = explode($domain, $rr6[name]);
$sdom = rtrim($subdom[0],”.”);
if ($sdom == “”) $sdom = “@”;
if ($sdom_exists[$sdom] != “true”) $arecords .= $sdom.” \t\tIN AAAA\t”.$rr6[dest].”\n”;
}

$file .= $arecords;
$file .= $cnames;

foreach($ptr as $p) {
$subdom = explode($domain, $p[name]);
$sdom = rtrim($subdom[0],”.”);
if ($sdom == “”) $sdom = “@”;
if ($sdom_exists[$sdom] != “true”) $file .= $sdom.” \t\tIN PTR\t”.$p[dest].”.\n”;
}

$file .= “\n”;

$fp = fopen($destdir.”/zones/db.”.$domain, ‘w’);
fwrite($fp, $file);
fclose($fp);
}

$fp = fopen($destdir.”/named.zones.conf”, ‘w’);
$zonefile = “; zones to load\n\n”;
foreach($zones as $zone)
$zonefile .= “\nzone \”".$zone.”\” {\n\ttype master;\n\tfile \”zones/db.”.$zone.”\”;\n};\n”;
fwrite($fp, $zonefile);
fclose($fp);
?>

and the second one, for the slaves - creates just the file to include the zones into the slave bind9 (+ masterserver)..

< ?
$dbh = "localhost";
$dbd = "powerdns";
$dbu = "powerdns";
$dbp = "";
$destdir = "./test";
$master = "127.0.0.1";

mkdir($destdir, 0755);
mkdir($destdir."/zones", 0755);

mysql_connect($dbh, $dbu, $dbp);
mysql_select_db($dbd);

$domains = mysql_query("select id,name from domains");

while($dom = mysql_fetch_assoc($domains))
$zones[] = $dom[name];

$fp = fopen($destdir."/named.zones.conf", 'w');
$zonefile = "; zones to load\n\n";
foreach($zones as $zone)
$zonefile .= "\nzone \"".$zone."\" {\n\ttype slave;\n\tfile \"zones/db.".$zone."\"; masters { ".$master."; }; \n};\n";
fwrite($fp, $zonefile);
fclose($fp);
?>

Posted on December 7, 2005 - 22:50 in Uncategorized by stephNo Comments »

template.inc.php got a new function - subst_file, just to substitute a pattern using a file instead a string. can be really helpful i think..

lets see whats going on tomorrow at work - maybe there is some time to do something on epilancms.

ok.. one big think is missing at the moment, a development machine. currently i’m just develop the cms on my ibook but i dont want to do all alone - and there are some ppl who wanna help me - so..

well then, i wish u a nice evening.

……. listening to rem - man on the moon

Posted on October 29, 2005 - 20:29 in Uncategorized by stephNo Comments »

after fixing a bug in the userdata module of ispconf, i noticed that i cant really concentrate on the project now..
i will stop now forcing me to code for the project and start searching a free alternative to ecto.