Windows directory juction: no files are copied via network access - windows

I have a problem with file storage organization.
There is a network of Windows 7 and Windows XP computers. One of them is a file storage server.
Software packs are located on the storage server. Each software pack includes
1. active folder;
1. some folders for each program.
(see the structure example below)
Active folder is a structure of the actual program's versions, must allow to copy all the software in their actual versions avoiding file's duplicating via direct copying. Also fast switching of actual version is needed.
Program folders contain folders for each program's version.
I tried to solve the task via windows directory junction. I created the links via Far Manager 3, command Alt+F6, type directory junction.
Desired structure example
+---active % 389 MB, desired package of actual software
| +---notepad++ % directory junction
| | \---7.3.1
| | npp.7.3.1.Installer.exe
| | npp.7.3.1.Installer.x64.exe
| |
| +---octave % directory junction
| | \---4.2.1
| | octave-4.2.1-w32-installer.exe
| | octave-4.2.1-w64-installer.exe
| |
| \---texstudio % directory junction
| \---2.12.4
| texstudio-2.12.4-win-qt5.6.2.exe
|
+---notepad++
| +---6.8.8
| | npp.6.8.8.Installer.exe
| |
| \---7.3.1 % actual version
| npp.7.3.1.Installer.exe
| npp.7.3.1.Installer.x64.exe
|
+---octave
| +---4.2.0
| | octave-4.2.0-w32-installer.exe
| | octave-4.2.0-w64-installer.exe
| | octave-4.2.0-w64.zip
| |
| \---4.2.1 % actual version
| octave-4.2.1-w32-installer.exe
| octave-4.2.1-w64-installer.exe
|
\---texstudio
+---2.11.0
| texstudio-2.11.0-win-qt5.5.1.exe
|
+---2.12.0
| texstudio-2.12.0-win-qt5.6.2.exe
|
+---2.12.2
| texstudio-2.12.2-win-qt5.6.2.exe
|
\---2.12.4 % actual version
texstudio-2.12.4-win-qt5.6.2.exe
Local usage
Local means I operate on the storage server's Windows GUI.
If to copy active folder to another server's folder observed result is the same as desired:
TEST_COPY
\---active % 389 MB, all the files are copied
+---notepad++
| \---7.3.1
| npp.7.3.1.Installer.exe
| npp.7.3.1.Installer.x64.exe
|
+---octave
| \---4.2.1
| octave-4.2.1-w32-installer.exe
| octave-4.2.1-w64-installer.exe
|
\---texstudio
\---2.12.4
texstudio-2.12.4-win-qt5.6.2.exe
Network file access
If to access to the storage server's active folder via network sharing and copy it the desired result does not happen.
Of course, tree /A /F command shows the same structure of the copied tree, but active is 0 MB size and child folders notepad++, octave, texstudio are also zero-sized and empty.
TEST_COPY
\---active % 0 MB, no any files, only subfolders
+---notepad++
| \---7.3.1
|
+---octave
| \---4.2.1
|
\---texstudio
\---2.12.4
Only if try to copy directly directory junctions subfolders inside active folder (7.3.1, 4.2.1, 2.12.4) the content will be copied as desired. But every user wants to copy active folder, not its second level childs.
BTW. Sometimes when trying to copy an error occurred: file/folder already exists, and copy process was broken unexpectedly.
May be links are set up wrong or there are other methods to reach the desired result.

Related

Provision: how to set the device name?

