Unable to create vagrant file (homestead.yaml) on windows - laravel

I'm gonna to use vagrant on my windows desktop to develop Laravel project. I have followed all the steps to do that. But it has been failed to create homestead.yaml using bash init.sh command.
Below is the error :
Fakhreddin#Lenovo-PC3 /cygdrive/d/laravel-vagrant/homestead
$ bash init.sh
cp: unwritable ‘/home/Fakhreddin/.homestead/Homestead.yaml’ (mode 0500, r-x------); try anyway?
I'm using Cygwin for simulating Unix terminal in the Windows.

(Copy of the comment I wrote above)
Never used Cygwin in my life, but what I would try is to run it as Administrator and re-try.
Otherwise, you may want to consider changing console client. For example, if you install Git, you should be able to use Unix commands via standard Windows console.
I would seriously point the fault at Cygwin, or its settings. I am a member of a team in which all of us run Homestead on Windows 7, with no problems at all. The difference is, we use native Windows command line.

Related

Running Electron with Linux on Windows

I'm trying to get an electron forge app running on my Windows 10 machine via Linux on windows (using the new built-in windows bash functionality).
When running electron-forge start I am getting back the error message:
[1484:1126/222326.466455:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /mnt/c/.../node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
From some searching, this thread on the electron Github makes it pretty clear that this is somewhat by design and the way to get around it is to run chmod as a root user post-installing all of the dependencies.
I attempted to do this and the command looked like it had worked (no error on running the chmod to 4755), but that didn't fix running electron-forge start - I still got the same error message. I looked into that a bit and it seems that this has to do with what files the linux subsystem are allowed to control permissions for per this Microsoft thread.
Is there some other trick to getting electron forge to work with bash on Windows?
I found that running the electron-forge init from Windows powershell into a native Windows directory allowed me to subsequently use npm start in my-app (for example) in WSL. So ultimately what I ran was
powershell npx create-electron-app my-app
(I have alias powershell="/mnt/c/windows/system32/WindowsPowerShell/v1.0/powershell.exe" in my .bashrc file)

Silent/Automated Homebrew Install

I am trying to get homebrew installed remotely on a machine without a terminal open and without ssh access to the machine. Our company uses a Directory-as-a-Service which allows us to remotely push shell scripts to our computers which is great, but it requires the scripts to have no interactivity.
Is there a way to automate the installer and remove the “Press enter to continue” prompt in the install process?
Thanks,
Zach S
The env variable CI seems to silence this prompt:
export CI=1

Command not found in bas

I'm so sorry because I know this is a dumb question, but I've been trying to figure this out for about 2 hours and I can't figure it out. I've created a bash file that uses some other programs (tcpdump, tshark). The bash runs as it should but on every line that I use tshark, tcpdump, etc. it says "command not found".
I'm using Cygwin on my Windows 7 VM. All of the files are in the same folder and I I've tried adding the locations of the other programs to the PATH variable. I tried commands such as export PATH=$PATH:filelocation but when I do $PATH those results aren't showing. How can I get these commands to be recognized?
Thank you.
current errors
Cygwin is not a Linux distro, therefore, you don't have all the functionality like you would if you had a Linux installation.
You could try one of the following.
1) Use Virtualbox to make a VM of some Linux distro and use bash there. You could use Ubuntu server, which has no GUI.
2) Use this site to find packages that will add functionality to Cygwin.
3)Upgrade to Windows 10 and have a native (sort of) bash to use.

svn version control authentication fails when run from emacs

I'm using on my desktop native windows emacs 24.2 configured to use cygwin bash.
When I run SVN from cygwin bash everything works fine. It remembers my authorization credentials and connects to a repository. But when I try to run any version-control command from within emacs I always get the following message:
svn: E170001: Unable to connect to a repository at URL
'https://address.to.repo' svn: E170001: OPTIONS of
'https://address.to.repo': authorization failed: Could not
authenticate to server: rejected Basic challenge
I tried also connect with PSVN interface which also ends up with the same error message. It is somehow strange that it does not work the same way from cygwin terminal and emacs. Any help on this would be appreciated.
Solved now. The problem was that Emacs NT cygwin integrated was still using windows HOME path instead of using cygwinized HOME directory.
I think the full answer should be something like this:
SVN depends on the HOME path to find its per user settings (as most unix programs).
In cygwin that varible has something like "/home/pablo".
"/home/pablo" is really translated "drive:\cygwin_dir\home\pablo"
Emacs-nt grabs its HOME from the windows environment so it is a different HOME than cygwin's
emac's vc-svn uses the wrong path to look for its settings.
So there are two solutions (maybe more):
Make emacs-nt use the cygwin's HOME (so thats what cygwinization means!! :O), you need setup-cygwin for this, but specially you need one script it depends on cygwin-mount. So emacs-nt can understand cygwin's path "style".
(not recomended) The other way around, which is what I did, make cygwin use the window's HOME through a soft cygwin link. ln -s /cygdrive/c/Users/pablo/Roaming/ /home/pablo
Make a soft link so the cygwin's subversion dir points to the windows one ln -s /cygdrive/c/users/pablo/AppData/Roaming/.subversion /home/pablo/.subversion
The second solution WILL lead to cygwin's ".bashrc" not executed. So environment variables and aliases defined there won't be define. I still think that it can be done, but I don't have the proper cygwin knowledge needed to tweak that solution. So right now I'm using the solution number 3.

Run a windows xp bat script remotely from a ubuntu machine

Is it possible to run a windows xp bat script remotely from a ubuntu machine via command line?
This is possible if you have an ssh server running on the WinXP machine. It is trivial to set up such a server if you have installed Cygwin. This is well described here.
Then from an Ubuntu command line (or cron job) you run
ssh user#winxp command
Make sure your .bat has executable permissions.
I think that the technology you are after is WMI. I see that there is an ubuntu package called wmi-client, which you can sudo apt-get install and attempt to you. Some quick searches and I'm unable to find details, but maybe that will get you somewhere....
You would probably use something like remote desktop, and if you did it that way, it would work, but your question isn't very specific

Resources