Al enige tijd maakt de huidige mediaspeler te veel geluid. Met een leeftijd van bijna 5 jaar en dag en nacht aanstaan is dat ook niet zo heel gek.
Continue reading
Author Archives: Martijn
Het genot van thuiswerken
Iedereen heeft er wel eens van gehoord. Mensen die thuiswerken of werken conform ‘het nieuwe werken’.
Niet voor iedereen weg gelegd en vereist een zekere discipline. Zeker als je van uit huis werkt.
Tussen twee locatie bezoeken vandaag had ik de mogelijkheid om in de tuin mijn email bij te werken.
Ook weleens een keer lekker!
I’m with stupid -> Spammer met niet werkende linkjes…
Soms vraag je jezelf af, waarom al die bergen spam worden verstuurd.
Menig partij investeert in een goede oplossing om al die onzin buiten de deur te houden. Echter eens in de zoveel tijd schiet een spam-email wel eens door het filter heen.
Zo ook vandaag, een email dat ik Adobe CS4 zou hebben aangekocht.
Maar als je dan echt mensen naar je malware wilt trekken. Zorg dan dat het linkje werkt… 😉
Pre-course Cisco Certified Design Associate (CCDA) Assessment Results
Just did a pre-course assessment for my next certification track. I am aiming on the Cisco Certified Design Associate as it is for now the most relevant certification in my job-area.
Below my personal results. Cisco partners can do their own free pre-course assessment through the Partner Education Center (PEC).
| Student Name: Martijn Total # Assessment Questions: 78 Total # Questions Answered: 78 Total # Questions Correct: 51 Overall Score: 65.4% Scores By Unit: Applying a Methodology to Network Design Structuring and Modularizing the Network Designing Basic Campus-Switched Networks Designing an Enterprise WAN Designing IP Addressing for the Network Selecting Routing Protocols for a Network Evaluating Security Solutions for the Network Designing Networks for Voice Transport Applying Basic Network Management Design
|
CCDA is a complete different area next to CCNA…
CCNA Certified (Again)
Last friday i went to a local Pearson VUE Testing center. In the past i was CCNA certified, but due to various reasons i had let my certification expire. Quiet stupid if you ask me.
So I had signed me up for the Cisco Certified Network Associate-exam (640-802) again. With a good feeling i went to the testing center. And as expect i passed for my CCNA exam. A score of 907 out of 1000 isn’t that bad at all.
Setting environment variables for your Magento store through .htaccess
Once in a while i get the question, Martijn how can we select a storeview without editting the index.php file, as Magento is prepared for this?!
Well, the Magento index.php file is indeed prepared for this. The full Magento index.php for releases 1.4.2.0 and later is as below.
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
if (version_compare(phpversion(), '5.2.0', '<')===true) {
echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
exit;
}
/**
* Error reporting
*/
error_reporting(E_ALL | E_STRICT);
/**
* Compilation includes configuration file
*/
$compilerConfig = 'includes/config.php';
if (file_exists($compilerConfig)) {
include $compilerConfig;
}
$mageFilename = 'app/Mage.php';
$maintenanceFile = 'maintenance.flag';
if (!file_exists($mageFilename)) {
if (is_dir('downloader')) {
header("Location: downloader");
} else {
echo $mageFilename." was not found";
}
exit;
}
if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
require_once $mageFilename;
#Varien_Profiler::enable();
if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}
#ini_set('display_errors', 1);
umask(0);
/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Mage::run($mageRunCode, $mageRunType);
On lines 66 you will find a conditional test that would allow you to turn on the Magento Developer-mode. On lines 75 and 78 you will see how the $mageRunCode and $mageRunType is populated by server values.
All three values can be set from the .htaccess files or vhost configurations of your server with the code below.
### Setting environment variables for your Magento store. SetEnvIf Remote_Addr "your.ip.address.here" MAGE_IS_DEVELOPER_MODE=TRUE SetEnvIf Host "your.domain.here" MAGE_RUN_CODE=storeview_code ### Next line is important for multi language stores on the same domain. ### When running multiple languages on one domain, the storeview code is ### stored in the frontend cookie. Without this line, your store would ### default back to the storeview set above SetEnvIfNoCase ^Cookie$ "frontend=(.+)" MAGE_RUN_CODE=
With the code at line 2, you can turn on the developer mode for only the specified ip address. The code at line 3 allows you to set a specific storeview-code to be used while executing the Magento web-app.
However, setting always a specific storeview-code is a bad idea. In multilingual stores you could make it default back to the default language all the time. Therefor i recommend not to set a storeview if a cookie is set with a frontend-id.
I hope this is useful for all the Magento Developers out there. If you like my articles, please spread the word using the Tweet button or the Facebook-‘Recommend’-button.
By the way, don’t forget that Magento redirects by default to your base url. So be aware that you need to set this storeview url for a second store in the General Web section of the System config
Magento Currency Importer
Recently I walked in to a new challenge. A customer needed to import the exchange rates provided by the European Central Bank (ECB).
As each Magento store builder knows, Magento only works with one webservice by default and that one is www.webservicex.net.
On the Magento website their is a wiki-page written about how to extend and implement Yahoo Finance, but the guide is pretty broken. And as I needed the rates from the ECB, I decided to build this in to a small module which I also would release on Magento Connect.
My Currency Importer can be found in the Magento Connect database. I would appreciate a positive feedback if it works for you. If things don’t work, please contact me by leaving a message on Connect or below in the comments (if still open).
The Currency Importer allows you to use ECB or Yahoo Finance for now. ECB has a limited exchange rate set.
Magento Sample Module
Recently on Freenode someone asked me wether i have a small sample module of a Magento module. Attached you can find an older (1.4.x.x) Sample module with the directory structure of a Magento module.
The required module.xml and config.xml’s are present. Extend where needed with your own setup scripts and classes.
Hackers (According to Stock Photo Sites)
I found this funny page.
You always wonder why media and magazines come up with pictures of ‘types’ that never get close to how the real figures look like.
On SadAndUseles.com I found: “Hackers (According to Stock Photo Sites)”
http://www.sadanduseless.com/2011/12/stock-photo-hackers/
Let Spamassassin learn about not recognised spam
Below there is a chart of email processing on my server.
I process statistics every 5 minutes, So above image will tell you that i get about 4 real emails every 5 minutes. I have about 203 emails every 5 minutes that do not comply with email rules (invalid sender, SPF checks fail, etc) About 24 emails get rejected based on recipient rules (specific rules for one of my mailboxes).
And only 1 email every 5 minutes that would be accepted was recognised as spam. Considering the fact that i get multiple messages per day in my mailbox that should be considered as spam i decided that it is time to train spamassassin again.
Training SpamAssassin is quite easy aslong as you follow some rules and are willing to automate this task. As my server works with DirectAdmin I followed the Knowledge Base article on How to create a cronjob to use sa-learn to teach spamassassin – Maildir



