Docker Volumes Mounting File as Folder on Windows

Hey everyone,

I ran into a small issue today using docker-compose. I had a config file I was trying to mount as a volume however running “docker-compose up” generated a folder instead.

ERROR: for grafana Cannot start service grafana: OCI runtime create failed: container_linux.go:349: starting container process caused “process_linux.go:449: container init caused \”rootfs_linux.go:58: mounting \\\”/host_mnt/e/repos/Sample-Twitch/grafana/datasources.yml\\\” to rootfs \\\”/var/lib/docker/overlay2/f5c9553407551b68dc5d5877d748ba2bf7d2f0dd2ad12c73e39be40af185c82d/merged\\\” at \\\”/var/lib/docker/overlay2/f5c9553407551b68dc5d5877d748ba2bf7d2f0dd2ad12c73e39be40af185c82d/merged/etc/grafana/provisioning/datasources/prometheus.yaml\\\” caused \\\”not a directory\\\”\””: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type ERROR: Encountered errors while bringing up the project.

The issue turned out to be an oversight on my part, I’d misspelled the config filename and docker was unable to find it. Consequently, it generated the missing file as a directory.

It took a bit of Googling to narrow this down, but eventually this stackoverflow post pointed me in the right direction: https://stackoverflow.com/a/44950494/522859

Thanks,
Chris

Remote Desktop: An authentication error has occurred. – This could be due to CredSSP encryption oracle remediation.

Hi everyone,

I ran into an auth issue with remote desktop today:

An authentication error has occurred.
The function requested is not supported.
Remote computer: XXXX

This could be due to CredSSP encryption oracle remediation.
For more information, see hhtps://go.microsoft.com/fwlink/?linkid=866660

The solution is to add the May 2018 Windows Security Update on both the remote and local machines. If that’s not possible a registry entry can be added to the local machine to circumvent the issue. This can be done by running the following command in a command prompt as administrator:

REG ADD HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesSystemCredSSPParameters /v AllowEncryptionOracle /t REG_DWORD /d 2

You can also add the entry manually via regedit.

The cause is actually because of a security update in windows. If either the remote or local machine has the update and the other does not the error is triggered. There’s more info available on the following page: https://github.com/stascorp/rdpwrap/issues/480

Module build failed: Error: ENOENT: no such file or directory, open – Windows

Hi everyone,

I’ve been mucking around with React over the last couple of days. I ran into the following error while trying to build:

Module build failed: Error: ENOENT: no such file or directory, open ‘c:…Form.js’
at Error (native)

It took a while to sort this one out but I eventually came across a solution on github:

npm rebuild node-sass

Thanks to xzyfer for posting in the following github thread: https://github.com/sass/node-sass/issues/1579#issuecomment-227661284

There’s a whole heap of info in that thread so be sure to check it out.

Thanks,
Chris

VirtualDog Tutorial PluralSight

Hey everyone,

Just taking a quick look at Jasmine with Typescript and found a decent looking tutorial on PluralSight with a sample app called VirtualDog. Attempting to run the following command resulted in an error on Windows 10:

npm run bower-typings

> concurrently “bower install” “typings install”

[0] ‘bower’ is not recognized as an internal or external command,
[0] operable program or batch file.
[1] ‘typings’ is not recognized as an internal or external command,
[1] operable program or batch file.
[1] typings install exited with code 1
[0] bower install exited with code 1

npm ERR! Windows_NT 10.0.15063
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “bower-typings”
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! VitrualDog@0.0.1 bower-typings: `concurrently “bower install” “typings install” `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the VitrualDog@0.0.1 bower-typings script ‘concurrently “bower install” “typings install” ‘.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the VitrualDog package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! concurrently “bower install” “typings install”
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs VitrualDog
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls VitrualDog
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:UsersChris-PCDesktopTesting Javascript with Jasmine and Typescriptvirtualdog-beginnpm-debug.log

In order to fix it, just run the following command:
npm install -g bower

Thanks to the following link: https://stackoverflow.com/a/37669968/522859

Tensorflow – No such file or directory

Hey guys,

Just a quick post on how to resolve an error I came across while testing out tensorflow:

