All you have to do is know where VirtualBox is installed, change the path to it below, then also change the name of the virtual machine (VM) you want to autostart below.  Here, upon boot up, I have one of my local development servers auto start “vm1”, which is a Ubuntu web server with a few Symfony projects.

cd "C:\Program Files\Oracle\VirtualBox"
vboxmanage startvm "vm1"

Fast, easy and reliable so if your server restarts, you don’t have to worry about your server staying offline.


The JQuery UI library’s Datepicker function is very convenient.  Here’s a way to override the date field if you want to allow the user to also input the time of day along with it without adding an extra field and deal with merging the values in the backend.  You can also add “+d.getSeconds()” if you want to allow seconds, but I find that’s wasted space.

  $('.datepicker').datepicker({
        dateFormat: 'yy-dd-mm',
        onSelect: function(datetext){
            var d = new Date(); // current time
            datetext=datetext+" "+d.getHours()+":"+d.getMinutes();
            $('.datepicker').val(datetext);
        },
    });

 


Recently, my computer started slowing down.  I heard nightmares about hackers encrypting data on drives and only unlocking the drives if you pay a ransom.  How nice.

Then, after Ctrl+Alt+Del and checking on programs running, I’ve started to see “Bitlocker Drive Encryption Service”.  Sounds scary.  Apparently, it’s part of Microsoft Windows.  How many times have you seen a program running in Windows and wondered if your virus protection didn’t catch something.  Are your keystrokes currently being listened to?!  These days, you can’t be too careful.  Or paranoid.

Thankfully, there is some information about Bitlocker here.  Microsoft does provide documentation as well, learn more about Bitlocker by clicking here.


On occasion, you’re going to have some mammoth form that doesn’t validate properly with any Javascript validation library.   One event is when the form you are given to deploy has a lot of checkboxes and one of those checkboxes needs to be checked to be valid.  The easiest way to make sure this happens is to create a form submission even listener then if there’s at least one checkbox checked, it returns true at which time it triggers the form validation OR it sends the “e.preventDefault()” command, which will stop any further processes, in this case, triggering the form submission which would then trigger the validation.  It’s kind of pre-submit validation, but to me, it’s the fastest way to “piggyback” on the existing form validation if everything else works properly.

Here is a sample, and this is the form library that I think is incredibly reliable, clean, and very easy to use:

http://jqueryvalidation.org/documentation/

$("#mainForm").on('submit',function(e){

   if ( $("input[type='checkbox']:checked").length > 0) {


   }
   else {
         e.preventDefault();

         alert("Please check at least one category you wish to be listed in.");
         return false;
   }

   return true;

});


$("#mainForm").validate();

This works well CDN’d with Symfony form projects.


Log in to your server as root.  At the server’s command line, type “visudo”.

Scroll down file and add any usernames you want sudo access:
“new_user    ALL=(ALL) ALL”

Find out more about “sudo” here.