Share VPN connection of Windows host with VirtualBox guest

Sharing the VPN connection of your host in VirtualBox works fine with NAT, but not with host only mode. The solution I found on morales-rodriguez.net is simple. Open an admin console on your windows7 host and execute the following:

$ VBoxManage list vms

Note that uuid or name in parenthesis of your VM and then:

$ VBoxManage modifyvm  --natdnshostresolver1 on

New Nikon 600mm F/4 FL ED VR is too front-heavy with D810 attached

Update 04.03.2017: Perfectly balancing a Nikon 600mm FL with a D810 / D500 works now. I not only replaced the stock foot, but also use the gimbal Heavy Duty MK IV by jobu design.

Update 23.04.2016: Balancing the 600mm FL horizontally works fine now. I finally went with a foot replacement by jobu design.

Update 06.11.2015: A few words about my setup in the video. I replaced the stock foot of the lens with the RRS LCF-13, which has a lower profile, is lighter than the original Nikon foot and even slighly longer. The tripod head is by Dietmar Nill and weights 1.2kg. Unfortunately height can not be addjusted, but it’s less extrem than it seems in the video. Note that the exact same setup worked perfectly fine on the older 600mm F/4 ED VR.
——–

I just got my Nikon 600mm f/4 FL ED VR a few days ago. It’s so light and you can really handhold it. But the initial smile after picking it up went away pretty quickly as soon as I mounted it on my tripod with the D810 attached. It’s not possible to balance it! It’s way too front-heavy.

Only after not only attaching the additional battery grip MD-12, but also loading it with AA batteries, did I manage to balance it. The normal EN-EL15 was not enough.

How can this be? What an oversight by Nikon! I bought this lens because it’s light, and now I have to add weight back to make it work properly. What an irony!

This actually means that it only works properly with the heaviest camera, the D4. It also means that Nikon can’t make lighter flagship bodies in the future as long as they still want to support this lens.

The only solution I see without having to completely redesign the lens, is to drastically reduce the weight of the hood. Good opportunity for any 3D printing business. I’d buy one.

 

PhpStorm: Complete code versus complete current statement

Here are two useful keyboard shortcuts for PhpStorm which sound similar, but are quite different:

complete code CTRL + SPACE
will either finish your code if what you typed so far is unambiguous or otherwise offer a list to choose from.

complete current statement CTRL + SHIFT + ENTER will add a semicolon at the end of your statement, no matter where the cursor is.

If you want to train your shortcut skills for PhpStorm or other software, the website shortcutFoo is really helpful and fun to use.

JavaScript tip: Shorten document.getElementById with Function.prototype.bind

I found this really nice one liner on Nick Desaulniers blog about Function.prototype.bind Edge Cases:

// var byId = function(id) { return document.getElementById(id); }
var byId = document.getElementById.bind(document);

Love it!

How to automount your virtualbox shared folder to /var/www

After adding the shared folder Websites to fstab by adding the line

Websites /var/www vboxsf rw,uid=33,gid=33 0 0

and giving the right permissions, I always got the following error during my virtual Linux Mint boot:

keys:Press S to skip mounting or M for manual recovery

All I had to do was add vboxsf on a line of its own in /etc/modules.
Solution found on askubuntu.com

How to load leaflet.js and leaflet plugins with dojo AMD

<script type="text/javascript">
var dojoConfig = {
  baseUrl: '/lib',
  async: true,
  packages: [
    {name: 'Leaflet', location: './Leaflet'}
  ],
  map: {
    // lets you switch between minified and source version of leaflet for development
    '*': {
      'Leaflet/leaflet': 'Leaflet/leaflet-src'
    }
  }
};
</script>
<script type="text/javascript" src="lib/dojo/dojo.js"></script>

<script type="text/javascript">
require([
  'require',
  'Leaflet/leaflet'
], function(require, L) {

  // load plugin after loading leaflet, because it's referenced by the draw plugin
  require(['Leaflet/plugins/draw/leaflet.draw'], function() {

    var drawControl = new L.Control.Draw({...}),
    map = L.map(...);
    ...

  }):
});

Linux Mint 17: Install php_oci

Quick cooking recipe to install PHP oci8 on Linux Mint 17 / 18.

  1. Download the Instant Client from the Oracle Website and follow the instructions at the bottom of the download page.
  2. Download the Instant Client SDK from the same location, unpack it and move the SDK folder to the same folder where the Instant client is installed. On Linux Mint this would be “/opt/oracle/instantclient_xy”
  3. “sudo pecl install oci8” and give path to your instant client when asked
  4. Add “extension=oci8.so” to your php.ini located at “/etc/php5/apache2/php.ini”
  5. restart apache “sudo apache2 -k restart”

Note: You can use phpinfo() to locate the used php.ini

Linux beginners trick: mount root shell to read-write

If your Linux (Mint) fails to boot because you broke the /etc/fstab, for example, you’ll end up with a ready only root shell. The trick is to mount the root partition to as read-write without actually unmounting it:

# mount -o remount,rw /

After doing that, you wil be able to edit /etc/fstab, correct the error, and reboot normally.

Found on: How to fix Linux boot problems

SQL tip: Update add instead of replace

A simple way to add to a database record instead of replacing it with Oracle:

UPDATE myTable SET textField = :text||textField WHERE ...

This comes in handy, when you have a form field, which can be empty, but should not overwrite an existing record when posted (This should also be easily adapted to other SQL dialects).

Why using the DNG format might not be a good idea

A few years back I converted my photos from the proprietary Nikon NEF format to Adobes open DNG format, because I’m convinced of the open source idea and hate proprietary formats. But now that I started to enter photo contests, I have a problem. I can’t use any of these photos, since all contests want you to hand in the original RAW file, and DNG only counts as original if you camera directly writes them.