docker-dive extension for VsCode - error trying to run - docker

I installed the "docker dive" extension in VsCode. I aready had the Docker extension installed (which it requires). The docs say that Dive will run when an image is selected in the Docker extension images list. But that does not happen.
I entered "dive" in the command palette and "Docker:Dive" came up. I selected it and it displayed a list of my images for me to select one. When I did that, a new terminal window opened and tried to run dive my_image_name.
Then Powershell displayed the error: dive : The term 'dive' is not recognized as the name of a cmdlet, ....
It's looking for "dive" in my PATH.
I'm confused. Docker Dive is an installed extension. Why should it also need it in my PATH? And if it really needs it, what is the path of the executable?

You need to install dive first. Just check the repo and you should be ready to go github.com/wagoodman/dive
For Windows users. From the releases page https://github.com/wagoodman/dive/releases/
you need to find the Assets and download the windows one. Like https://github.com/wagoodman/dive/releases/download/v0.10.0/dive_0.10.0_windows_amd64.zip
You unzip the file and then you can create a folder on your C drive called dive, like C:\dive. Copy the executable dive.exe intoC:\dive
Then you need to add that folder address into your PATH. For that you need to go to
From there you click on Environment Variables, then to System variables; from there you click on the Path variable and then on Edit. On the Edit window, add a new entry, with tyhe New button; the add C:\dive and click Ok button.
Then close and re open Visual Studio Code. Now the extension should work as intended.

Related

Remote Debugging in Delphi XE8 and Delphi 10 Seattle - How can I use a fixed remote directory?

To debug remotely with Delphi, now that the PAServer is normally used, one usually follows the following preliminary steps, as outlined on the online docwiki:
Create a remote profile inside your ide, in my case I'm calling it win7vm, this contains the IP address of the remote system, and a few options, and the PAServer connection password, but as far as I can see, it doesn't contain any context information like "I want to use the following remote folders".
The remote folders that are usually used to contain my target executable are usually a subdirectory underneath the scratch directory. If I configure the main scratch directory to be c:\scratch, and my remote profile was named win7vm and my project is name project1, then the IDE and PA Server are going to compile and deliver my executable to c:\scratch\win7vm\project1 and run it from there.
What I actually want is to have my executable be delivered to and run right in #c:\scratch#. I have a gigabyte of supporting files that all need to be in the same directory as my main executable and I don't want to have 8 copies of these supporting files. So, can this be done? Can I make PA Server NOT create a sub-folder with the name of my project and another for the name of my session? If so, is this done inside the paserver.config file, or on my client side, or somewhere else?
Update: I tried to change the Remote Path in the Project -> Deployment, but it does not work to use a relative path here. For example, change it to ..\..\ and the working directory in Project Options to ..\..\, but it still only delivers my executable to the folder c:\scratch\win7vm\project1 instead of directly into c:\scratch\
Update 2: It appears you can't do what I want, which is have the scratch directory be the main folder, and NOT create any sub-folders per-profile and per-project, and that if you don't like working in a scratch sub-folder, you should just set Absolute Remote Paths in Deployment and Absolute working folder in your project's Run options, and you should turn off restricted mode, however this means that the entire VM or machine you are remotely debugging can be manipulated by the PAServer, which is also hardly ideal. I believe that having a fixed root scratch folder would be a safer and more flexible way of working, so I'm leaving this question open, hoping to find an effective way to achieve a safe but flexible remote debugging technique.

TFS 2010 Build, constant drop location, random access issue

We are using TFS 2010 Build to deliver libraries on a fixed location. ( \\server\product-R0\latest )
Other team projects reference the library from this location.
On my build process I check if Build and unit tests passed, if it's ok I:
Transform web/app.config
Delete the latest folder using a "DeleteDirectory" activity
Create the latest folder using a "CreateDirectory" activity
Copy the binaries in the folder using "CopyDirectory" activity
I delete the folder first because if we rename an assembly the old one won't be deleted.
The issue is random and happen 40% of the time:
TF270002 : An error occurred copying files from
'D:\Builds\1\FooTeam\BarService\Binaries' to
'\\nas\Builds\BarService-R0\Latest'.
Details : Access to the path
'\\nas\Builds\BarService-R0\Latest\SomeFile.dll'
is denied.
If you launch the build several times it work.
I've try the usual dumb idea of "putting sleeps between steps to see what happens" but it don't solve the problem, it just seems to reduce the probability of it happening.
It's like TFS try to copy while still deleting the directory, some times it hangs on the directory creation step.
Anyone? Thank you!
The most elegant solution is to create a link instead of copying, something like
mklink /J D:\Drops\MyBuild_LatestGood D:\Drops\MyBuild_2014-06-13
Plus: No copy involved, same ACLs.
Caveats: this command works only locally, when the Drop share is located on the Build server. There are options also in the case of a NAS, as long as you are allowed to execute remote commands (e.g. SSH).
Another option is to create a network share on the desired folder, even if the disk is remote, as long as it reside on a Windows server.

