Using bzr with SFTP on Windows/Cygwin - windows

Note: I'm not sure if this belongs on ServerFault or StackOverflow
I'm currently working on a project which has an SFTP-only bzr repository. All works fine using my Linux machine, but when using Windows with Cygwin I get the following issue:
$ bzr checkout sftp://user#hostname/var/bzr/project
bzr: ERROR: Unsupported protocol for url "sftp://user#hostname/var/bzr/project": Unable to import paramiko (required for sftp support): No module named Crypto
I have installed Cygwin's python-paramiko package, so I'm not sure why it's refusing to use it.
Any suggestions much appreciated.
Clarification: This does work with Windows bazaar GUI tool & Windows cmd shell, I'm just wondering if I can make it work in Cygwin as I prefer UNIXy command line tools.

Played around with this today.
Had to install python-crypto which should be a prerequisite of python-paramiko but isn't.

Related

Is there a solution to install DRAKE on my WLS Ubuntu 18.04

I'm trying to install "Drake" (text-based data workflow tool) in a (WSL) Windows Subsystem for Linux and I try the steps in the book Data Science At The Command Line's Chapter 06 and the Drake's github repository I've followed all the steps without any problem, but when I try to install "Drip" github repository with this code
$ git clone https://github.com/flatland/drip.git
$ cd drip
$ make prefix=~/bin install
I had this :
I desperately tried a few things like adjusting the java's environment variables for my windows system and in my WSL Ubuntu too, without success
My Windows Build is :
And my WSL is:
My problem was to install "DRAKE" a Data workflow tool, after being searching for a solution I heard about Homebrew a solution made initially for installing tools on macOS and it's available now for linux even for WSL!
like in magic just type the tool to install and it's automatically done even if it's requires dependencies
brew install drake
So for nubies like me it's a welcome tool which can save you a lot of time.

How to install Git-crypt on Windows?

