Archive for » 2009 «

Montag, Dezember 28th, 2009 | Author: jean

Ich habe gestern zu meinem Geburtstag das Buch bekommen und bin recht begeistert. Der Author Bernhard Hennen hat es mal wieder geschafft ein ~900 Seitiges Buch zu bringen und mich an den Inhalt zu fesseln. Ich habe in letzter Zeit recht wenig gelesen, aber da ich die anderen Elfenbänder/Bücher aus seiner Feder (oder besser Schreibmaschine?) auch habe, musste das einfach sein – Ich glaube ich habe meinen ganzen Geburtstag gelesen, aber ich hatte eh nicht vor zu feiern :-)

Der Schreibstil ist eigentlich ganz Klasse, was mich manchmal ein bisschen stört ist das die Wortwahl hin und wieder nichtmehr auf dem hohen Niveau gehalten wird. Beispielsweise stört mich das Wort “Schiss” im Verlaufe des Buches (Nein, nicht das von “Angst haben”) – Bei einem Kentauren würde man sich über diese Wortwahl nur wenig wundern. Nunja.

Aber zum Buch:

more…

Category: Books  | One Comment
Freitag, Dezember 25th, 2009 | Author: jean

Well, i’m more or less new to video-encoding. I’m playing around with mencoder and other tools for some years, though i’m never gone into detail nor i tried to understand. This changed somehow in the past few weeks, thus i was reading everything again what i already read ago some years. This said you might know that there are a lot of information and websites about how to encode videos and video-editing in general. It’ll take you weeks to read all of them – Thus i wrote this little article, covering the information i’m interested in. It might or might not be helpful for you – For me it’s some sort of reminder :)
more…

Dienstag, September 15th, 2009 | Author: jean

The company i work for asked me to write a document about how to use DRBD and OCFS2 for MySQL Clustering as replacement for the MySQL NDB Stuff. This Document is nearly finished, however, today i talked with a friend, who’s working a lot with oracle databases and asked him what tests he would do to test the locking characteristics of the Filesystem. He told me this can be made using dd in 4 Tests:

  1. “dd if=/dev/zero of=/mnt/filename bs=100M count=100″ on Node1 on the Clusterfilesystem
  2. The same on the other node (Node2), the times should be equal.
  3. Two times (2x) the same on Node1, the time will break in
  4. Now on both nodes at the same time – The time should be higher, the higher the worse.

So, i did this checks on the System i’ve setup with DRBD and OCFS2, here are the results:
more…

Category: Linux  | 2 Comments
Montag, August 31st, 2009 | Author: jean

Hey,

ich hab von glako (danke!) nen’ acer aspire one bekommen, da habe ich mir jetzt erstmal Lunar Linux installiert, läuft ganz fein. aao2 Wobei ich anfangs schon etwas Probleme hatte bei der Installation. Aber das liegt eher daran das ich kein externes CD Rom bzw DVD Rom habe und somit leichte Probleme hatte irgendwas auf dem Teil zu installieren mangels Media. Wie auch immer. Rechts solltet ihr nen Screenshot sehen können.

Die Auflösung ist 1024x600px. Es läuft alles einwandfrei, bis auf die Grafikkarte. Manchmal wackelt das Bild, als ob es kurz nach rechts und links geht, als ob der Display sowas wie Autoadjustment macht. Wobei das wirklich nicht so häufig passiert, das passiert nur unter Last. Möglicherweise irgendwas, was ich falsch eingestellt habe, in der xorg.conf oder so.

Bin ich mir gerade nicht sicher. Mal sehen ich will demnächst mal sehen das ich Bluetooth einbaue, eine 1.8″ oder 2.5″ Festplatte, sowie die grünen Leds durch blaue austausche. Erstes sollte beides möglich sein, dafür habe ich schon Howtos gefunden. Bin etwas verwirrt was die SSD angeht – Dazu existiert ein Haufen an Informationen, Fakt ist einfach: Niemand kann sagen wann die SSD den Geist aufgibt, weil ich nicht einsehen kann (auch nicht mit smartctl) wieviele cycles die SSD schon hatte. Anders als Festplatten ist eine SSD limitiert – Hat eine SSD also maximal 100 000 write cycles – Hält Sie exakt 100 000 mal – beim 101 000 mal ist sie tot. Ganz einfach. Allerdings habe ich auch schon Hochrechnungen gesehen nach denen eine SSD 7-519 Jahre halten soll.. Also.. Nunja.

