Thursday, November 30, 2006

File under: What WebSVN should have shipped with for Windows.

(Edit: adding links)

I recently deployed FogBugZ and got it integrated with my company's Subversion server. A piece of this was installing WebSVN so that the cool automagically-appearing links to sources and diffs would take users to useful web pages. I noticed the other day when I tried to diff versions of an RTF file that I got all kinds of formatting goo in my diff. That didn't make me happy. The solution was to set the svn:mime-type property on non-text files in our repository.

In the interests of community, I give you my batch file to automate those changes. It doesn't do the svn commit - you'll have to do that yourself or modify the batch file.

If anyone knows how to automatically have this happen on new files (autoprops is a per-client setting in the config file), please let me know.


@echo off
' This batch file adds svn:mime-type properties on non-text files.
' NB: The lines with file extension and mime types must start with two apostrophes
' and must have spaces between the apostrophe and the extension and between the extension
' and the mime type.
' Drew 11/30/06
'' 323 text/h323
'' acx application/internet-property-stream
'' ai application/postscript
'' aif audio/x-aiff
'' aifc audio/x-aiff
'' aiff audio/x-aiff
'' asf video/x-ms-asf
'' asr video/x-ms-asf
'' asx video/x-ms-asf
'' au audio/basic
'' avi video/x-msvideo
'' axs application/olescript
'' bcpio application/x-bcpio
'' bin application/octet-stream
'' bmp image/bmp
'' cat application/
'' cdf application/x-cdf
'' cer application/x-x509-ca-cert
'' class application/octet-stream
'' clp application/x-msclip
'' cmx image/x-cmx
'' cod image/cis-cod
'' cpio application/x-cpio
'' crd application/x-mscardfile
'' crl application/pkix-crl
'' crt application/x-x509-ca-cert
'' csh application/x-csh
'' css text/css
'' dcr application/x-director
'' der application/x-x509-ca-cert
'' dir application/x-director
'' dll application/x-msdownload
'' dms application/octet-stream
'' doc application/msword
'' dot application/msword
'' dvi application/x-dvi
'' dxr application/x-director
'' eps application/postscript
'' etx text/x-setext
'' evy application/envoy
'' exe application/octet-stream
'' fif application/fractals
'' flr x-world/x-vrml
'' gif image/gif
'' gtar application/x-gtar
'' gz application/x-gzip
'' hdf application/x-hdf
'' hlp application/winhlp
'' hqx application/mac-binhex40
'' hta application/hta
'' htc text/x-component
'' htm text/html
'' html text/html
'' htt text/webviewhtml
'' ico image/x-icon
'' ief image/ief
'' iii application/x-iphone
'' ins application/x-internet-signup
'' isp application/x-internet-signup
'' jfif image/pipeg
'' jpe image/jpeg
'' jpeg image/jpeg
'' jpg image/jpeg
'' js application/x-javascript
'' latex application/x-latex
'' lha application/octet-stream
'' lsf video/x-la-asf
'' lsx video/x-la-asf
'' lzh application/octet-stream
'' m13 application/x-msmediaview
'' m14 application/x-msmediaview
'' m3u audio/x-mpegurl
'' man application/x-troff-man
'' mdb application/x-msaccess
'' me application/x-troff-me
'' mht message/rfc822
'' mhtml message/rfc822
'' mid audio/mid
'' mny application/x-msmoney
'' mov video/quicktime
'' movie video/x-sgi-movie
'' mp2 video/mpeg
'' mp3 audio/mpeg
'' mpa video/mpeg
'' mpe video/mpeg
'' mpeg video/mpeg
'' mpg video/mpeg
'' mpp application/
'' mpv2 video/mpeg
'' ms application/x-troff-ms
'' mvb application/x-msmediaview
'' nws message/rfc822
'' oda application/oda
'' p10 application/pkcs10
'' p12 application/x-pkcs12
'' p7b application/x-pkcs7-certificates
'' p7c application/x-pkcs7-mime
'' p7m application/x-pkcs7-mime
'' p7r application/x-pkcs7-certreqresp
'' p7s application/x-pkcs7-signature
'' pbm image/x-portable-bitmap
'' pdf application/pdf
'' pfx application/x-pkcs12
'' pgm image/x-portable-graymap
'' pko application/
'' pma application/x-perfmon
'' pmc application/x-perfmon
'' pml application/x-perfmon
'' pmr application/x-perfmon
'' pmw application/x-perfmon
'' pnm image/x-portable-anymap
'' pot, application/
'' ppm image/x-portable-pixmap
'' pps application/
'' ppt application/
'' prf application/pics-rules
'' ps application/postscript
'' pub application/x-mspublisher
'' qt video/quicktime
'' ra audio/x-pn-realaudio
'' ram audio/x-pn-realaudio
'' ras image/x-cmu-raster
'' rgb image/x-rgb
'' rmi audio/mid
'' roff application/x-troff
'' rtf application/rtf
'' rtx text/richtext
'' scd application/x-msschedule
'' sct text/scriptlet
'' setpay application/set-payment-initiation
'' setreg application/set-registration-initiation
'' sh application/x-sh
'' shar application/x-shar
'' sit application/x-stuffit
'' snd audio/basic
'' spc application/x-pkcs7-certificates
'' spl application/futuresplash
'' src application/x-wais-source
'' sst application/
'' stl application/
'' stm text/html
'' svg image/svg+xml
'' sv4cpio application/x-sv4cpio
'' sv4crc application/x-sv4crc
'' t application/x-troff
'' tar application/x-tar
'' tcl application/x-tcl
'' tex application/x-tex
'' texi application/x-texinfo
'' texinfo application/x-texinfo
'' tgz application/x-compressed
'' tif image/tiff
'' tiff image/tiff
'' tr application/x-troff
'' trm application/x-msterminal
'' tsv text/tab-separated-values
'' uls text/iuls
'' ustar application/x-ustar
'' vcf text/x-vcard
'' vrml x-world/x-vrml
'' wav audio/x-wav
'' wcm application/
'' wdb application/
'' wks application/
'' wmf application/x-msmetafile
'' wps application/
'' wri application/x-mswrite
'' wrl x-world/x-vrml
'' wrz x-world/x-vrml
'' xaf x-world/x-vrml
'' xbm image/x-xbitmap
'' xla application/
'' xlc application/
'' xlm application/
'' xls application/
'' xlt application/
'' xlw application/
'' xof x-world/x-vrml
'' xpm image/x-xpixmap
'' xwd image/x-xwindowdump
'' z application/x-compress
'' zip application/zip

