Windows 10 WSL - Maven config - maven

Is there a way to configure Windows Maven and WSL Maven to use the same .m2/repository and settings.xml?
In my .bashrc from WSL I added the M2_HOME to use the same installation that Windows 10 use:
.bashrc:
export M2_HOME=/mnt/c/development/maven
Windows PATH:
C:\development\maven
But when I execute mvn clean install on Windows Bash, a .m2 folder is created in ~/.m2 (WSL folder system).

Found a possible solution.
I created a symbolic link from ~/.m2 to /mnt/c/Users/<username/.m2
Command: $ ln -s /mnt/c/Users/<username>/.m2 ~/.m2
Until the moment is working fine.

Just an amendment to #Vitor 's response:
When you created the symbolic link once, the next time (e.g. if you specified a wrong directory and want to retry) you cannot create it and you will get failed to create a symbolic link: file exists error.
As a workaround when you want to recreate the symbolic link, you can use $ ln -f -s /mnt/c/Users/<username>/.m2 ~/.m2
[OPTION]
-f, --force
remove existing destination files

Related

Installing Github .zip files on Chromebook via Linux

I'm using a Linux Debian terminal, trying to install a Github .zip file by following a walkthrough (from Chromebook). They're using a Windows terminal and access the zip file from a G: drive. They run the following:
C:\Users\zasur>G:
G:\>cd filename.zip
G:\filename>npm install
Which installs the Github zip. I've looked all over online and tried a few different solutions but can't get past the second command they run.
I was able to open /mnt/chromeos/MyFiles/Downloads from Linux by sharing the Downloads folder with it.
I'm not sure how to change the directory from here to the filename.zip and/or run commands from it. Whenever I try to run cd filename.zip or cd /mnt/chromeos/MyFiles/Downloads/filename.zip it always fails. Is this even possible on a Chromebook?

How to get docker 'objects' completion on mintty-bash from git for windows

I have read (and tried) this:
https://docs.docker.com/machine/completion/
But it seems this is not the right way to get it on.
Anybody know how to get docker completion commands in Mintty (from Git for windows) bash command line?
Not sure if this is the best way to do this or if it work properly at all, but it seems to work!
Let me know if you find any strange behavior...
Minimum requirements:
Git for Windows (git bash / mintty terminal)
7-Zip or similar to extract files
Installation:
First of all, you will need the bash-completion package.
I discovered that the package built for cygwin works.
Choose a cygwin mirror: https://cygwin.com/mirrors.html
Navigate to: /cygwin/noarch/release/bash-completion/
Download: bash-completion-2.7-1.tar.xz
Extract it elsewhere
Copy the etc and usr folder to C:\Program Files\Git (see the note below)
Done, now you should have command completion enabled.
Testing:
You can test it by opening a git bash terminal and typing:
curl --ver (hit tab twice)
It will suggests something like this:
$ curl --ver
--verbose --version
Docker commands:
Now, about that docker commands...
I have found my files here:
docker command:
https://github.com/docker/docker-ce/blob/v17.09.0-ce/components/cli/contrib/completion/bash/docker
docker-compose command:
https://github.com/docker/compose/blob/1.16.1/contrib/completion/bash/docker-compose
docker-machine command:
https://github.com/docker/machine/blob/v0.12.2/contrib/completion/bash/docker-machine.bash
Just download and copy them to:
C:\Program Files\Git\usr\share\bash-completion\completions\
Make sure they are correctly named (remove the filename extension if any).
It should be named like this:
docker
docker-compose
docker-machine
No extra .txt or whatever...
Some notes:
I'm not sure if the package bash-completion-2.7.1 is the best version to work with git bash, I just got the latest one. (You can compare them and find it out)
You don't need to copy all the files from /usr/share/bash-completion/completions/, just the ones you want. (I didn't copy any of them).
It's a good idea to run a docker version, docker-compose version, docker-machine version and check the versions you are running, then download the correct files from the repository. (Choose the correct release tag for you).

Flume configuration

