Installing NVMe M.2 PCIe SSD on Windows 10 and make it boot

I got a Corsair Force MP510, a blazing fast NMVe M.2 SSD and I couldn’t get Windows 10 to boot from it. It succesfully installed all the time, but never decided to boot Windows 10 for me.

What a dissapointment, since the drive is so fast, I didn’t want to restort to an older SSD and didn’t give up. There is so much crappy advice on the web, including many times the advice to RMA the device. But that might be way too drastic I decided.

Finally, after lots of trying with Windows tools like bootrec and diskman, I decided it had to be some BIOS setting and I was right.

To install a NVMe M.2 PCIe drive, follow these steps:

  1. Make sure the M.2. is the only drive that can be found (disconnect all other drives or disable them in the BIOS)
  2. Boot into your BIOS (usually means pressing F1 or ESC during boot)
  3. Disable, or make sure it is disabled, CSM ( Compatibility Support Module) UEFI, you should find it in the Startup/Boot section of the BIOS
  4. Make sure Secure Boot is enabled
  5. Format your drive. This is e.g. possible by choosing repair this computer during Windows 10 Setup and then getting into the command line.
  6. Restart your computer
  7. Go into the BIOS again
  8. Enable CSM/UEFI
  9. Disable Secureboot
  10. Go into the installer and follow the steps
  11. Then go back into the BIOS and confirm that the Windows Boot Manager is listed with your new NVMe drive
  12. Enable Secureboot again and install the default (factory) keys
  13. Save and exit
  14. You should be good to go!
  15. Let us know if that helped you….
Posted in Uncategorized | Comments Off on Installing NVMe M.2 PCIe SSD on Windows 10 and make it boot

Install Netbeans 11 and skip Java Development Kit (JDK) not found error

Since Netbeans is my IDE of choice, it was one of the first things I installed on my new PC. running Windows 10. I went straight away with the latest Netbeans version, which was version 11 at that time. Unfortunately installing Netbeans 11 was a pain, I got stuck with the installer stating Java SE Development Kit (JDK) not found on this computer.

The installer hints that using –javahome you can point the installer to the folder where the JDK is installed. However that never worked for me as well. If you have the same issue with installing Netbeans 11, you might want to know there is a fix.

Step 1

Make sure you have Java SE installed. E.g download the latest version from this page.

Step 2

Download the installer for Netbeans (on Windows) and then nagivate to the file. Run the Windows command line (cmd.exe) as Administrator and then run this command:

{filename.exe} --extract.

You will notice that the installer will start to extract files without doing any additional checks (such as for the JRE/JDK/Java whatever requirements).

Step 3

After that, run the command:

java -jar bundle.jar

Now setup should start and guide you through all next steps

Posted in Uncategorized | Comments Off on Install Netbeans 11 and skip Java Development Kit (JDK) not found error

Terrible experience with BDO Groningen

For my company I hired an accountant in Groningen, The Netherlands. In my case BDO Groningen. They also advice on taxes but unfortunately don’t understand that their clients benefit from paying less taxes.

An advice I received was described too near in the invoice which resulted in not being able to deduct it from taxes as a cost.

After mailing a couple of times, the company never wanted to change the description in such a way that I could deduct it from taxes. While my company always plays by the rules, there were some good arguments why it could be changed, at least for part of the process.

The end result,  a whopping 1400 EURO extra in tax obligations. Thank you BDO Groningen…

Posted in Uncategorized | Comments Off on Terrible experience with BDO Groningen

WordPress 3.5 – Image / Gallery Media uploader to custom plugin / meta box (easy)

With this simple and relative short code you can add the WordPress 3.5 Media Uploader to your own plugins. It will return single or multiple images and returns them in a comma seperated list.

If you want to return other attributes then  monitor the attributes using the console.


jQuery(document).ready(function(jQuery){

jQuery('#image_button').click(function(e) {
 e.preventDefault();
 frame = wp.media({
 title : 'Add your title here',
 frame: 'post',
 multiple : true, // set to false if you want only one image
 library : { type : 'image'},
 button : { text : 'Add Image' },
 });
 frame.on('close',function(data) {
 var imageArray = [];
 images = frame.state().get('selection');
 images.each(function(image) {
imageArray.push(image.attributes.url); // want other attributes? Check the available ones with console.log(image.attributes);
 });

 jQuery("#imageurls").val(imageArray.join(",")); // Adds all image URL's comma seperated to a text input
});
 frame.open()
});
});

 


<input type="text" name="imageurls" id="imageurls" />
 <input type= "button" class="button" name="image_button" id="image_button" value="Add Image(s)" />
Posted in Wordpress | Tagged , | 2 Comments

Fixing WordPress error: An error occurred in the upload. Please try again later

I’ve been spending a considerable amount of time in fixing the WordPress error: An error occurred in the upload. Please try again later. I received this error when trying to add image upload functionality to my own custom plugin.

I had a hard time debugging and first focussed on the Javascript. Unfortunately I couldn’t find the cause of the error and nearly gave up.

Then I remembered the obvious. The media upload element uses Ajax for uploading and return information about the uploaded image.

I assume you have WP_DEBUG = true in your config file, if not, make sure to add it to wp-config.php.

After that, use FireFox or Chrome developer tools and monitor the Ajax requests. You’ll notice requests to admin-ajax.php and async-upload.php. By looking at the responses the error was obvious, there was a conflict with (in my case, the custom permalink plugin) which gave me notices in the Ajax response. When I changed some code, it was solved and uploading media worked great!