Traceback (most recent call last):
  File "C:UsersChris-PCDesktopimages-to-useattempt2tensorflowexampleslabel_imagelabel_image.py", line 112, in 
    graph = load_graph(model_file)
  File "C:UsersChris-PCDesktopimages-to-useattempt2tensorflowexampleslabel_imagelabel_image.py", line 30, in load_graph
    with open(model_file, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'tensorflow/examples/label_image/data/inception_v3_2016_08_28_frozen.pb'

All you need to do is download the following file and place it in the directory in the error message: https://storage.googleapis.com/download.tensorflow.org/models/inception_v3_2016_08_28_frozen.pb.tar.gz

Rename all files in a directory with Sequential Numbers

Hey guys,

Just a batch script I came across that allows you to rename all files in a directory with sequential numbers. Really handy for things like tensorflow. All you need to do is create a batch file in the directory containing the following:

@echo off
setlocal EnableDelayedExpansion
set i=0
for %%a in (*.jpg) do (
    set /a i+=1
    ren "%%a" "!i!.new"
)
ren *.new *.jpg

 

Thanks to this stackoverflow post: https://superuser.com/a/350633/124014

Running ReadTheDocs on Windows

Hey everyone,

This is a quick guide on how to setup your own readthedocs server on Windows.

Install Python 2.7: https://www.python.org/downloads/

Install virtual env using pip via command prompt (run as administrator):
c:Python27>python.exe scriptspip.exe install virtualenv

Create a virtual environment:
c:Python27>scriptsvirtualenv.exe c:readthedocs
c:readthedocsScripts>activate.bat
(readthedocs) c:readthedocsScripts>

Create a folder and clone the repository:
(readthedocs) c:readthedocsScripts>md checkouts
(readthedocs) c:readthedocsScripts>cd checkouts
(readthedocs) c:readthedocsScriptscheckouts>git clone http://github.com/rtfd/readthedocs.org.git
Cloning into 'readthedocs.org'...
remote: Counting objects: 47896, done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 47896 (delta 19), reused 0 (delta 0), pack-reused 47843
Receiving objects: 100% (47896/47896), 37.91 MiB | 8.76 MiB/s, done.
Resolving deltas: 100% (31783/31783), done.
Checking connectivity... done.

Get and install dependencies using pip:
(readthedocs) c:readthedocsScriptscheckouts>cd readthedocs.org
(readthedocs) c:readthedocsScriptscheckoutsreadthedocs.org>git clone http://github.com/rtfd/readthedocs.org.git

Ran into the following error: no module named django.core.management (probably caused by having two version of python installed)
(readthedocs) c:readthedocsScriptscheckoutsreadthedocs.org>c:Python27python.exe c:readthedocsScriptspip.exe install django --upgrade
Collecting django
Using cached Django-1.10.2-py2.py3-none-any.whl
Installing collected packages: django
Successfully installed django-1.10.2
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

Build the database:
(readthedocs) c:readthedocsScriptscheckoutsreadthedocs.org>c:Python27pytho
n.exe C:readthedocsScriptscheckoutsreadthedocs.orgmanage.py syncdb
Operations to perform:
Synchronize unmigrated apps: allauth, messages, django_extensions, django_grav
atar, rest_framework, annoying, textclassifier, corsheaders, copyright, privacy,
django_countries, humanize, rtd_tests, haystack, doc_builder, staticfiles, rest
api, bitbucket_oauth2, bitbucket, notifications, djangosecure, pagination, githu
b, djcelery, payments
Apply all migrations: core, account, builds, gold, sessions, admin, guardian,
tastypie, messages_extends, comments, sites, contenttypes, redirects, auth, tagg
it, oauth, bookmarks, donate, projects, socialaccount
Synchronizing apps without migrations:
Creating tables...
Creating table corsheaders_corsmodel
Creating table celery_taskmeta
Creating table celery_tasksetmeta
Creating table djcelery_intervalschedule
Creating table djcelery_crontabschedule
Creating table djcelery_periodictasks
Creating table djcelery_periodictask
Creating table djcelery_workerstate
Creating table djcelery_taskstate
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying account.0001_initial... OK
Applying account.0002_email_max_length... OK
Applying admin.0001_initial... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying taggit.0001_initial... OK
Applying projects.0001_initial... OK
Applying builds.0001_initial... OK
Applying projects.0002_add_importedfile_model... OK
Applying bookmarks.0001_initial... OK
Applying builds.0002_build_command_initial... OK
Applying comments.0001_initial... OK
Applying core.0001_initial... OK
Applying core.0002_make_userprofile_user_a_onetoonefield... OK
Applying core.0003_add_banned_status... OK
Applying donate.0001_initial... OK
Applying donate.0002_dollar-drop-choices... OK
Applying donate.0003_add-impressions... OK
Applying donate.0004_rebase-impressions-on-base... OK
Applying donate.0005_add-geo-filters... OK
Applying donate.0006_add-geo-data... OK
Applying donate.0007_add-impression-totals... OK
Applying gold.0001_initial... OK
Applying guardian.0001_initial... OK
Applying messages_extends.0001_initial... OK
Applying sites.0001_initial... OK
Applying socialaccount.0001_initial... OK
Applying socialaccount.0002_token_max_lengths... OK
Applying oauth.0001_initial... OK
Applying oauth.0002_combine_services... OK
Applying oauth.0003_move_github... OK
Applying oauth.0004_drop_github_and_bitbucket_models... OK
Applying oauth.0005_add_account_relation... OK
Applying oauth.0006_move_oauth_source... OK
Applying oauth.0007_org_slug_nonunique... OK
Applying projects.0003_project_cdn_enabled... OK
Applying projects.0004_add_project_container_image... OK
Applying projects.0005_sync_project_model... OK
Applying projects.0006_add_domain_models... OK
Applying projects.0007_migrate_canonical_data... OK
Applying projects.0008_add_subproject_alias_prefix... OK
Applying projects.0009_add_domain_field... OK
Applying projects.0010_migrate_domain_data... OK
Applying projects.0011_delete-url... OK
Applying projects.0012_proper-name-for-install-project... OK
Applying projects.0013_add-container-limits... OK
Applying projects.0014_add-state-tracking... OK
Applying projects.0015_add_project_allow_promos... OK
Applying projects.0016_build-queue-name... OK
Applying projects.0017_add_domain_https... OK
Applying redirects.0001_initial... OK
Applying sessions.0001_initial... OK
Applying taggit.0002_auto_20150616_2121... OK
Applying tastypie.0001_initial... OK

Starting the readthedocs server:
D:UsersChrisO>C:readthedocsScriptsactivate.bat

(readthedocs) D:UsersChrisO>c:Python27python.exe C:readthedocsScriptschec
koutsreadthedocs.orgmanage.py runserver
Performing system checks…

System check identified no issues (1 silenced).
October 21, 2016 – 11:16:17
Django version 1.8.3, using settings ‘readthedocs.settings.dev’
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

Create a new readthedocsproject:
I followed this guide: http://read-the-docs.readthedocs.io/en/latest/getting_started.html#in-rst

Creating the new project:
C:readthedocs>md whatibroke
C:readthedocs>cd whatibroke
C:readthedocswhatibroke>C:readthedocsScriptssphinx-quickstart.exe
Welcome to the Sphinx 1.3.5 quickstart utility.

Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).