I am trying to configure Flume. When I run the following command:
sudo mv Downloads/flume-sources-1.0-SNAPSHOT.jar /usr/lib/apache-1.7.0-bin/lib/
I get the following error:
mv: cannot move Downloads/flume-sources-1.0-SNAPSHOT.jar' to/usr/lib/apache-1.7.0-bin/lib/': No such file or directory.
Any one can help me please?
Thanks.
In step 5 you are asked to download the file:
Use below link and download flume-sources-1.0-SNAPSHOTS.jar
https://drive.google.com/file/d/0B-Cl0IfLnRozUHcyNDBJWnNxdHc/view?usp=sharing
Then at the start of step 6 it says:
Move the flume-sources-1.0-SNAPSHOT.jar file from Downloads directory
to lib directory of apache flume:
Command: sudo mv Downloads/flume-sources-1.0-SNAPSHOT.jar /usr/lib/apache-flume-1.4.0-bin/lib/
This step has assumed that your downloads folder is called Downloads and is a subfolder of the one that your console is open at the time. If this is not the case, use the cd command to move to the folder where the newly downloaded file exists, and run sudo mv flume-sources-1.0-SNAPSHOT.jar /usr/lib/apache-flume-1.4.0-bin/lib/
Alternatively if you have access to a desktop on the machine, just cut and paste the downloaded file from where it went when you downloaded it from the internet into the folder /usr/lib/apache-flume-1.4.0-bin/lib/

Permission denied when creating symbolic links in git

there is a similar question, but the difference here is that I am working on Windows. I am running git on Windows (working in git bash tool) and I have successefully cloned my forked repository. Now I need to make symbolic link and it gives me Permission denied. I can make new dir for example in .git folder and I have also set chmod /R 777 for .git directory, so it seems I have permissions.
I tried to run:
rm -rf hooks and then ln -s ../git_hooks hooks.
You might be running into a basic incompatibility of ln on windows platforms (in this case within MINGW-MSYS). You can replace ln with a version that "does the right thing" on Windows; have a look at this:
Git Bash Shell fails to create symbolic links
I had this issue on Windows and I did a couple of steps to resolve this :
Enabled core.symlinks by modifying git config
git config --edit
Opened Git Bash as an Administrator and executed the git checkout command
This worked for me, hope it helps someone.
If you have are using Git for Windows SDK, you can install winln using the pacman package manager by running: pacman -Su winln
Then you can run: winln -s target link, it will check that you have SeCreateSymbolicLinkPrivilege, otherwise it will fail. This is equivalent to running Window's mklink.exe.
I am surprise Git for Windows, does not ship with winln vs an ln command that does a copy without telling you that it did a copy.
When installing git-bash for windows, there is an option called "Enable symbolic links". When I installed git-bash with that option I had the same issue as OP. So I installed the same setup (git-bash) again with that "Enable symbolic links" option unchecked. Then my issue was resolved.
If you are using a local web server on Windows (OpenServer, Laragon, Local), then start the server as an administrator. It worked for me

Windows how to create directory symlink

im trying to create a symlink to directory Windows 8.1
using git-bash command windows run as administrator
having the folder structure like this:
-magento plugin
-magento
where my plugin is a git repository i want to symlink it to magento as mentioned here: http://inchoo.net/ecommerce/magento/how-to-setup-git-for-magento-extension-development/
so i run command to create symlink
$ ln -s D:/wamp/www/plugin-magento/app/design/adminhtml/default/default/template/company/name/ d:/wamp/www/magento/app/design/adminhtml/default/default/template/
company/name
where:
D:/wamp/www/plugin-magento/app/design/adminhtml/default/default/template/company/name/ has subdirectories and exist
and
d:/wamp/www/magento/app/design/adminhtml/default/default/template/ exist
i get error:
ln: creating symbolic link d:/wamp/www/magento/app/design/adminhtml/default/def
ault/template/company/name' toD:/wamp/www/plugin-magento/app/design/adminhtml/def
ault/default/template/company/name/': No such file or directory
Under Windows you create a symlink with mklink /d. Attention under Windows its target and then source.
mklink /d "D:\wamp\www\magento\app\design\adminhtml\default\default\template\
company\name\" "D:\wamp\www\plugin-magento\app\design\adminhtml\default\default\template\company\name\"
http://www.sevenforums.com/tutorials/278262-mklink-create-use-links-windows.html

Resources