wouters-frederik-blog-blog
wouters-frederik-blog-blog
drupal-sensei
48 posts
Failure is the key to success.
Don't wanna be here? Send us removal request.
wouters-frederik-blog-blog · 11 years ago
Text
Car watches your eyes, so you dont fall asleep
I have a product idea i need to tell
  Problem
one of the biggest causes in traffic accidents is sleep deprivation  http://voices.yahoo.com/5-most-common-causes-car-accidents-4947668.html
Solution
An Eye (camera + IR camera) that watches the driver by looking at its face and detecting if eyes are opened. (see http://www.visagetechnologies.com/html5/ ) . If your ayes are closed, a notification sounds loudly. Possible addition: Heart rate sensor in the steering wheelso when it drops(you fall asleep) the system is notified as well.
Technically this seems a pretty simple device to build. If the insurance companies cooperate (cheaper insurance when using this device) This should be a financially viable product. 
0 notes
wouters-frederik-blog-blog · 13 years ago
Text
Follow me on twitter
https://twitter.com/drupal_sensei
0 notes
wouters-frederik-blog-blog · 14 years ago
Text
Drupal 7 Imagecache and CDN on lighty
The solution to fix your problems after installing the CDN module and having imagecaches not generated.
Our setup is the following:
1 Varnish (cache and loadbalancer)
2 webservers (loadbalanced) running Apache
2 static servers (loadbalanced) running Lightppd
We installed the CDN module to have all the static content rewritten to the static servers.
We configured it like so: 
Origin Pull
http://OURSTATICDOMAINS
Whitelist 
sites/*/files/*png
sites/*/files/*webm
sites/*/files/*f4v
sites/*/files/*jpg
sites/*/files/*jpeg
sites/*/files/*ogv
sites/*/files/*flv
sites/*/files/*gif 
It rewrites all images to the static server.
Which is Great.
But imagecaches stopped working because the static server didnt generate images like the drupal server can.
The solution to this problem consist in a LUA.
At first edit  /etc/lighttpd/lighttpd.conf.
Enable in server.modules the
mod_magnet
Add the following line
The path is the path to your images on the static server
  magnet.attract-physical-path-to = ( "/var/www/lighttpd/rewrite_drupal.lua" )
In the file /var/www/lighttpd/rewrite_drupal.lua add the following config:
Change DRUPALDOMAIN by the domain of your actual drupal server (not the static domain).
This will allow your drupal to generate imagecaches one time.
The next request (or after a sync) the images will be on the static server and it will not redirect back, but immmediately serve the images.
attr = lighty.stat(lighty.env['physical.path'])if (not attr) then  lighty.header["Location"] = "http://DRUPALDOMAIN"  .. lighty.env["request.uri"]  return 302end
Have Fun!
21 notes · View notes
wouters-frederik-blog-blog · 14 years ago
Text
Status.php for Drupal 7 on varnish (steroids)
There was a status.php pahe for drupal 6 and varnish...
Well now there is one for drupal 7 too:
Use the following backend declaration for varnish:
backend web1 {   .host = "MYWEBSERVER";   .port = "80";   # timeouts hide the 503 servers, so the grace objects take over   .connect_timeout = 600s;   .first_byte_timeout = 600s;   .between_bytes_timeout = 600s;   .probe = { .url = "/status.php";             .interval = 5s;             .timeout = 1s;             .window = 5;             .threshold = 3; } }
And use the following status.php page:
(I know there is room for improvement but it works)
<?php // Register our shutdown function so that no other shutdown functions run before this one. // This shutdown function calls exit(), immediately short-circuiting any other shutdown functions, // such as those registered by the devel.module for statistics. define('DRUPAL_ROOT', getcwd()); register_shutdown_function('status_shutdown'); function status_shutdown() {   exit(); } // Drupal bootstrap. require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE); // Build up our list of errors. $errors = array(); // Check that the main database is active. $account = db_select('users','u')         ->fields('u')         ->condition('uid',1,'=')         ->execute()         ->fetchObject(); if (!$account->uid == 1) {   $errors[] = 'Master database not responding.'; } // Check that the slave database is active. if (function_exists('db_query_slave')) {   $result = db_query_slave('SELECT * FROM {users} WHERE uid = 1');   $account = db_fetch_object($result);   if (!$account->uid == 1) {     $errors[] = 'Slave database not responding.';   } } // Check that all memcache instances are running on this server. if (isset($conf['cache_inc'])) {   foreach ($conf['memcache_servers'] as $address => $bin) {     list($ip, $port) = explode(':', $address);     if (!memcache_connect($ip, $port)) {       $errors[] = 'Memcache bin <em>' . $bin . '</em> at address ' . $address . ' is not available.';     }   } } // Check that the files directory is operating properly. if ($test = tempnam(variable_get('file_directory_path', conf_path() .'/files'), 'status_check_')) {   // Uncomment to check if files are saved in the correct server directory.   //if (!strpos($test, '/mnt/nfs') === 0) {   //  $errors[] = 'Files are not being saved in the NFS mount under /mnt/nfs.';   //}   if (!unlink($test)) {     $errors[] = 'Could not delete newly create files in the files directory.';   } } else {   $errors[] = 'Could not create temporary file in the files directory.'; } // Print all errors. if ($errors) {   $errors[] = 'Errors on this server will cause it to be removed from the load balancer.';   header('HTTP/1.1 500 Internal Server Error');   print implode("<br />\n", $errors); } else {   // Split up this message, to prevent the remote chance of monitoring software   // reading the source code if mod_php fails and then matching the string.   print 'CONGRATULATIONS' . ' 200'; } // Exit immediately, note the shutdown function registered at the top of the file. exit();
4 notes · View notes
wouters-frederik-blog-blog · 14 years ago
Text
Colorpaper theme for drupal 7
Yup,  I converted it.
It's not perfect, but it works.
Download it here
http://itsok.be/colorpaper-theme-drupal-7
1 note · View note
wouters-frederik-blog-blog · 14 years ago
Text
soeasy.sodexo.be not so easy...
Ik wens graag het gebrek aan gebruiksvriendelijkheid op uw website aan te kaarten. Ik geef zelden negatieve feedback over sites, het is namelijk mijn eerste keer dat de frustraties zo zijn opgelopen..
Ik zal het concept van de site  http://zokanhetbeter.com/  toepassen, en voor elk probleem eenmogelijke oplossing suggereren. Hou er rekening mee dat ik zelf geen usability expert ben.
Probleemschets: Ik wil graag inloggen om prestaties te betalen.
Probleem 1: Ik kan mijn gebruikersnaam niet zelf instellen (gebeurde automatisch) en ben hem logischerwijs dus ook vergeten. Ook is hij nergens op de site (als u aangelogd bent) zichtbaar. Mogelijke oplossing: Laat een gebruiker zijn username zelf instellen of gebruik het emailadres.
Probleem 2: Het is op uw site niet mogelijk uw gebruikersnaam op email terug te vinden. http://soeasy.sodexo.be/espi_ms/framework/frameworkAnonymous.asp?parameter=H09&userName=
Hint: Voorzie een functie op de site waar je je gebruikersnaam kan terugzenden naar je emailadres.
  Probleem 3: In geen enkel van uw mails gebruikt u mijn gebruikersnaam, zodat ik op geen manier mijn gebruikersnaam kan terugvinden. Hint: Dit kan geen probleem zijn aangezien u andere gebruikersgegevens ook in de mail reeds gebruikt
Tumblr media
Ik klik vervolgens op help. Het gevolg is dat de site naar frans switched en de character encoding wegvalt.
Dit lijkt me eerder een technisch probleem
Na graven in mijn mails vind ik gelukkig de activatiemail met mijn username:
FREDEWOUTE
Mijn Naam is Frederik Wouters, FREDEWOUTE is uiteraard een logische gebruikersnaam (in some weird not for humans understandable way). Zelf instalbare usernames of logische opeenvolgingen zoals voornaam.achternaam of achternaam.voornaam zijn gemakkelijker te onthouden.
Na het doorlopen van de paswoord reset flow stoot ik bij het inloggen op volgende fout:
Microsoft VBScript runtime error '800a01a8'
Object required: 'm_oContext'
/espi_ms/framework/_include/context3.asp, line 122
Is het inloggen mislukt?
Even refreshen en kijken of het blijft?
msxml3.dll error '80004005'
The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.
/espi_ms/be/home.asp, line 552
Neen.
Als ik dan manueel de url http://soeasy.sodexo.be/espi_ms/ ingeef, kom ik op mijn sessie met mijn gebruikersmenu.
Ik moet op de site die me zonet twee paginablokkerende fouten gaf geld aan een persoon gaan toewijzen. Niet echt geruststellend. Men hecht blijkbaar niet zo veel belang aan de veiligheid van de site. Voorgaande fouten kunnen voorkomen worden lijkt me.
De table based design zullen we buiten beschouwing laten. Volgende link wil ik u toch niet onthouden: http://en.wikipedia.org/wiki/Tableless_web_design
Ik wil nu graag te weten komen op welk rekeningnummer ik geld moet gaan bijstorten zodat het op mijn rekening komt.
Ik klik op Hoe bestellen. In de hulptekst verwijst men naar de inschrijvingsmail.
Maak 7,50 € per dienstencheque over op de bankrekening vermeld in uw bevestiging van inschrijving.
Het klikken op de link opent een PDF lijst met banken en rekeningnummers. Het was iets interessanter geweest had men (hiervan had je wel een html tabel mogen maken) dit in de helptekst geplaatst. Dit is waar mensen naar op zoek gaan.
Rekening nummer KBC gevonden, ondertussen zijn we 30 minuten bezig. Spijtig da veel tijd is gekropen in het overbodige zoeken in mails.
Ok niet vergeten mijn accountnummer nu in te geven als gestructureerde mededeling.
Probleem 4 : De accountnummer online zit gevangen in een select box. Het is dus niet mogelijk zonder firebug het nummer te selecteren om te copieren in je overschrijving.
veel mensen gebruiken dit systeem, hier gaat volgens mij heel wat tijd verloren met onnodige opzoekwerk in een mail die uw systeem ooit heeft gestuurd met het nummertje dat in mijn neus bijt maar niet selecteerbaar is.
Oplossing:  Integreer online betalingen, deze lossen een stuk het probleem op met de mededelingen, Uw administratie zal u dankbaar zijn, er gaan minder mededelingloze (of foute) betalingen toekomen die zij moeten opzoeken en terugstorten. Het huidige systeem kan in werking blijven. Eerst moet er wel aan de veiligheid gesleuteld worden dan.
Hint:  Ga eens kijken in een CMS (bv drupal)
Het zijn vele kleintjes, maar ja vele kleintjes maken een grote he...
49 notes · View notes
wouters-frederik-blog-blog · 14 years ago
Photo
Tumblr media
Usability
0 notes
wouters-frederik-blog-blog · 14 years ago
Link
0 notes
wouters-frederik-blog-blog · 14 years ago
Link
0 notes
wouters-frederik-blog-blog · 14 years ago
Text
Webform select with existing nodes
If you want a dynamical selectbox/checkbox/radioboxes with existing nodes from your system, you should be using the webform_nodes_selector module.
It can be downloaded from here: http://drupal.org/node/1247350
It allows the creator of a webform to (without programming) let the users choose fron a specific contenttype in a webforma as a field.
0 notes
wouters-frederik-blog-blog · 14 years ago
Text
ALL DRUPAL PATHS are here
It does not always have to be difficult.
Doing this the drupal 7 way:
alctially it's quite simple:
the one you want is here :
debug(variable_get('file_public_path', conf_path() . '/files'));
All the others are below.
Drupal module path
drupal_get_path('module', $module_name);// user 'module' or 'theme'
returns sites/all/module/mymodule
Drupal base path
base_path();
returns /
Drupal files directory of the current site
debug(variable_get('file_public_path', conf_path() . '/files'));
returns sites/default/files
drupal_realpath('public://')
returns /Users/myuser/mysite/sites/default/files
Its not hard to get all drupal paths (programmatically) in one place.
they're here.
0 notes
wouters-frederik-blog-blog · 14 years ago
Quote
Information is like oxygen
http://blogs.tijd.be/tzine/2011/08/in-beeld-surfen-aan-lichtsnelheid-in-nederland-het-en-het-vk.html
0 notes
wouters-frederik-blog-blog · 14 years ago
Link
0 notes
wouters-frederik-blog-blog · 14 years ago
Link
0 notes
wouters-frederik-blog-blog · 14 years ago
Link
0 notes
wouters-frederik-blog-blog · 14 years ago
Text
Zend server default installation (snowleopard).
Tried to install drupal on this, got the following error in drupal:
PDOException: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 61 in lock_may_be_available() (line 164 of ../includes/lock.inc).
Hint : make sure your database host is set to localhost and NOT to 127.0.0.1 !
I was losing hours on this shitty problem. Start at the beginning, the settings file.
Stupid stupid stupid self
0 notes
wouters-frederik-blog-blog · 14 years ago
Text
Making a drupal 7 vcl? It doesn't work?
When running Drupal 7 behind a Varnish reverse proxy cache, make sure to include the following lines (suitably edited) in your settings.php:   # Tell Drupal it's behind a proxy $conf['reverse_proxy'] = TRUE; # Tell Drupal what addresses the proxy server(s) use $conf['reverse_proxy_addresses'] = array('127.0.0.1','192.168.0.2'); # Bypass Drupal bootstrap for anonymous users so that Drupal sets max-age > 0 $conf['page_cache_invoke_hooks'] = FALSE;
Without the last variable, anonymous users will get nodes/pages with the max-age=0 and the proxy won’t cache it. Setting it to false allows the node to be sent with the max-age set to the cache lifetime set in the admin UI.
0 notes