Whatever :-)

Category: Linux  | Leave a Comment
Mittwoch, Juli 15th, 2009 | Author: jean

A company i’m working for asked me to write a php script which is autoinstalling software like wordpress, gallery2, etc. I nearly finished that script, the only thing which is still missing is the “free-space” check. This is because it’s not simply just checking for the free space, in fact i have to check for quotas, if they exist, too. However, that was the reason why i played around with quotas.

First of all i enabled quota support in the Kernel. Then i added “usrquota,grpquota” to the options in /etc/fstab. After that i created the files quota.user and quota.group on / (which is the device i’m trying to work with quota on) and rebooted (-o remount was not working). Now back online i issued “quotacheck -avug” to the box and got:
more…

Category: Linux  | Leave a Comment
Montag, Juli 13th, 2009 | Author: jean

I guess there are quite a few libraries/classes for caching purposes around in the world wide web. However, back in 08′ i came up with a little class for caching purposes within PHP. Originally this file was part of a Content Management System i was writing at that time.

Features

  • Caching of Objects (Not only pages)
  • Setting of a timelimit for caching
  • Sha1Sum Checks (Prevents broken/modified cached objects)
  • Cached objects are stored as bz2

more…

Sonntag, Juli 12th, 2009 | Author: jean

Ago some months a friend asked me to write a little Tool which is fetching Keywords from a Website for further processing, like analyzing the keywords and having a “guess” what searchengines “may” see. Shame on me that i’ve been that late with that script, but well, here it is and it’s of course open source and freely available to everyone. By the way, i’m referring to keyword as for all found words in a document (html page) – Not just for meta-keywords.

The Script is simple, you’re just including it and feed it with a website uri:

array getKeywords ( string $uri , integer $min )
$uri is the URL
$min is a Integer which sets the amount of “repeats” of a keyword to be displayed. 2 is usually a good choice – 1 will display all.

Return an array containing all found keywords with a integer value “how often” the keyword was found

<?php

    include('getKeywords.php');
    var_dump(getKeywords($uri, 2));

?>

Another example usage

<?php

    include('getKeywords.php');

    $array = getKeywords($uri, 2);

    foreach($array as $keyword => $amount)
        echo $amount." - ".$keyword."";

?>

Of Course in both examples you have to set $uri to the page which should be checked. Sorry for the waiting time Chris. Finally… Here you go :-)

Download
The Script is available for download and is licensed under the GPLv3. You can download it from here (tar.bz2). or from here as .zip.

And now?
Well. You could use those Keywords and look in Google Trends or Keyword Suggestion Tools to optimize them a bit. You could also make sure that you don’t repeat words too much. Important words should be repeated (which does not mean writing 100 times “hello” will rank you the 1st with the search word 100). I just say: If the word “house” is repeated 3 times, it’s more important than a word which is only repeated 1 time.

Dienstag, Mai 26th, 2009 | Author: jean

Some “webdevelopers” are saying that they code their internetsites to be w3c-valid and that they dislike wysiwyg editors. Even if this Blog is for sure not w3c-valid i’m one of those guys. The question, as written in the topic, why valid html? Why should webdevelopers bother? How can it be used and who benefits from it?

Let’s start at the beginning: The w3c (world wide web consortium; w3 = w w w) is a Consortium which sets the standards for various techniques in the internet (world wide web); for example for HTML. HTML (Hyper Text Markup Language) is the language nearly every website is coded in. Usually people want to work with Standards and not against those, anyway, here are some links: w3c, HTML at the w3c and XHTML/XHTML2 at the w3c.
more…

Sonntag, März 15th, 2009 | Author: jean