Installing a theme – sphinx_rtd_theme (optional step):
c:readthedocsScripts>activate.bat
(readthedocs) c:readthedocsScripts>cd c:readthedocswhatibroke
(readthedocs) c:readthedocswhatibroke>pip install sphinx_rtd_theme

In your conf.py file (C:readthedocswhatibrokeconf.py):
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

Building your output:
c:readthedocsScripts>activate.bat
(readthedocs) c:readthedocsScripts>cd c:readthedocswhatibroke
(readthedocs) c:readthedocswhatibroke>make html
Running Sphinx v1.3.5
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded.

Build finished. The HTML pages are in _build/html.

Thanks to the following stackoverflow post for a lot of the information here: http://stackoverflow.com/a/19892345/522859

Windows 10 – Search Not Working

Hey everyone,

I’ve just upgraded to windows 10, however the start menu search has been randomly breaking. It just seems to load indefinitely. Thankfully there’s an easy fix:

- Start task manager (ctrl + shift + esc)
- Click more details
- Under the processes heading look for Search (green icon under background processes)
- Click on Search and hit end task

The Search process should now restart and start working. If not you can restart it manually using file > run.

Windows 10 search not working
Windows 10 search not working

wget or curl on Windows

Hey everyone,

Just a quick post on a Window’s equivalent to wget/curl.

To start, you’ll need to open PowerShell (run > powershell.exe). To retrieve the page, you’ll just need to enter the following one liner:

(new-object System.Net.WebClient).DownloadFile('http://www.whatibroke.com','C:my_output_file.txt')

The page contents will be stored in the output file provided as the second parameter to DownloadFile. To view it, just open the file in a text editor.

If you’d rather something with a GUI, winwget has been recommended on SuperUser.

Refresh Folder Hotkey – Sublime Text 2

Hey everyone,

Just a quick post on how to setup a refresh hotkey in Sublime on Windows. All you have to do is the following:

1) Open sublime
2) Select Preferences from the top menu and then click “Key Bindings – Default”
3) Go to the end of the file and add a comma to the last entry:

        //Original
	{ "keys": ["enter"], "command": "hide_panel", "context":
		[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
	},
	{ "keys": ["shift+enter"], "command": "find_prev", "context":
		[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
	},
	{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
		"context": [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
	}

        //Modified
        //Original
	{ "keys": ["enter"], "command": "hide_panel", "context":
		[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
	},
	{ "keys": ["shift+enter"], "command": "find_prev", "context":
		[{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
	},
	{ "keys": ["alt+enter"], "command": "find_all", "args": {"close_panel": true},
		"context": [{"key": "panel", "operand": "incremental_find"}, {"key": "panel_has_focus"}]
	}

4) Add the following entry:

//Custom
{ "keys": ["f5"], "command": "refresh_folder_list" }

Now all you have to do is save the file and F5 will now refresh your project! If you want to change the hotkey, simply switch [“f5”] for another value.

Leave a comment below if you have any issues or tips!