How can I attach a patch.diff-file from sourceforge.net? - patch

I found a patch that will fix a bug in my PyOpenGL-program
here.
But I have no idea how I can install this patch in arch-linux.
Can anyone help me ?

First of all, this has nothing to do with python or openGL, so you might want to remove those tags.
You are looking for the patch-utility and then, in the directory that contains the src-folder, do something like
patch -p0 -b < patch-py33-import.diff
The -b switch creates backup files before patching, the -p switch tells patch to use the complete path/filename that are given in the patch file.

Related

Zsh (Wsl) can not response when cd command into the specified directory

I have the problem about zsh (wsl) in windows 11, when I cd into the specified directory, only that folder, my zsh doesn't response, and I have to ctrl+c every time I want to type the next command. I don't know what this problem is, and how to fix this. My PowerShell still works normally, only zsh encounters this error. Anyone can help me pls?
I try waiting some minutes and this evently responses, this folder is my repo git in windows, i use zsh to cd into this, and it takes me quite lots of time to enter this folder. How to fix this problem?
I found out in many webs to look for any solution to fix or improve this problem, and i evently also found 2 ways for this.
First, change the line "disable_untracked_files_dirty" into true in your .zshrc file.
Second, if you're using powerlevel10k, add this line "typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet" into the .p10k.zsh file if you're using this file to config your powerlevel10k, or add this line "POWERLEVEL9K_INSTANT_PROMPT=quiet" into your .zshrc file if you're using .zshrc to config your powerlevel10k.
Hope to help

Where is server.conf file kept openCPU ubuntu

Sorry if this is answered elsewhere, or requires a trick.
I have installed openCPU on an ubuntu xenial-16.04 instance. I'd like to lengthen the timelimit.post value as instructed in the /etc/opencpu/server.conf file. Trouble is I can't find it.
ubuntu#ip-x-x-x-x:/usr/lib/opencpu$ ls -a
. .. library rapache scripts
Maybe please check again to see if you don't find /etc/opencpu/server.conf in the expected directory - i.e. because, as above in your output of ls -la /etc/opencpu/, the server.conf file is listed being there. Note though the owner is root so take that into account when you try to open+edit the file.

Current configured path for make install

How do I find the current configured path for make install?
The resources that I have read till now only describe how to overwrite it.
configure creates a file called config.log this contains near the top the configure command with the arguments that was run. You should find your --prefix argument there.
Otherwise grepping for PREFIX should get you a result.
Another solution is to use make -n install which would perform a dry run and print what make install would do without doing it.

Adding --ignore-failed-read to tar causes "unknown function modifier" error

I'm using the tar command in UNIX to perform backups of particular directories. However, some directories contain files/sub-directories which the current user doesn't have any read permissions on. As a result the tar command is returning a non 0 exit code.
I came across the following modifier in the man pages '--ignore-failed-read', which suppresses the non 0 exit code when encountering files it cannot read. However, whenever I try using it I get the error 'unknown function modifier'.
Could anyone help me out here?
my tar command looks something like this:
tar --create --ignore-failed-read --file=test.tar my_dir
Your command seems to be perfectly valid and I don't see any typos/mistakes.
To be absolutely sure, I just tried it on my VM running under 32 bit Debian 7.1 (wheezy) with stock kernel 3.2.0.4. As I suspected, archive has been created successfuly (the only change was, of course, the name of the source directory). I also checked version of my tar with
tar --version
which gave me following output:
tar (GNU tar) 1.26
First of all, you should check this info. If you get the same (with possible difference in version number) output, that's fine. If not (or version that seems much older), it's possible, that you are using tar, which simply doesn't support this feature.
Also, you can check, if your tar really DOES support mentioned flag. To do this, type into console:
tar --help | grep ignore-failed-read
You should see something like this:
--ignore-failed-read do not exit with nonzero on unreadable files
If output stays empty, that means this version of tar does not know this flag at all.
See if any of the above helps.
Another option that might work better in this case is --warning=no-file-changed.
tar --warning=no-file-changed -czf backup.tgz dir1 dir2
--warning controls the display of warning messages. You can add no- to the message keyword to suppress it. So in this case no-file-changed suppresses the file-changed warning.
c.f. https://www.gnu.org/software/tar/manual/html_section/tar_27.html

Zsh wants to autocorrect a command, with an _ before it

I just started using Zsh lately for some of the integrated support in the shell prompt for my Git status etc.
When I type in:
ruby -v
to confirm the version of ruby I'm running, Zsh asks if I want to change the command to _ruby. Well after saying no at the prompt and the command completing as expected I continue to get the question at the prompt after confirming my command is correct.
I'm assuming there is a completion file or something of the sort.
Thanks
Update:
The shell is no longer trying to complete _ruby, it stopped responding after closing the shell a few times some how.
I tried to clean the file up several times but there is a "opts" variable that is 50 or more lines long and the lines are all ran together, some lines more than 150 characters. Maybe I could email an attachment to you if you still want to see it.
I sincerely apologize for the messy post.
This is command autocorrection, activated by the correct option. It has nothing to do with completion. You're seeing _ruby because zsh thinks there is no ruby command and it offers _ruby as the nearest existing match.
If you've just installed ruby, it's possible that zsh has memorized the list of available command earlier, and it won't always try to see if the command has appeared in between. In that case, run hash -rf. Future zsh sessions won't have this problem since the ruby command already existed when they started.
Sometimes, when you change your PATH, zsh forgets some hashed commands. The option hash_listall helps against this. As above, if you can force zsh to refresh its command cache with hash -rf.
You could make an alias:
alias ruby='nocorrect ruby'
It's what I did when zsh kept asking me if I meant .meteor when I typed meteor because auto-correct is still useful from time to time.
I find the autocorrect feature can get annoying at times. So I do in my ~/.zshrc,
DISABLE_CORRECTION="true"
I had the same problem even when the command is not installed.
I can solve it using the CORRECT_IGNORE variable in my .zshrc
# OPTs to enable
setopt HASH_LIST_ALL
setopt CORRECT
# Zsh variable to determine what to ignore,
# in this case everything starting with _ or .
CORRECT_IGNORE="[_|.]*"
I hope it helps to you or anyone with this issue
Sometime ago after an update, I got command auto-correction enabled which I don't want. If the same happened to you and you want to revert it, in the ~/.zshrc file you'll have make it:
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
or comment it as per bellow:
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
Just a note, on my zsh (version 5.7.1 on macOS), the DISABLE_CORRECTION didn't work.
I saw in my .zshrc file the following two lines, which I then commented out
setopt CORRECT
setopt CORRECT_ALL
That did it for me.

Resources