Due to lack of privileges/permissions/influence/power/charm/money, I am unable to install the full Cygwin at my works computer. So instead I make do with
portable Cygwin.
I was horrified to discover that good old diff.exe is missing from portable Cygwin.
Why is it missing?
Where can I get it from?
What else is missing?
The Baby Cygwin suggestion didn't work - kept getting core dumps.
My solution was to write a wrapper "diff" script in /usr/local/bin, which had something like:
F1=$( cygpath -w $1 )
F1=$( cygpath -w $2 )
/cygdrive/c/Windows/System32/fc.exe ${F1} ${F2}
The output is similar to "diff -c ".
Not ideal. Still no one can tell me why Portable Cygwin is missing this command.
Perhaps you can try my
Baby Cygwin
It has diff.exe
Related
I've ubuntu 16.04 and i've installed perl 5.8.7,5.18.2 both with threads activated, and 5.18.1 without threads.
The purpose was to use a version of Perl with threads instead of forks as i've mutiple scripts already done with threds and forks is not a proper multi-threading models (it just forks processes).
The first problem i get is when installing modules via cpanm -fi [name_of_module] command. As a matter of fact the command doesnt' return anything at all! just 'Perl'. The same fact happens when i'm traying to instal wathever modules i desire using in my scrips.
I think this problem is linked with the fact i'm able to use ''treads'' just when i run the scripts without sudo (e.g.perl [name_of_the_script]), while when i run it with 'sudo perl [name_of_the_script]' says 'the current version of Perl doesn't support threads'!
That's quite strange.
The perlbrew enviroment veriables are set up correctly and when i type ''which perl'', the system poits to the new-version directory as expected.
Dont' know how to proceed
I see that you posted several question in one paragraph. I'll try to answer the onse that I could.
cpanm -fi XXX does not "return anything at all"
I'm not sure I get this part. If XXX failed to be installed, there should probably be some error messages on the screen. The fact that perlbrew list-modules prints nothing but Perl implies that probably nothing is installed.
It could be that your cpanm execuateble is implicityl installing stuff for system perl instead. You could verify this by checking the first line of head =cpanm. If it is not #!/usr/bin/env perl, it is probably wrong. You want the one installed by: perlbrew install-cpanm
sudo perl
I wonder if you PATH is actually correctly set -- Running perl -V after perlbrew use 5.8.7 can show you enough version information and therefore tell you whether perlbrew itself is working properly.
You probably also need sudo -E perl instead. sudo reset env vars unless you ask it not to (the -E option), and PERL5LIB is probably needed.
I have a regexp using grep which I use to get the latest directory matching it.
Any chance I get a equivalent command as the one below to work on a windows machine?
ls | grep -E "20[0-9]{2}-[0-1][0-9]-[0-3][0-9]-[0-9]{0,5}" | tail -1
I would appreciate any help.
Installing cygwin will give you a nearly linux like shell environment. When you set the cygwin bin into your windows PATH you can even build the pipe like that in a CMD. I can't say anything about the unix like stuff that newer windowses are supposed to bring along though.
in the picture below you can see that it says chmod command is not found yet it has chmod installed. I am installing metasploit directly from the terminal(I did not install any desktop environment and don't want to run msf from there). Is there any way to solve this? I would gladly appreciate any replies.
Instead of using that command, use this instead
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall
Remove the backslashes from the composite Bash command, they're used in Linux to escape the space character. For example, ỳou would have to type:
cd ~/Documents/My\ Folder
to access
~/Documents/My Folder
By writing the command the way you did you were looking for the ' chmod' command instead of 'chmod', you've basically inserted a space before the command name.
I'd suggest studying Linux Bash scripting before venturing into Metasploit.
You would otherwise continually stumble against this kind of issues, also if you'd like to work with Metasploit from its command console it's pretty much mandatory to study Linux Bash scripting (and the Linux OS as a whole).
I've got a problem with ANSI escape codes in my terminal on OpenSuse 13.2.
My Makefile use to display pretty colors on OSX at work but at home when I use it I get the litteral termcaps such as \033[1;30m ... \033[0m
I know close to nothing about termcaps, I just found these escape characters that seemed to be working fine ! The strangest is that both my OSX and Linux terminal are configured with TERM=xterm-256color so I really don't know where to look for the correct setting I'm currently missing on Linux.
TL;DR: How to get escape codes such as \033[1;30m working in Konsole with xterm-256color ?
Edit: Here's a snippet of the Makefile I am talking about:
\Here's a snippet of the Makefile I am talking about:
# Display settings
RED_L = \033[1;31m
GREEN_L = \033[1;32m
GREEN = \033[0;32m
BLUE = \033[0;34m
RED = \033[0;31m
all: $(OBJ_DIR) $(NAME)
$(OBJ_DIR):
#mkdir -p $(OBJ_DIR)
$(NAME): $(OBJ)
#echo "$(BLUE)Linking binary $(RED)$(NAME)$(BLUE).\n"
#$(CC) -o $# $^ $(LFLAGS)
#echo "\t✻ $(GRAY)$(CC) -o $(RED)$(NAME)$(GRAY) object files:$(GREEN) OK! √\n$(NC)
The example which you gave does not rely upon the setting of TERM (unless it is going someplace other than the terminal, e.g., via some program which interprets it such as the ls program, which has its own notion about colors). It would help if you quoted the section of the makefile which uses the escape sequences. Without that, we can offer only generic advice, e.g,. by assuming you have an echo command in the makefile.
The place to start looking is at the shell which your makefile uses. One would expect bash to be the default shell on OpenSUSE. But suppose you are actually using some other shell which happens to not recognize the syntax you are using, and trying to do something like
echo '\033[1;34mhello\033[m'
To help ensure that you are using the expected shell, you can put an assignment in your makefile, e.g.,
SHELL = /bin/sh
This assumes that /bin/sh itself is going to work as intended. However, that is commonly a symbolic link (for Linux) to the real shell. If so, one possible solution would be to change the real shell using OpenSUSE's update-alternatives feature to change the shell to bash (or zsh).
For additional information, see the discussion of SHELL in the GNU make manual.
Reflecting comments on the version of make -- GNU make 4.0 is known to have incompatible changes versus 3.81, as noted in the thread GNU Make 4.0 released on LWN.net. In particular, there are several comments relating to your problem, starting here.
However, checking a recent Fedora, it seems that the problem really is that the default behavior for echo has changed. As noted in other discussions (such as Why doesn't echo support “\e” (escape) when using the -e argument in MacOSX), this was done to improve POSIX compatibility. You can get your colors back by adding a -e option to the echo commands.
I finally found the solution:
the problem was I used echo instead of echo -e which seems to be the default behaivour on Mac OSX.
Thanks for your help though, it lead me to good lectures :)
I've been working at this all morning and I still can't find a way to easily bind a key to compile my program from the Windows version of gVim using the Cygwin GCC, and then run it. I'm kind of a novice to Bash scripting, and I haven't been able to make it create the .exe in the home directory (C:/cygwin/home) and then run it.
What I have so far:
map <F4> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
exec "!gcc /home/%:t && cd C:/cygwin/home && ./a.exe"
endfun
This would work all well and good, except that when I go to the home directory, the a.exe is not there. Compiling using gcc from the bash script .bat in cygwin works fine... but not from gVim.
Thanks for all help in advance.
check this plugin.
it seems to be what you want.
I haven't tested it though.
For mono-files projects, you don't need any makefile. Thus, as long as gcc and make are in your $PATH, and you are in the directory where the current source file comes from, you "just" have to type:
:update
:make
If your program has no error, a simple !./%< will do.
Otherwise, you may then have to execute a :copen to see compilation errors. If you have any, you'll notice some pathnames in *nix format. Unfortunately (g)vim-win32 is unable to understand them. That where my old cygwin compiler plugin skeept told you about comes into play. In order to support any compilation-like program (and not just make), it evolved into BuildToolsWrapper -- its installation will require lh-vim-lib, and may be a few other plugins of mine (system_tools, searchinruntime).
With it, just do once a :BTW add cygwin before you play with :make, or even :Make that BTW defines. This new command will do a :update! before calling :make with a automagically determined target. NB: BTW maps Make and the execution of the current project executable to <F7>and to <C-F5>.
PS: if you have have several files in your project, define a Makefile, and play with :make, that's all.
PPS: you may also be interested into cyg-wrapper.sh that helps to correctly open gvim-win32 from cygwin shell.
Basically, when gcc runs it produces binary right in the working directory. If you want to place the output binary in a different directory you have to pass the -o options. So the command should be either of these:
exec "!gcc -o C:/cygwin/home/a.exe /home/%:t && cd C:/cygwin/home && ./a.exe"
exec "!cd C:/cygwin/home && gcc /home/%:t && ./a.exe"