How to apply Magento security patches in xampp for windows - magento

That must not be so difficult to do, I installed Magento CE 1.9 on xampp for windows. it works well.
I need to apply security patches that come only as .sh files, no other format is available.
I have the file, how can I apply it gives that I don't find a way to execute the .sh files under this environment?
thanks all

1) My windows has sh.exe available and can run .sh files - just type it into the command line, git bash works fine too.
UPDATE: my sh.exe was likely installed along with git. It is relatively easy to install though.
2) On windows machines you may need to edit the PATCH-... file. Find the CURRENT_DIR=``$PWD_BIN``/ line. Since you will be running it from the magento root directory anyway this can be left blank. Go ahead and remove everything after the equals sign. It should now read CURRENT_DIR=. See here for an explanation.
3)Now just move the file into your magento root directory and run it.

Try the Below Link Using Git-bash in Windows :
Magento Patch File Installation in Windows

Cygwin will help you to run the sh file.
cygwin
How to use Cygwin

Better you use git bash instead. Just go at the Magento Root and run {sh Patch_file.sh}.

Related

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.

How to open gnuplot from mobaxterm?

I'm not sure how to open Gnuplot from MobaXterm. I've been trying many different commands but they all don't work. When I try, I get the same error.
-bash: gnuplot: command not found
I'm curious if I downloaded Gnuplot to the wrong part of the computer or if I'm not getting the command right? I'm trying to write a program in shell script that opens Gnuplot on it's own and plots data through the shell script.
Any help is appreciated!
mobaxterm is not a linux server. So you cant install packages into it normally.
you must download plugins if you can find the plugin you are looking for
check their list here
http://mobaxterm.mobatek.net/plugins.html
and it seems gnuplot is not there .
in this case your easiest solution is to download cygwin and add gnuplot on it which is possible
other option is to run small virtual machine so you can test on it
in all cases mobaxterm is not real linux enviroment so to be sure your shel do work on normal linux machines you will need to develop and test on real linux
You can install the winbuild of gnuplot and add the path to the bin directory, with gnuplot.exe in it, to mobaxterm's PATH (probably set it in .initrc or .bashrc, whichever you prefer).
MobaXterm is a standalone program which 'emulates' a Linux terminal but has no idea about your frame system (e.g. your Windows and your programs). So if you type 'gnuplot' Moba has no idea what is this. You have to
change the current directory to where is wgnuplot.exe e.g.:
cd /drives/c/Program\ Files/gnuplot-4/bin
./wgnuplot.exe
or run directly it:
/drives/c/Program\ Files/gnuplot-4/bin/wgnuplot.exe
or change your $PATH:
PATH=$PATH:/drives/c/Program\ Files/gnuplot-4/bin
wgnuplot.exe
or create a script named 'gnuplot' which runs wgnuplot.exe
#File name: 'gnuplot'
#!/bin/sh
/drives/c/Program\ Files/gnuplot-4/bin/wgnuplot.exe
and place it into some $PATH directory:
`/bin` or `/usr/bin` or `/drives/c/WINDOWS` or `/drives/c/WINDOWS/system32`
or... :)
The simplest way I found out is to use the Moba Package Manager to install the win version of gnuplot.
Open MobaXterm and type MobApt. An GUI will open up and you can type in "gnuplot" in the filter field.
Just select and install the package, MobApt will take care of any dependencies for you.

How do I use git-new-workdir on windows?

I have a repo that has two branches, which i would like to work on simultaneously.
After some reading I found git has a script git-new-workdir.
Im trying run use the script from the git for windows bash but get the following error.
$ git-new-workdir
sh: git-new-workdir: command not found
How do I use this script on windows?
Due to some of the commands in the git-new-workdir functions not existing on windows, the script won't work.
I have found this windows port of the script. Works great for me.
https://github.com/joero74/git-new-workdir
Git 2.5 (Q2 2015) will replace contrib/workdir/git-new-workdir with an official native Git command which works on any OS (including Windows).
The release notes mentions:
does not rely on symbolic links and make sharing of objects and refs safer by making the borrowee and borrowers aware of each other.
That is because the multiple working trees are "linked", or actually recorded in the main repo new $GIT_DIR/worktrees folder.
See "Multiple working directories with Git?" for more.
On my installation, the script file is located in /usr/share/git/contrib/workdir/git-new-workdir.
Perhaps if it's not installed in that version of git, you can just download its raw form and run it with bash /path/to/git-new-workdir. At your preference you can also install it in /usr/local/bin changing permissions when necessary.

