Salt file.recurse source file not found (file encoding issue)

So I was running this:

    - clean: True
    - user: root
    - group: root
    - dir_mode: 755
    - file_mode: 644
    - source: salt://inst/mediawiki-1.29
    - require:
      - pkg: apache2

And getting an error like this:

          ID: /var/www/
    Function: file.recurse
      Result: False
     Comment: #### /var/www/ ####
              Source file 'salt://inst/mediawiki-1.29/vendor/james-heinrich/getid3/getid3/' not found

              #### /var/www/ ####
              Source file 'salt://inst/mediawiki-1.29/vendor/james-heinrich/getid3/getid3/' not found
     Started: 14:27:18.352264
    Duration: 134735.945 ms

The issue was that the source files mentioned weren’t in UTF-8 format. To convert the files I ran, e.g.:

$ iconv -f WINDOWS-1252 -t UTF-8//TRANSLIT < >

(Actually I couldn’t get the ‘iconv’ command to work so I edited manually in Vim)

If Apache2 won’t serve your JavaScript file try…

I had an issue with Apache2 improperly serving a JavaScript file which I seem to have fixed by making sure the file was terminated with a new-line character… this was really hard to diagnose and resolve! The behaviour in Firefox was that the file just didn’t finish to download, whereas the Apache2 logs indicated a 200 result… I think it may have had something to do with automatic compression, which is a dark art that I do not understand (mumbles something about mod deflate…).

KCachegrind doesn’t open cachegrind profiler log file

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!


I had a problem with my rewrite rules, that looked like this:

  DocumentRoot /var/www/
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule (.*) [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/
  RewriteEngine On
  RewriteRule (.*) [L,R]

Happy days! :)