Thursday, December 17, 2009

Show all files in finder

I needed to restore some files in /private/etc after deleting them. I know I should have had a backup before the delete, but I didn't. Anyway, to restore with time machine, you need to see the files in finder.

Open terminal and execute:
  • defaults write com.apple.Finder AppleShowAllFiles YES
  • sudo killall Finder
That's it, you can now see your hidden files. To revert:

defaults write com.apple.Finder AppleShowAllFiles NO
sudo killall Finder

Creds goes to these folks.

cups pdf printing on osx

I admit it, I love printing to PDF, and I get more than a little annoyed when it breaks. So, I just went through with some headaches to get cups-pdf working again for me. I had cups-pdf working just fine under 10.5.8 - going to 10.6 is where things changed. At the end of the day, I am fairly certain that I only needed to make sure I had configured my cups to print outside of a user directory e.g.

/opt/local/var/spool/cups-pdf/${USER}

I learned this little tid bit by trying to install cups-pdf from mac ports "sudo port install cups-pdf" the instructions helped a lot!

###########
As of Mac OS X 10.6, cups can no longer write into user

directories, so the output directory for cups-pdf has been
updated to reflect this.  cups-pdf will now write PDF files
into /opt/local/var/spool/cups-pdf/$USER .  You can create a
symlink to this location from Desktop to have it behave as
before:
   ln -s /opt/local/var/spool/cups-pdf/$USER ~/Desktop/cups-pdf

###########

Do this by editing your cups-pdf.conf

sudo vi /etc/cups/cups-pdf.conf

My line is now:

Out /opt/local/var/spool/cups-pdf/${USER}

Then you can make a sym link wherever you like e.g.

ln -s Out /opt/local/var/spool/cups-pdf/russellsimpkins /Users/russellsimpkins/cups-pdf

Of interest to you may be the web interface to your cups system, its located here http://localhost:631/

I had help along the way from http://www.codepoetry.net/projects/cups-pdf-for-mosx and as already mentioned the ports install of cups-pdf.

Wednesday, December 2, 2009

Setting up DAV SVN on Apache

I had to set up another SVN dav for a client today, but I have to admit that I don't do this every day. I use svn for my own stuff, but its been a while since I last set this up. Here are the steps I follow

1. Decide if this location will be a single svn dav or will there be multiple repos. If you host many projects under one dav, then you will get version numbers that are shared and increment with any change. I had this happen to me at Bluefly - its not the end of the world, but it can be a little annoying.

2. Create the folder and then the repo with

svnadmin create /folder/repo

Again, if you were to make your dav had multiple repos, you might just create /folder/repos and then do

svnadmin create /folder/repos/repo-1

3. I'm guessing you aren't going to leave your repo to just anyone, so go ahead and create an htpasswd file to at least secure PUT requests.

htpasswd -bc .svnaccess-file svn-user s3cr3tPwd

4. Modify your apache config. I bet you could do this in an .htaccess file, but I didn't try that yet.


    <Directory "/folder/repo">
       Options Indexes FollowSymLinks
       Order allow,deny
       Allow from all
    </Directory>
    <Location /svn-repo>
     DAV svn
    # This is for a single repo
     SVNPath /folder/repo

     # Limit write permission to list of valid users.
     <Limit GET PUT PROPFIND OPTIONS REPORT>
        AuthType Basic
        AuthBasicProvider file
        AuthUserFile /home/axiomgroup/.svnaccess
        AuthName "Log into the SVN Repo"
        require user svn-user
     </Limit>
    </Location>


That's about it. If you don't secure PUT, then you won't know who made the repo changes. If you remove GET from the Limit option, then your repo will be open to anyone to downlaod from.

If you were to put multiple repos under this one DAV location, then you would want to use SVNParentPath over SVNPath