20 days ago I've successfully provisioned for ESP-32 and work fine with this device.
Today I've successfully provisioned the second ESP-32 chip on another computer:
5.40 MiB / 5.40 MiB [------------------------------------] 100.00% 14.69 MiB p/s
looking for available hardware identities on disk
no hardware identities found on disk, claiming new hardware identity
Flashing device on port /dev/ttyUSB0
+--------------------------+--------------------------------------+
| SETTING | VALUE |
+--------------------------+--------------------------------------+
| Firmware | v1.0.2 |
| Device Model | esp32-4mb |
| Hardware ID | XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
| Hardware Batch & Seq. No | 2020-11-10#524 |
| context | remote |
| broker.host | device.toit.io |
| broker.cn | device.toit.io |
| broker.port | 9426 |
| wifi.ssid | SureDemo |
| wifi.password | suremote |
+--------------------------+--------------------------------------+
erasing device flash
successfully erased device flash
writing device partitions
successfully written device partitions
reading hardware chip information
successfully read hardware chip information
+--------------------------+--------------------------------------+
| SETTING | VALUE |
+--------------------------+--------------------------------------+
| factory device model | esp32-4mb |
| factory firmware version | v1.0.2 |
| chip ID | |
+--------------------------+--------------------------------------+
device was successfully flashed
However, I cannot start the application on this device:
michael_k # michaelk: ~ /toit_apps/Hsm2/tests $ toit run test_hsm_switch_async_4.toit
No default device set. Provide the device name (with the --device flag) to the command
michael_k # michaelk: ~ /toit_apps/Hsm2/tests $
I realized that this new device needs to be given a different name from my default device micrcx-1. By the way, I can see my first appliance:
michael_k # michaelk: ~ /toit_apps/Hsm2/tests $ toit devices
+--------------------------------------+----------+-------------------+----------+
| DEVICE ID | NAME | LAST SEEN | FIRMWARE |
+--------------------------------------+----------+-------------------+----------+
| XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX | micrcx-1 | Apr 29 2021 04:05 | v1.0.2 |
+--------------------------------------+----------+-------------------+----------+
michael_k#michaelk:~/toit_apps/Hsm2/tests$
So, the question is: how to give a name to a new additional device and how to run an application on it?
Thanks in advance, MK
PS. Naturally, I could be wrong, but as far as I remember, the name of the first device was assigned by toit system automatically. I had nothing to do with this. micrcx is my computer's identifier.
It might be that your device wasn't claimed yet.
In the current release (but hopefully not in future releases), provisioning a device only puts the Toit framework on the device. At this point it is not yet associated with your account and must be claimed.
You can simply run:
toit device claim <hardware-ID> or toit device claim <hardware-ID> --name=<some-name>.
If no name is provided, then the system generates one. Typically these are built out of two words, for example nervous-plastic. You can always change the names at a later point.
Alternatively you can claim the device in the web UI. There is a "CLAIM OR REPLACE DEVICE" button on the top right of the "Devices" view.
FYI: I have edited your post to remove the hardware ID of the new device, so nobody else claims the device in the meantime.

Playbooks that needs to be tweaked depending on the targeted environment

In our company we're using ansible to target different environments, about 10 on the development and integration side, and 3 on the production side. Those environments have some differences in terms of the number of resources dedicated. For example let say in production we have a standalone server or vm dedicated to run the jvm, another one for dB... And in certain other environments those applications share the same server or vm. The problem is that some playbooks needs to be tweaked in order to target such an environment, so how could we do to make it as generic and transparent as possible?
Thanks for your advices
what you want to achieve is putting good hosts in good groups.
if you're familiar with ansible-inventory --graph, here is what you want to achieve:
#all:
|--#dev:
| |--devel1.domain.org
| |--devel2.domain.org
|--#db:
| |--db1.domain.org
| |--db2.domain.org
| |--dbprod1.domain.org
| |--appprod2.domain.org
|--#app:
| |--app1.domain.org
| |--app2.domain.org
| |--appprod1.domain.org
| |--appprod2.domain.org
|--#dev1:
| |--devel1.domain.org
| |--db1.domain.org
| |--app1.domain.org
|--#dev2:
| |--devel2.domain.org
| |--db2.domain.org
| |--app2.domain.org
|--#prod:
| |--#prod1:
| | |--dbprod1.domain.org
| | |--appprod1.domain.org
| |--#prod2:
| | |--appprod2.domain.org
here the host appprod2.domain.org will inherit from group_vars of app,db, prod,prod2