Remove complete angular project built with Yeoman

i used yeoman to scaffolding angular project structure, but now i have problem to remove all contents under the root folder, there's this "node_modules" folder, i can't delete it.
My OS is win7, does anybody know how to delete the project completely?
I encountered this same issue when I tried to remove a node based application on my own Windows 7 box. I used this tool to remove the folder.
http://www.osmstudios.com/projects/path-too-long
Its written in Java so that is the only requirement. Its free and open source.
https://github.com/DawsonG/PathTooLong
This can be easily accomplished using the in-built Windows tool called robocopy which basically clones one directory into another. Create a new empty directory in the same location and use robocopy as shown below.
mkdir new_dir
robocopy /MIR new_dir long_name_dir
Create a mapping to a drive letter.
subst x: C:\Folder1\Folder2\Folder3\Folder4\Folder5
Then go to x: and delete the files (they now have a smaller path)
Next delete the mapping
subst x: /D
Use this tool is a java tool no install requiered and it works perfect
PathToLongLinkSoftware
When try to delete, windows prompt a dialog saying: the folder contains items whose name is too long for recycle bin. Win7 can't handle this, you can use 7-zip's file manager to delete them.
if you have winrar installed in your pc then right click your app folder, click 'add to archive' option
then tick the 'delete files after archiving', then delete the archived file. :)

How to keep fsi.exe open after running

I have a bunch of F# scripts (fsx) that I use for my basic deployment needs. I just right click them and say "Run with F# interactive"
However, sometimes the script fails and I would like to keep the interactive console running. So far I haven't figured out a nice way to achieve that.
I tried starting up the fsi.exe manually but then how can I launch my script from there?
If you are hackish enough, you may want adding just another Explorer context menu item similar to Run with F# Interactive, but keeping the console window open after .fsx script terminates. Here is the working outline of how to achieve this for Windows7/VS2012:
being admin open regedit and find the key HKEY_CLASSES_ROOT\VisualStudio.fsx.11.0\shell
add new subkey with some unique name, like openRunCmd, make (Default) value for this key whatever you like to see in context menu, maybe Run with Fsi in shell
finally, add subkey HKEY_CLASSES_ROOT\VisualStudio.fsx.11.0\shell\openRunCmd\command and set (Default) value for this subkey to the following line:
c:\windows\system32\cmd.exe /Q /K %%USERPROFILE%%\fsx.bat "%1"
Now, close regedit, go to your home directory and create there a batch file fsx.bat with the following line:
"C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\Fsi.exe" --quiet --exec "%1"
After these mods you would be able to click on any .fsx script with right mouse button, pick Run with Fsi in shell and have the shell window staying after script termination until you close it. With few small adjustments the same approach would work for VS2010.
Just be careful to adjust details, if your system settings differ from ones above. Good luck!
Update: For those who want to try this at home or at work I've posted a detailed walk-through here.
#load "myScipt.fsx";;
should work I think. But myself i prefer just to have separate console window (cmd.exe), from which i can run fsi myScipt.fsx and see the output.
I have created a windows shortcut with
Target:
cmd /k "C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\Fsi.exe" deploy.fsx
Start in:
C:\FolderContaningFsxScript
This keeps the window open if the script fails so I can see any compile errors. It also keeps the window open if the script runs successfully which might or might not be desirable.
I find it easier to just click the shortcut instead of Right Click > Run with F# Interactive. I think a batch file with the above command would work as well.

.Net Build does not contain output folders from other projects

We had a Project in our solution called DatabaseCreation - which was responsible for creating the database and running the scripts (contained in directories within the project).
Everything was fine.
We then wanted to make the creation of this database to be available from an app and from a console, so re-factored so that we had ...
DatabaseCreation.Core
DatabaseCreation.App
DatabaseCreation.Console
Core has the directories containing scripts, and the App and Console run them.
When built with Visual Studio the directories containing the scripts are copied to the Output bin directory (either App or Console) but problem is: when the build server runs, the script directories don't get copied to the bin folder.
We've tried with TFS and Team City. I realise I could just copy them over, but its frustrating that it works when building in Visual Studio!
Can anyone put me on the right track please?
Check the Build Type for the files in the scripts directory. Find that by clicking one or many files (ctrl+click) then hitting properties (often f4). You likely want them to be content with Copy Always or Copy if newer.
The files were set to copy always, but the build just wouldn't pick them up.
The slightly awkward work around was to add the files as links from one project to another.
Add Existing -> navigate to other project - Looking for the little arrow on the right of the add button -> press that, Add as link option appears.

Resources