Recente updates Wissel reactie discussies | Sneltoetsen

  • Reinoud 20:48 op 25 November 2013 Permalink | Beantwoorden
    Tags: Matlab   

    Installing the Matlab Runtime Environment on CentOS 6 

    I was having some trouble to get the Matlab Runtime Environment (MCR) 2012b running on CentOS 6.4. After downloading and extracting the ZIP archive from the Matlab website I received an error when trying to run the install shell-script.

    Installing ...
    ./install: line 705: /tmp/mathworks_28467/sys/java/jre/glnxa64/jre/bin/java: Access denied

    First thing I tried was modifying the install shell script to make the java-jre executable after copying. This didn’t help though, next thing I tried was disabling SELinux, no luck either. After that I modified the shell script and disabled the part that deleted the temporary directory so I had some more time for inspection. This showed that the permissions on the java executable where indeed in order. Well that’s odd ..

    The solution here was to use another temporary directory that was not under /tmp . You can specify an temporary directory to the installer by using the option -tmpdir.

    Two more things, because I was installing on a server VPS there was no X11 so I had to use -mode silent, which gave me an new error about accepting the license agreement. So all these problems solved at once:

    cd ~
    unzip -d mcr_unzipped
    mkdir tmp
    mcr_unzipped/install -tmpdir ~/tmp -mode silent -agreeToLicense yes
  • Reinoud 19:03 op 4 April 2013 Permalink | Beantwoorden  

    Time to make history 

    So, still using hashes for ajax navigation? Yeah me too. Well that isn’t really necessary any more. Since HTML5 is really mainstream these days it’s time to start taking advantage of window.history.pushState API, seems to agree with that. As you can see there is support for the latest version of all major browsers. For browsers that do not support the pushState API yet there is a beautiful JS library with fallback support to using hashes.

  • Reinoud 19:29 op 23 April 2012 Permalink | Beantwoorden  

    Thanks again Plesk 

    For the last few days I have been wondering why I couldn’t get the number of HTTPD processes down to the level I configured in httpd.conf . I looked every where, tried to figure out if I was using prefork.c or worker.c tried multiple values, tested the server under load using Apache Bench and so on and on.

    Still after multiple hours of testing, tweaking and changing values nothing seemd to change. Apache keeped spawining 25 to 30 processes which whould use 3 to 4 % memory each. Yes you can do the math that’s 90% just after 10 minutes of uptime. When using OpenVZ or Plesk it’s just waiting for a process to get killed becuase your VPS is hitting it’s memory limit.

    So, I looked further, enabled mod_info (great tool for debugging problems with Apache) and there it was. After hours of searching I was looking at the wrong config file. It seems that Plesk installs a file called swtun.conf in /etc/httpd/conf.d/ . This file gets loaded after the prefork.c settings in httpd.conf are set. So, logically it overrules the values in httpd.conf rendering it completly useless. Would have been handy if that was somehow documented somewhere  …

    Anyway, the values set in swtune.conf are pretty high for a small VPS. Adjusting them to about half of their defaults seems reasonable on non-highend VPSes.

    Thanks again for the quest Plesk, not for the first time you’ve taken a few of my evenings away searching for a tiny little configuration value.

  • Reinoud 22:02 op 1 February 2012 Permalink | Beantwoorden  

    Strange days, strange code 

    There is this big opensource blogging platform. It’s commonly used as a complete CMS solution to many websites. Even this site uses it. Yes, I’m talking about WordPress. Currently WordPress is hosting over 70 million websites. When you are talking about an ammount that massive you would say the source code by now woud look all tidy and neat. Well, I suggest you brace yourself.

    if ( !isset( $HTTP_RAW_POST_DATA ) ) {
     $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
    if ( isset($HTTP_RAW_POST_DATA) )

    Two things that stand out from the crowd here. The first is the space after $HTTP_RAW_POST_DATA in the first if-statement before the closing parenthesis. Of course, you have a lot of developers working on this. Different people have different habits. Things like this are impossible to prevent. At least, you would think. But wait, aren’t there solutions to this problem? Of course there are! PHP CodeSniffer for example. This tool analyses PHP-code based on a set of pre or user defined rules and gives back a report containing remarks about codestyle violations. It even chains with SVN’s pre commit hook, so rogue developers won’t be able to commit their code!

    Second thing is this: What the hell is the second if-statement about? After the first one there is no way that $HTTP_RAW_POST_DATA is not set. No way. Just not. It is not possible that the if-statement evaluates to false. It is always true. Always. If $HTTP_RAW_POST_DATA was not set before the first if-statement then it surely was after the first if-statement. That’s another wasted CPU cycle (on 70 million blogs) right there. Well, at least that didn’t type a space here.

    This is just one of the many examples of strange code in the WordPress source code. Don’t get me wrong, I love the application. It’s fast, easy to work with and handy to use. But there are a few things that are just a bit weird. Maybe it’s about time to shake of the weirdness when you are serving 70 million website. Thats all.

  • Reinoud 21:14 op 1 March 2011 Permalink | Beantwoorden

    Magento: Removing mandatory validation of telephone field 

    Searching the web for ways to remove the mandatory validation of the telephone field in Magento I found quite a lot results non of which actually worked with Magento ver. or up. The biggest problem seems to be to completely remove the validation and mandatory state of the telephone field throughout the whole Magento store. Some solutions fixed it in the checkout, some fixed the client side validation but not a single solution fixed it all.

    The final solution contains three steps which are:

    1. Remove client-side (javascript) validation

    If they not already exist within your theme copy the following files from the base/default theme to your theme:

    • template/customer/address/edit.phtml
    • template/checkout/onepage/shipping.phtml
    • template/checkout/onepage/billing.phtml

    In each of these files, look for the <input> that defines the telephone field and remove the required class from the label, remove the required-attribute class from the input and make sure to remove the *.

    2. Redefine the Mage_Customer_Model_Address_Abstract class

    Copy the file app/code/core/Mage/Customer/Model/Address/Abstract.php to app/code/local/Mage/Customer/Model/Address/Abstract.php . This ensures that upgrades will not break your modifications. Now open the file and look for the part where it validates the telephone field, it should look something like this:

    if (!Zend_Validate::is($this-&gt;getTelephone(), 'NotEmpty')) {
    $errors[] = $helper-&gt;__('Please enter the telephone number.');

    You can either completely remove this part or comment it out by placing it between /* and */ .

    3. Change the Customer EAV in the database

    Except for the validation we just removed in the abstract class Magento keeps a validation definition in it’s EAV tables. In the table customer_eav_attribute look for the row with id attribute_id 30 and clear the contents of the column validation_rules. Next in the table eav_attribute loo for the row with attribute_id 30 and make sure that the value of the column is_required is 0.

    Completing the above steps will effectively clear the validation and the mandatory state of the Telephone field.

    • Nikolas 16:41 op 4 mei 2011 Permalink | Beantwoorden

      Thanks for this, I had been looking for a way to remove the requirement from the admin for a along time now after having managed to get the frontend working without phone one my own.
      It seem that the db change for “customer_eav_attribute” is not required anymore (magento v1.4.1.1), matter of fact, that table doesn’t have a “validation_rules” column. Also in the “eav_attribute” table, the telephone entry was row 29 for me, but I guess one can simply search for phone to find it.. ;)

    • Matthias Balke 21:34 op 22 mei 2011 Permalink | Beantwoorden

      Thanks for this tutorial!
      I have only one problem: there is no attribute_id 30 in my customer_eav_attribute table. How can I identify the correct row?


      • Nick 01:48 op 27 mei 2011 Permalink | Beantwoorden

        I am using and found the table eav_attribute had it as attribute code 17. There was a required field that I changed from a 1 to a 0 and checkout worked great!

      • Magento Notes 10:31 op 25 augustus 2011 Permalink | Beantwoorden

        You can see app/code/core/Mage/Customer/sql/customer_setup/mysql4-data-upgrade- or other mysql.php file
        find ‘sort_order’, and
        In datebase table ‘customer_eav_attribute’ , you can search ‘attribute_id’ by ‘sort_order’

    • Chris S. 07:03 op 12 september 2011 Permalink | Beantwoorden

      I have performed all these steps and I am still getting a pop-up that states “Please enter the telephone number.” Can someone please help me with this. I am running Magento 1.4.

    • john 10:27 op 7 mei 2012 Permalink | Beantwoorden

      Attempting this in Magento is a straight *fail* I’ve been pestering every possible sollution i’ve found online and none seem to remove the input boxes and validation.

      Anybody with a good sollution for the new magento?

    • Erma 17:24 op 2 augustus 2012 Permalink | Beantwoorden

      I tried it on 1.5.0 and ist not working.
      Thanks for help

    • Robby 18:19 op 2 oktober 2012 Permalink | Beantwoorden


      change in file /app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php

      $contactInfoFieldset->addField(‘telephone’, ‘text’, array(
      ‘label’ => $this->__(‘Telephone’),
      ‘required’ => ‘true’,
      ‘value’ => isset($telephone) ? $telephone : ”


      $contactInfoFieldset->addField(‘telephone’, ‘text’, array(
      ‘label’ => $this->__(‘Telephone’),
      ‘value’ => isset($telephone) ? $telephone : ”

      this work for me after i doing step 1 & 2 of this tutorial. Magento 1.7.

    • Thomas 09:14 op 25 januari 2013 Permalink | Beantwoorden

      Hi, i’ve done all the described steps (Magento 1,7) and as some of you i still get the popup ‘Please enter the telephone number’. The same with the region, which isn’t necessary in germany. Any ideas or solutions to that?

    • Thomas 09:06 op 29 januari 2013 Permalink | Beantwoorden

      Addition to my comment from a few days before: on the system I made the above described changes I had the compilation acvtivetd. After changing the file template/persitent/checkout/onepage/billing.phtml and recompiling Magento (System > Tools) everything works fine.

    • Hugo 14:36 op 26 april 2013 Permalink | Beantwoorden

      In the latest version of magento you have to edit the files in the persistant folder to edit the register fields in the onepage checkout etc.:

    • Mike 13:59 op 10 juni 2013 Permalink | Beantwoorden

      This can be done easily by editing:

      Just replace the phone input field with:

      A hidden field will be posted so you don’t have to remove things in code like validation.

  • Reinoud 14:57 op 13 February 2011 Permalink | Beantwoorden
    Tags: load-average, performance   

    The load average: A (very) short explanation 

    Every server-admin is familiar with the situation: Your servers load is flaky but you don’t see any processes eating your CPU capacity, at least not constantly. What is going on? Probably the first thing you do is Google. And yes, you will find lot’s of articles explaining you that what the number means. They will all tell you that it represents the average number of processes in the run-queue over a certain period of time.

    You will learn that the health of the number is determined by the number of cores in your system. For every core the load should be 1 or lower in order to considered to be healthy. So when you have a quad-core processor with a load of 3 that should not necessarily pose to be a problem. I am explicitly putting in the word necessarily in the previous sentence because this is where many articles make a mistake. Many resources on the web tell you there is nothing to worry about as long as your load average is lower then the number of cores in your server. I oppose to this statement.

    As you might know processes have a number of different states which they can be in. One of those states is IO/WAIT. This means that the proces is waiting for access to an IO-device (for example the harddrive) . During this state the proces is considered to be in-proces thus being in the run-queue and therefore representing 1 in the load average of your server. As you can see, in this situation the number of cores in the server is completely irrelevant because even a load of 2 can mean your quad-core server is slowing down because of the lack of speed in it’s IO-device(s).

    The previous example can be recognized when the output of the command top is being watched. When you see a high load but low CPU usage you can almost certainly say that IO is causing the number of processes in the run-queue to be high.

    • Vinod 11:31 op 16 februari 2012 Permalink | Beantwoorden

      Hi ,

      I have a linux box with 8 GB memory with 4 Processors ( Quad-Core AMD Opteron(tm) ). When checked with cpuinfo I found each processor has 4 cores. So which means that my box has a total of 16 cpu cores. Normally for a single core machine, a load average of 1.0 would mean that the processor is 100% used. Does this mean my server load can go as high as 16. As of now the monitoring is set in such a way that we get an alert when the load goes beyond 5.0 . Pasting the /proc/cpuinfo from the server.
      processor : 0
      model name : Quad-Core AMD Opteron(tm) Processor 2374 HE
      cpu cores : 4
      processor : 1
      model name : Quad-Core AMD Opteron(tm) Processor 2374 HE
      cpu cores : 4
      processor : 2
      model name : Quad-Core AMD Opteron(tm) Processor 2374 HE
      cpu cores : 4
      processor : 3
      model name : Quad-Core AMD Opteron(tm) Processor 2374 HE
      cpu cores : 4

      Will my server be able to withstand more load with 16 cores or is it something related to memory.

      Thanks in advance!

  • Reinoud 19:33 op 8 February 2011 Permalink | Beantwoorden
    Tags: heartbeat   

    Heartbeat 2.x not wanting to standby 

    When you are trying to use the script /var/lib/heartbeat/hb_standby or the script var/lib/heartbeat/hb_takeover you might experience that nothing is happening. In that case you are likely to see the following message in your log (which probably is /var/log/messages) : info: Standby mode only implemented when nice_failback on .

    I know what you are thinking, just add nice_failback on to your /etc/ha.d/ configuration file and everything will be jolly good. Please go ahead, you will notice this doesn’t solve the problem. This is because of the fact that the authors of heartbeat changed the configuration parameter but failed to change the log-message. The correct addition to your /etc/ha.d/ is: auto_failback off. Just to be sure everything keeps working I would recommend to leave the nice_failback on line in place in case you might ever down grade to a version of heartbeat that is pre 2.x .

    Above information was found on the linux-ha mailing-list

  • Reinoud 23:00 op 2 February 2011 Permalink | Beantwoorden

    Moving WordPress to a different domain 

    This is a quick not on how to move your WordPress site to a different domain. Usually this is no a task performed often, however as a developer you will have the need to do so on a regular bases when publishing a site.

    This post is very quick writeup on how to do so. First step, obviously: fix the settings in wp-config.php . Next run the following queries:

    UPDATE wp_options SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';

    UPDATE wp_posts SET guid = replace(guid, '','');

    UPDATE wp_posts SET post_content = replace(post_content, '', '');

    That should do the trick. Off course change and to the appropriate values.

  • Reinoud 19:37 op 27 January 2011 Permalink | Beantwoorden
    Tags: centos, installation   

    CentOS installation on large drives 

    This post is more a note to myself then it is a blog post. That is not a problem because in fact this whole blog is based on that very principal. Today, I was installing CentOS 5.5 onto a particularly large volume and I encountered some errors during the creation of the partition scheme concerning the placement of the /boot patition.

    It seems to be that the version of Grub that is embedded into CentOS 5.5 does not have support for booting from a volume larger then 2 TB. Having encountered this problem before with CentOS 5.4 I was struggling to remember the solution. After unsuccessfully messing around with some commonly mentioned results I gave up.

    The most easy solution to this problem: Create separate, smaller, volume for your /boot partition in the configuration of you storage controller. Yes, I know that this solution is only applicable to you who have RAID controller available in their machine. But common, every server should!

  • Reinoud 23:15 op 25 January 2011 Permalink | Beantwoorden
    Tags: downloader, , pear, upgrade   

    Problems with Magento’s PEAR 

    Trying to install some extensions today on a Magento installation I experienced the following error using Magento Connect:

    pear/Console_Getopt requires PEAR Installer (version >= 1.9.1), installed version is 1.7.1

    If you experience errors similar errors while using Magento Connect or Magento’s ./pear script try upgrading your PEAR installation using PEAR. Login in via SSH to the server running your Magento installation. Change your working-directory  to the root of the Magento installation and run the following two commands:

    ./pear channel-update
    ./pear upgrade --force PEAR

    Doing that should upgrade your PEAR installation to the latest version. After that you should be able to install extensions using Magento connect as always.

Maak een nieuw bericht
volgende post/volgende reactie
vorige post / vorige opmerking
toon / verberg reacties
ga naar boven
ga naar log-in
hulp weergeven/verbergen
shift + esc