' If svn.exe isn't in the %path%, bail out.
svn.exe help >nul
if 0 neq %errorlevel% (
echo You must have svn.exe in your path to use this batch file.
goto EOF

' The evil for loops that do all the work (including parsing this batch file).
for /f "usebackq tokens=1,2,3" %%i in (`type %0`) do (
if "''"=="%%i" (
for /f "usebackq tokens=*" %%l in (`dir /s /b *.%%j`) do svn ps svn:mime-type %%k "%%l"

A Post Without Substance

I keep either forgetting to write something here or I'm too busy/distracted/in need of non-computer-related activity that I've been ignoring my blog. :-(

So even though I don't have anything of substance to post right now, I thought I'd put this up. It's my latest get rich quick scheme. I was reading Joel's blog and I found inspiration. Pretend I'm E. F. Hutton. Here we go . . .


I can get rich by shorting spam stock. Not only is it a foolproof investment, but I'll actually have a way to make money *from* annoying spammers! Sweet, eh?

Am I brilliant or what?

Yeah. I know: what.

Tuesday, November 07, 2006

So Finally Something About Security? The NT Object Model.

I keep meaning to start a series abut security. At least on Windows (NT family).

First, I should start by explaining the object manager. Then again, let's let someone else do it. Adrian groks this stuff. Check it out:

(off topic) If you enjoy that you may enjoy Adrian's explanation of the NT heap manager:

And if you want to kill some trees, I strongly recommend this for anyone into how Windows does its thing:;show_locs=no

Tomorrow: a recap of what to know about the object manager as far as security goes, then an intro to access control lists (ACLs).
Day after tomorrow: I'm planning a dive deeper into ACLs - ACEs.

Please, someone, give me some feedback if you want to see how this relates to Unix, Unix-based systems (Linux, OSX, etc.) or to the NT predecessor (VMS (link is to Open VMS)).

This page is powered by Blogger. Isn't yours?