So if you want to debug the mentioned issue, then make sure to monitor the Ajax requests, you might find the cause. Good luck and feel free to ask in case you need help!

Posted in Wordpress | Tagged , | 2 Comments

Google now also reports about old versions of software

When I logged in to Google Webmastertools today I was presented with a message that I’m using an old version of Vbulletin on one of my websites. Vbulletin is currently in the 4.x.x. version but in the 3.x.x versions there is still a maintained one, which we’re using. But it’s probably good that Google monitors for it as many outdated versions come with security vulnerabilities. I hope to update to the 4.x.x. branch soon but as our forum is rather large this is more than simply running the update script.

Posted in Google | Comments Off on Google now also reports about old versions of software

WordPress wp_list_comments callback explanation

When working with comments you might want to drastically change the appearance of the comments. You can use a new comment template with

comments_template( '/my-comments.php', true )

which you call from the template where you want to list the comments. But if you want each single comment to be different, you can use the callback function of wp_list_comments.

You use wp_list_comments in your comments template. Default is comments.php in your theme function, but if you used the comments_template function from above, you have to look for that file (of course). You should see wp_list_comments like the The Loop on it’s own. It goes through all of the comments and lists them. With the callback you can modify The Comment Loop and totally make it to your own likings.


<?php 
global $my_object;
wp_list_comments(array('type' => 'all', 'callback', array($my_object, 'my_custom_comments'));
?>

I’m using classes in my plugins, hence the inclusion of the global, you can also put the function in your functions.php and simply remove the references to the object. Then you can create a function in your class or functions.php and start the fun:


function my_custom_comments($comment, $args, $depth){
        
        $GLOBALS['comment'] = $comment;
    
        comment_text();
        
    }

In it, you can use the Comments Tags which are listed here. Questions? I’m happy to help you a little further, so don’t hesitate to post!

Posted in Uncategorized | Comments Off on WordPress wp_list_comments callback explanation

WordPress get_comment_meta and update_comment_meta

WordPress now features a function to allow you to store meta data for each comment. Just like it’s able to do so for posts. It seems that, under the hood, WordPress has functionality that potentially prepares it for metadata on whatever you want. As get_comment_meta is nothing but a call to update_meta with the first parameter prefilled with ‘comment’.

Anyway, when you are reading this you are probably looking for a way to get get_comment_meta working. It’s not documented in the Codex (yet) and other information on the web is not always easy to understand or complete. So here’s my try to make you understand get_comment_meta and with it comes update_comment_meta.

  • update_comment_meta -> will allow us to update a comment meta entry and is also used to create a meta entry
  • get_comment_meta -> will alows us to retreive the meta entry for each comment

The metadata for the comments is stored in the database in its own table and the comment ID is required to link the comment to its metadata.

To add comment metadata, a simple call to it like this will make it work:

update_comment_meta($comment_id, 'key', 'value');

If you save the data when someone is adding a new comment, you would probably receive the $comment_id from a call to e.g. wp_new_comment.

Retrieving the comment metadata is a little different than expected, it has a small (and simple) twist. The trick is in the third parameter here:

get_comment_meta($comment_id, 'key', true);

This will return a single result (e.g. string) while the following will result in returing an array:

get_comment_meta($comment_id, 'key');

It’s as simple as this! In case you want the comment ID while retrieving comments, you can replace $comment_id with get_comment_ID();

Posted in Uncategorized | 1 Comment

Features to expect in WordPress 3.2 (to be released Q2/Q3 2011)

WordPress 3.1 has just been released and I, as a WordPress addict, am already searching for information on WordPress 3.2. This release is scheduled for the first half of 2011. One thing seems to be sure, WordPress 3.2 will no longer support PHP4 and MySQL4. Besides that I found other features that are scheduled to appear in WordPress 3.2. Here is a list of features that affect end-users:

  • Minimum version for PHP: 5.2
  • Minimum version for MySQL: 5.0.15
  • Download required translations from GlotPress – This means that WordPress itself, themes and plugins are able to download translations from one, group a collaborative, web-based software translation tool. This would help getting translations automatically without any manual searching and downloading .mo files
  • Administration menu revamp – For plugin developers the current setup of the administration menu is a lot of hassle. With a rewrite/restructuring of the code this is improved
  • User can register/login with e-mail address, no username required anymore, functionality currently available in this plugin
  • Timezone suggestion, based on IP address
  • To be updated when more comes available, tips are very welcome!
Posted in Uncategorized | Comments Off on Features to expect in WordPress 3.2 (to be released Q2/Q3 2011)

How to make WPML compatible with W3C Total Cache

If you’re a heavy user of WordPress and use WMPL together with W3C Total Cache then you might have found out that it doesn’t work properly when using alias domains for each language. The language switcher doesn’t work correctly anymore. It seems that it switches to the first cached page and/or sometimes a random page. It might work for all pages except the home, but can also affect all pages on the website.

The default setting for the disk cache on W3C Total Cache is enhanced. Simply by changing this option to basic, both plugins will work together flawlessly. In enhanced mode the caching plugin fiddles with the headers of the HTTP request, in basic mode it keeps them as they are.

Update: Added clarifications as per the comment of Richard

Posted in Wordpress | 3 Comments