To exclude .svn directories from a recursive grep, use the –exclude option, for example:
$ grep --exclude='*.svn*' -R 'your.*search' .
To exclude .svn directories from a recursive grep, use the –exclude option, for example:
$ grep --exclude='*.svn*' -R 'your.*search' .
So I had an issue with KCachegrind where I would open a cachegrind profile file and “nothing happened”. The status bar said the file had loaded, but the user interface widgets were all empty. Turns out clicking Settings -> Sidebars -> Function Profile loaded the part of the UI I needed to get started… everything is easy when you know how!
Today I found this thread from which I learned:
svn co --config-option config:miscellany:use-commit-times=yes https://example.com/svn/repo/proj
You can also set the option in your svn config, but you probably don’t want to do that.
Found how to escape @ characters in Subversion managed file names?. The short answer is that you add an extra ‘@’ character at the end of the file name…
Today I learned about extensions.greasemonkey.fileIsGreaseable… a way to get Greasemonkey to process file-system documents… for scripts to work with file:// paths, you need to open about:config and set extensions.greasemonkey.fileIsGreaseable to true.
To update a config file:
$ cp old.conf updated.conf $ merge -A updated.conf new.conf old.conf
Then edit updated.conf and resolve merge conflicts then deploy updated.conf.
If you send non-printable characters to your TTY you might corrupt it, and that’s no fun.
So before you print log files which might contain dodgy data to a console clean it by piping it through tr like this:
tr -c '\11\12\15\40-\176' '?'
I had a problem with my rewrite rules, that looked like this:
DocumentRoot /var/www/trust.jj5.net RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) http://trust.jj5.net/sorry.html [L,R]
I was trying to redirect any request which didn’t match a file or directory. The !-f and !-d requirements were failing because the path to the REQUEST_FILENAME wasn’t fully qualified. I fixed the problem by including the DOCUMENT_ROOT:
DocumentRoot /var/www/trust.jj5.net RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d RewriteRule (.*) http://trust.jj5.net/sorry.html [L,R]
Happy days! :)
To download a file from the web and send its contents to standard out, try this:
wget -O - -o /dev/null https://www.unconfusable.com
I had a problem with my rsync backups. The problem was that the first time I ran it everything worked fine. The second time it ran (and all subsequent times) I got back the phone book of error messages, because the first time I’d run rsync it had copied in a whole heap of read-only files, and then when I ran it again it wasn’t able to overwrite those read-only files. At least I think that was what was happening. So I added the following to my backup script:
find . -type d -exec chmod u+x {} \; if [ "$?" -ne "0" ]; then echo "Cannot chmod directories in '$PWD'."; exit 1; fi find . -type f -exec chmod u+rw {} \; if [ "$?" -ne "0" ]; then echo "Cannot chmod files in '$PWD'."; exit 1; fi
This code runs after rsync and processes the files and directories that have been synchronised. That is, it processes the copy of the data, not the data I copied from.
For the copy of the data I want to make sure that the owner of the files can read and write them and that the owner of the directories can execute them. So that’s what the above code does.