The git-crypt instructions exist for Linux and MacOS, but for Windows these seem to be omitted. How to install Git-crypt on Windows?
There are other approaches, but I like msys2:
Install msys2:
http://www.msys2.org/
Open a msys2 terminal. Then ...
Install g++ for windows, following the instructions here:
https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2
Be sure /mingw64/bin is in your path. (e.g. which g++)
git clone git#github.com:AGWA/git-crypt
cd git-crypt
make LDFLAGS="-static-libstdc++ -static -lcrypto -lws2_32"
I would not trust the Repository git crypt for Windows that was mentioned.
I finally just managed to build git-crypt myself. And the Difference of the Size between this two Binaries is huge.
My self compiled Version is something around 370 kb compared to the 5.7 Mb from the One on GitHub.
Thanks for the Answer
Thumbs Up
with msys2 you can:-
pacman -S git-crypt
to install without needing to build it.
Check out git crypt for Windows. Consider whether you trust unsigned files from the internet (keep in mind git crypt itself is unsigned and you likely haven't reviewed the source)
For Windows 10 there is an alternative that should make things a bit easier using WSL (Windows Subsystem for Linux). This will avoid the need to compile anything.
If you do not have WSL enabled see Microsoft docs guide. I would also recommend installing the latest LTS edition of Ubuntu from the Microsoft Store app (any edition of Ubuntu will do).
Install Git Crypt
Once you have a working copy of Ubuntu for WSL, open it and run the following commands.
sudo apt-get update
sudo apt-get install git-crypt gnupg
Use Git Crypt
Now all that you need to do is access your Windows files from within Ubuntu by looking in /mnt/. Then you can use git-crypt as normal from within WSL.
I have downloaded git-crypt.exe from here and placed it in the C:\Program Files\Git\cmd\git-crypt.exe ! This solved my issue !
As proposed by mikemaccana
IN WINDOWS
I have downloaded git-crypt.exe from here and placed it in the C:\Program Files\Git\cmd\git-crypt.exe ! This solved my issue !
Note: The git crypt repo now has windows binaries under releases
https://github.com/AGWA/git-crypt/releases/tag/0.7.0

unable to run 'aws' from cygwin

I'm using cygwin installed on Windows 10 and trying to access awscli from it.
I used pip install awscli to install awscli. This installed awscli. I then tried to run only aws to see if it is installed and I get the following error:
-bash: /cygdrive/c/Program Files/Anaconda2/Scripts/aws: C:\Program: bad interpreter: No such file or directory
I'm not sure why this is happening. Any help in this regard would be highly apreciated.
This is still an issue even with the latest version of AWS cli. So after some trial and error I found a pretty good workaround that will not make you switch your favorite shell.
First, make sure python is on your PATH. That is from anywhere in the system you can just run python and it work.
Find the aws script and open it for editing (for me it was located in c:\Program Files\Python36\Scripts\aws) and change the hashbang (that would be the first line in the script) to #!python.exe. For me it was set to #!c:\Program Files\Python36\python.exe. That space in the middle of Program Files caused the issue when that path got converted to Linux like path. Changing it to #!python.exe sidesteps the issue.
When you update AWS cli, repeat the workaround.
PS. You could also avoid this issue by installing python somewhere in a folder without spaces in path. That requires to reconfigure your system, so I did not do that myself.
I would install the standard python and ensure it is coming up first in your path with which python and which pip. Path issues like this are due to mixing and matching executables targeting different platforms in my experience. Certain commands do not implement functionality to convert paths from Windows to Linux and back (it appears your specific commands are failing on spaces).
Since you say you are on Windows 10, if you have the anniversary edition, I would recommend Windows Subsystem for Linux over cygwin. You will likely see less Windows issues on WSL since it uses the exact same ubuntu packages you would use on Linux instead of the cygwin port and maps them low level to the NT Kernel.
The Problem comes from "Program Files" having a space. This is something that is related to cygwin (I encountered the same error with git bash on windows). In a script I had something like this:
#!/c/Program Files/some_program/executable.exe
Escaping the space with a backslash or using quotes didn't work.
The solution is to use the DOS' short filename:
Progra~1 for "Program Files"
Progra~2 for "Program Files (x86)"
So my line would turn into:
#!/c/Progra~1/some_program/executable.exe
In Windows:
cd .. to go to home directory which shows pwd as /.
Now, cd to /cygdrive/c/Program\ Files/Anaconda2/Scripts
Now, run: python aws configure
Example:
user#user /cygdrive/c/Program Files/Anaconda2/Scripts
$python aws configure

Can openssh be installed on MSYS?

I'm using MSYS in windows 7 and now i need it to provide ssh server service. can openssh be installed in msys like it is in cygwin?
i can find ssh in /msys/bin, and it can be used as ssh client. but no server seems to be installed. how can i install one? i googled a lot but almost every theads leads to openssh in cygwin, that does not apply to my situation.
i compared cygwin and msys and decide to use msys. We need to run some applications both built and supposed to be ran in windows.
what i've tried:
mingw-get install mysys-openssh
test#WIN-L3L622JBT6G ~
$ mingw-get install msys-openssh
install: openssh-5.4p1-1-msys-1.0.13-bin.tar.lzm
installing openssh-5.4p1-1-msys-1.0.13-bin.tar.
install: openssh-5.4p1-1-msys-1.0.13-doc.tar.lzm
installing openssh-5.4p1-1-msys-1.0.13-doc.tar.
install: openssh-5.4p1-1-msys-1.0.13-lic.tar.lzm
installing openssh-5.4p1-1-msys-1.0.13-lic.tar.
test#WIN-L3L622JBT6G ~
$ openssh
sh: openssh: command not found
the package seems to be installed but i don't know how to find the service. do i need to link it or modify the profile?
The answer would be "NO".
Msys provide ssh client but not ssh server, as it's document indicates.
And Openssh cannot be installed on windows without cygwin. you can install a full cygwin and install openssh in cygwin. It's also feasible to only install partial cygwin.
Msys is outdated. Use Msys2, which does support sshd: https://www.booleanworld.com/get-unix-linux-environment-windows-msys2/

Running .sh file on Windows in git bash gives an error: Unable to find Digest::SHA or Digest::SHA::PurePerl

Good day to all!
While trying to build a fork of scala from github on my local PC and running
pull-binary-libs.sh in git bash I receive such an error:
Unable to find Digest::SHA or Digest::SHA::PurePerl
Trouble downloading 943cd5c8802b2a3a64a010efb86ec19bac142e40/lib/ant/ant-contrib
.jar. Please try pull-binary-libs again when your internet connection is stable
I can't figure out what's happening. I am a new bie to git, that's why maybe I am missing something. Any help will be appreceated.
P.S. I tried to install cygwin to ryn script from it, but I have problems during installation that constantly interrupt it. So I am using git bash instead.
UPDATE: I tried to install modules using СPAN. I even had successfully installed PurePerl and SH1 as CPAN messages reported. While trying to insall Digest::SHA I receive some errors connected with nmake. And while trying to run scripts again I get errors mentioned above.
It sounds like you are missing Perl modules that Scala's build system requires.
See How to Install CPAN Modules.

Resources