Tag Archive: windows


Devving on Windows is a PITA.

Anyway, ever seen a message like this?

warning: LF will be replaced by CRLF in tests/unit/Del/Console/CommandTest.php.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in tests/unit/Del/Console/CommandTest.php.
The file will have its original line endings in your working directory.

We only want LF. To squelch this crap, run the following:

git config core.autocrlf false

Yay.

Apple Wireless Mouse on Windows

So I left my work laptop’s PSU in Scotland. Oops! I also left my cheap mouse alongside it (I hate the touchpad thingy). So that left me with my Apple Wireless Magic Mouse, the touch sensitive one.

Once you hook it up with Bluetooth, you’ll notice the touch scroll doesn’t work. 😦
So let’s fix that!

As you know, Mac can run Windows using a thing called Bootcamp, which has the drivers we need. Download either the 32 or 64 bit version depending which Windows you are running. https://support.apple.com/kb/DL1336?locale=en_US

Using 7-zip or something similar, right click the downloaded exe and and extract it somewhere. Once extracted, go into the BootCamp31ToBootCamp303 folder.

Look for a file called Binary.MultiTouchMouse_Bin. Right click on that, and extract the files somewhere. These are our drivers!

Once you’ve done that, run DPInst.exe, which will install the drivers.

Scroll now works! But ah! Macs scroll the opposite way around, like a touch screen, we push the page up or down. If you’d like to flip the scroll “wheel”, do the following:

  • Open Control Panel > Devices & Printers > Bluetooth Devices
  • Right click and choose Properties
  • Select HID compliant mouse, and click properties
  • Choose the Details Tab
  • Select Device Instance Path, note the value
  • Open regedit (Start > regedit)
  • HKEY_LOCAL_MACHINE
  • System
  • Current Control Set
  • Enum
  • HID
  • Now follow the device instance path from the mouse properties
  • Device Parameters
  • Double Click FlipFlopWheel
  • Change 0 to 1 (turn flip flop wheel on)
  • Now disconnect and reconnect your mouse

Your mouse now works exactly the same way in Windows as it does on your Mac. Have fun!

PuPHPet and Vagrant are awesome. If you develop on Windoze, you are either off your head, or have no choice in the workplace. Right now I fall into the latter category. I noticed XAMPP installed. Yeah right. No chance. Anyway, using PuPHPet and Vagrant is a far better way of doing things regardless of your OS, as it means you can move your entire development environment anywhere without having to reconfigure anything! See my post https://delboy1978uk.wordpress.com/2014/08/18/using-puphpet-and-vagrant/ for info on getting set up and running.

Anyway, it turns out that the files and directories for your sites are all owned by www-data, and are in the www-data group. I was trying to run a PHP CLI command, however, as the logged in user is vagrant and the permissions were only executable for the owner, I tried running chmod, and chgroup, and chown, with no success. Because these are mounted folders and not actually in the VM, altering the permissions the normal way is impossible.

The solution is to go into your VagrantFile, and add the following:

config.vm.synced_folder "./mysite/scripts", "/var/www/mysite/scripts",
        owner: "www-data",
        group: "www-data",
        mount_options: ["dmode=775,fmode=775"]

The first path given is relative to your host OS directory with your site folders inside, the second path is the path on the VM. dmode I’m guessing is the directory permissions, fmode is the file permissions. I keyed this in just before the ‘end’  line at the bottom of the VagrantFile.

To make the changes, you can type vagrant up (if you havent started yet), or vagrant reload. Permissions have now been changed!

One last thing. Once I was able to execute, I ran my script and got

: No such file or directory

This again is a stupid character encoding issue due to windows, and the way I sorted it was to cat the file in Putty, and select the text, nano a new file, paste it in, delete the original, and rename the new file. I didnt have to chmod anything, all files in here now default to 775.

Anyway, now that problem has been solved I can get back on with my work! Cheers! 😀

UPDATE

It appears that the Vagrant file has been broken up into smaller more specific parts. In a recent puPHPet Vagrant box, I had to paste it in the puphpet/vagrant/vagrantfile-local file,  right before the very last line (which just says end).