Ich sollte mit Ajax eine kleine Live-Suche basteln.. Ich habe dafür jQuery genutzt (hat mich Till drauf aufmerksam gemacht) und muss ehrlich sagen jQuery ist total geil. Perfekt für solche Sachen. Ich habe mir spasseshalber zusätzlich dazu ein kleines Script gebastelt welches alle Wörter einer Website ausliest, so dass ich vielleicht eine Art Suchfunktion für Internetseiten umsetzen könnte. Die Wörter werden zwar (noch) nicht vernünftig nach Relevanz genutzt, dennoch ist die Suchfunktion brauchbar wie ich denke und relativ simpel.

Hier mal der Codeschnippsel. Man kann sicherlich noch einiges verbessern.

	header('Content-type: text/html; charset=utf-8');

	/**
	 * will fetch a website
	 * this function will fetch a website and return it
	 * so that its possible to do further processing on
	 * it.
	 *
	 * @param string $url url, should start with http://
	 * @return string html output
	 */
	function	getPage($url)
	{

		$ch = curl_init();

		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
		curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

		$output = curl_exec($ch);

		curl_close($ch);

		return $output;

	}

	/**
	 * will process the html content of a page
	 * this function will strip some stuff and make sure
	 * that you have all words seperated by whitespaces
	 * so that you can easily explode it into a array
	 * later.
	 *
	 * @param string $content html page content
	 * @return string $line stripped html content in one line
	 */
	function	stripContent($content)
	{

		// We add a space before < and after > because:
		// <p>foo>/p<>p<bar>/p<
		// would be foobar after strip_tags.
		$content	=	str_replace("< ",	" <",	$content);
		$content	=	str_replace(">",	"> ",	$content);

		// we strip all html tags
		$content	=	strip_tags($content);

		// let's decode htmlentities:
		$content = html_entity_decode($content, ENT_QUOTES, "UTF-8");

		// let's make everything lowercase
		$content = mb_strtolower($content, "UTF-8");

		// we replace some things with spaces, like:
		// one,two,three = one two three
		// hey!How are you = hey How are you
		$toreplace = array("\n", "\r", "\t", ",", ".", "!", "?", "\x0B", "\0");
		$line	=	str_replace($toreplace,	" ",	$content);

		//	First some spaces were added, now let's make sure
		// that we have only one space per maximum.
		$line = preg_replace("/\s+/m", " ", $line);

		// let's make sure that only a-z, äöüß and spaces
		// are around - Everything else is not useful as keys
		// for searching.
		$line = preg_replace("/[^a-züäöß\s]/isU", '', $line);

		return $line;

	}

	function	getWords($line)
	{

		$temp	= explode(" ",	$line);

		foreach($temp as $t)
		{

			// per word "processing"
			//$t = html_entity_decode($t, ENT_QUOTES, "UTF-8");
			//$t = preg_replace("/[^A-Za-züäöÖÄÜß]/isU", '', $t);

			if(is_int($t))
				continue;

			if(is_numeric($t))
				continue;

			if(strlen($t) < 4)
				continue;

			// word seems to be okay, let's create the array:
			if(isset($array[$t]))
			{
				$array[$t]++;
			} else {
				$array[$t] = 1;
			}

		}

		return $array;

	}

	var_dump(getWords(stripContent(getPage($_GET['url']))));
Samstag, Februar 21st, 2009 | Author: jean

Hat etwas gedauert, aber ich kam dazu mir kürzlich wieder ein paar Bücher zu kaufen. Darunter das Buch “Elfenlied” und “Elfenritter die Albenmark” vom Autor “Bernhard Hennen”. Freut mich schon, weil ich die Bücher von ihm recht gern mag und ja auch die anderen Bücher alle gelesen habe. Wer sich nicht erinnert oder meinen Blog zum ersten mal liest, hier sind noch 2 ältere Einträge dazu: Die Elfen, Elfenwinter, Elfenlicht nach den 3 Büchern ging es ja weiter mit der Reihe “Elfenritter” dort habe ich bisher aber nur ein Buch gehabt und mir jetzt das zweite gekauft. Ich werde den Part ergänzen sobald ich es gelesen habe…: Elfenritter – Und die Geschichte geht weiter.

Wie auch immer, nun zum Buch über welches dieser Eintrag eigentlich ist (Ruhig auf “mehr” klicken :P)

more…

Category: Books  | Leave a Comment