djangocms text_ckeditor wordcount plugin

I am working in a djangocms project that uses the djangocms_text_ckeditor https://github.com/divio/djangocms-text-ckeditor
I would like to integrate a wordcount plugin similar to this https://github.com/w8tcha/CKEditor-wordcount-Plugin
Have someone of you did this before successfully? It would be great if I could get the plugin via pip or so, not downloading and including it in the project. And also, how would the CKEDITOR_SETTINGS look like?
I couldn't find any workaround, just a similar post but that does not use this djangocms text editor for that purpose.
Thanks in advance!
The extension is a javascript plugin for the ckeditor (as opposed to a djangocms plugin).
To load a javascript plugin two steps are needed:
Make the js plugin resources available to ckeditor. This is done through static folder in your project wich includes all js, css etc. files. In the static folder create the folders djangocms_text_ckeditor/ckeditor/plugins. Copy the js plugin into this folder. In your case thats the whole folder wordcount. The directory tree should look like
static
|
+---djangocms_text_ckeditor
| |
| +---ckeditor
| | |
| | +---plugins
| | | |
| | | +---wordcount
| | | | |
| | | | +---css
| | | | +---lang
| | | | +---plugin.js
Let the djangocms plugin ckeditor know about the js plugin. To this end, look for the setting CKEDITOR_SETTINGS in your project's settings.py file. If it is not there create it. It's a dictionary that is used, e.g., to configure the toolbars. In this dictionary have a key extraPlugins with a string value that consists of comma separated names of plugins to load, e.g.,
CKEDITOR_SETTINGS = {
...,
'extraPlugins': 'cmsplugins,wordcount,glyphicons,...',
...,
}
Hope that works for you.

Magento - error importing images with import/Export module and symbolic links

Capistrano is in charge of deploying my magento in all environments. The structure we work with is as follows:
Website
| current
| | media ---ln---> /var/www/website/aplication/shared/media
| | | import
| | | | p
| | | | | a
| | | | | | patata.jpg
When I try to import a CSV with a list of products with the image gallery, the images aren't imported. I have noticed that it's not possible to upload images from the backend either when "media" is a symbolic link.
What can I do to make it work with symbolic links? Has anyone had this problem before?
You should try the MAgmi Image attributes processor.
It allows images to be uploaded even from a third party URL.

Keep VS from wiping out config file from bin/debug/ every time I do a build (VS 2003/.NET 1.1)

I'm looking for a way to keep VS from wiping out my config files from my bin/debug/ and bin/release/ folders during the building process.
In a typical project environment VS would copy over the contents of the app.config file for the project and place it under the appropriate bin folder (debug or release) renamed as PROJECTNAME.exe.config. The problem is that I don't want to have to include the app.config file in my project because I don't want to have it under source control with the rest of my project files because the values of the config will need to be different depending on the environment it's for.
We still have these configs stored under source control, they're just not stored under the same directory as our main code and project files.
For example:
$/
|
+ MyApp/
|
+ code/
| MyApp.sln
| MyApp.csproj
| MyApp.cs
| App.ico
| LogWriter.cs
| Assembly.cs
|
+ configs/
|
+ Sandbox_1/
| + code/
| + bin/
| + Debug/
| MyApp.exe.config
|
+ Sandbox_2/
| + code/
| + bin/
| + Debug/
| MyApp.exe.config
|
+ Sandbox_3/
+ code/
+ bin/
+ Debug/
MyApp.exe.config
So say I'm working in the Sandbox_1 environment and I want my code to reside under C:\wf.
I would need to make TWO mappings under my SCM to get my working folder set up correctly:
+--------------------------------------------------------------+
| Repository Path --> Working folder |
+--------------------------------------------------------------+
1. $/MyApp/ --> C:\wf\MyApp\
2. $/MyApp/configs/Sandbox_1/code/ --> C:\wf\MyApp\code\

Resources