How to install Magento using comand line on local computers

How can I install Magento using command-line?
I tried to install Magento using command-line but I wasn't successful, so I would just like to know if it's possible to use command-line to install Magento on my local PC.
This is documented on Installing Magento Via SSH
Dunno about "command line". Magento for the most part is a simple drag'n drop by scp/sftp/ftp if you expand the archive on the remote workstation.
Of course you could also just stuff the install archive on the web server document root via scp/sftp/ftp and then issue tar -xzf/gunzip/unzip and expand the archive there to expand out the Magento application directory/file structure.
Either way, for manual install, it's just an archive that's dearchived by the usual standard means.
On your local "PC", you will probably be using 7-zip if it's Windows based.
Of course this all depends on something really basic, have you set up a fully functional server running Apache, MySQL and PHP for this??? and what OS is this "PC" running?

msysgit error with hooks: "git error: cannot spawn .git/hooks/post-commit: No such file or directory"

I'm having trouble getting post-recieve and post-commit hooks to work correctly with msysgit (Windows 7 Pro/32 and Ultimate/64). For post-commit hook I get the above error if I commit from either git-bash or the console, but it works fine if I commit through git-gui. For a post-recieve hook, all three give the same error.
I'm thinking this is some sort of permission or path error, but don't really have any clue where to start here.
Add the SHEBANG to the first line of hook, like so:
#!/bin/sh
echo "executing post-commit"
exit 0
This had me stumped for a while as well and I saw that adding the shebang fixed it. In SVN world, while in *nix we have a "pre-commit" script and in Windows we had "pre-commit.bat" and SVN automatically picked up the bat file in Windows. Git doesn't seem to pick up a pre-commit.bat ( or any hook ) and adding the shebang to the hook file worked.
I'm using SourceTree and git LFS and had a similar issue: cannot spawn .git/hooks/pre-push.
The fix was to delete the pre-push file (opening it revealed it was badly corrupted) and restart SourceTree at which point it regenerates the pre-push file and everything is back to normal.
If you have the SHEBANG and it still fails, make sure you have <path_to_git>\bin set in your path environment variable.
You'll probably also have <path_to_git>\cmd if you installed it to work from the command-line.
This is an old question, but I've been fighting with this exact problem and this SO question popped up, so I thought it worth the effort to record what worked for me.
In short: I needed to run Apache as a regular user instead of Local System. This was on a legacy test VM I was playing with, so it was only running Windows XP, but it appears that at least on that platform (and possibly others), msysgit just doesn't work properly when running under the Local System account (presumably the root filesystem isn't mapped properly). As a result, no shebang line will work as git-http-backend simply can't execute any msysgit binaries (even with absolute Windows paths).
Switching Apache to run as a regular user account fixed this problem completely. Obviously you need to ensure that the user Apache is running as has permissions to read/write the git repositories, but beyond that, just make sure your shebang line is #!/bin/sh and everything should be copacetic.
Lastly, yeah, this is a big hammer. Ideally you'd be able to use something like suexec on Windows, but a quick googling doesn't indicate an obvious path forward, there. Of course, if anyone has any ideas, I'd be interested.
For now, this works for me, but it doesn't seem ideal.
Got this in a repo using LFS, got rid of it with git lfs update --force
If someone, like me run into a similar problem with accessing git repositories through apache, you should set the PATH in Apache config, like:
SetEnv PATH "c:/Program Files (x86)/Git/bin;"
Using tortoisegit and LFS, for me just had to remove the files inside of the .git/hooks folder.
If you are using Android studio, you can remove this error by un-check the checkbox "Run Git hooks":
For me, removing a comment line on front of the shebang line fixed the error. Oddly, the script ran fine from the shell, just errored out when run as a hook.

Resources