Category: Uncategorized


Speed up search in Visual Studio Code by excluding folders

Add the following to your Workspace or User settings:

"search.exclude": {
    "**/.git": true,
    "**/node_modules": true

Permenently allowing an insecure registry on docker-machine / boot2docker

Adding the --insecure-registry flag has been a bit of a pain for me. I’d ssh into the boot2docker machine and edit the file before restarting docker on the VM. Unfortunately every time the docker machine restarted I would lose the configuration and have to perform the same steps again.

Fortunately, I discovered the configuration files for the docker-machines and that it allows you to specify insecure registries by configuration.

Do the following to enable your insecure registry once and for all:

Edit the configuration file for your docker-machine (default in this case):

vi ~/.docker/machine/machines/default/config.json

Locate the `InsecureRegistry` key and simply append your insecure registry to the array.

    "HostOptions": {
        "Driver": "",
        "Memory": 0,
        "Disk": 0,
        "EngineOptions": {
        "ArbitraryFlags": [],
        "Dns": null,
        "GraphDir": "",
        "Env": [],
        "Ipv6": false,
        "InsecureRegistry": [

Then re-provision the machine with:

docker-machine provision default

Note: re-provisioning will likely lose any manual changes you made to the VM.


Running Docker without sudo

After installing docker on linux you might find that you have to run all docker commands with sudo. It is possible to add your username to the docker group so that you can run Docker without using sudo:

sudo usermod -a -G docker ${USER}

You may need to log out and back in for it to take effect.


Restore a mongodump with mongo restore

Extract the .tar.gz file created by mongodump. dump is the default folder name.

In mongodb 3.0 or above you need to specify the database name to restore to with the -d flag:

mongorestore -d [your_db_name] [your_dump_dir]


Deleting all files which do not contain @2x in Windows

[codesyntax lang="bash"]
for /f "eol=: delims=" %F in ('dir /b /a-d * ^| find /v /i "@2x"') do del "%F"
[/codesyntax] From