<configuration>
<system.webServer>
<security>
<requestFiltering>
<fileExtensions>
<clear/>
</fileExtensions>
</requestFiltering>
</security>
</system.webServer>
</configuration>
Tuesday, 24 May 2011
Setting up Mercurial on IIS
I have just set up a Mercurial server using IIS to serve the requests. I found that the following blog post was a great step by step guide to setting it up http://blog.schuager.com/2010/03/how-to-setup-mercurial-server-on.html.
However I had a few issues that were not covered in the blog post:
The first was that I was getting a "DLL load failed" error for several modules. The reason for this is that I had installed the standalone version of Mercurial and that it could not reference the compiled C versions of the python modules.
I fixed this by copying the pure python modules into the lib directory. You can find the pure python modules for the 1.8.3 version of Mercurial at http://selenic.com/repo/hg/file/3cb1e95676ad/mercurial/pure
The second issue was that IIS refused to serve cs files, as the Request Filtering feature was enabled. I disabled this for the whole repo by adding the following to the web.config at the top level of the IIS hg app.
Simple Python Command to generate a random GUID
Every so often I need to generate a GUID for a MS Proj file.
The simple python command will create one for me:
python -c "import uuid;print uuid.uuid4()"Changing that to a emacs function so I can insert them where ever I need we get:
(defun genUUID () "Generates a UUID" (interactive) (shell-command "python -c \"import uuid;print uuid.uuid4()\"" t) )
Tuesday, 12 April 2011
Remember to just read the code
The problem that I had was that I needed a repeating Timer object in python. I googled, but the answers that I found didn't sit right, and then I remembered that I could just read the code for the threading module and see how the Timer object was implemented, then just use that. Below is the code I came up with.
But the moral of the story is that having the source code for your language's core libaries around is a good thing.
class RepeatingTimer(threading.Thread): """Call a function after a specified number of seconds, it will then repeat again after the specified number of seconds Note: If the function provided takes time to execute, this time is NOT taken from the next wait period t = RepeatingTimer(30.0, f, args=[], kwargs={}) t.start() t.cancel() # stop the timer's actions """ def __init__(self, interval, function, args=[], kwargs={}): threading.Thread.__init__(self) self.interval = interval self.function = function self.args = args self.kwargs = kwargs self.finished = threading.Event() def cancel(self): """Stop the timer if it hasn't finished yet""" self.finished.set() def run(self): while not self.finished.is_set(): self.finished.wait(self.interval) if not self.finished.is_set(): #In case someone has canceled while waiting self.function(*self.args, **self.kwargs)
Friday, 11 March 2011
Installing org-googlecl.el on Windows
Here is how I installed org-googlecl.el (found at http://www.emacswiki.org/emacs/org-googlecl) onto my Windows 7 box at work.
- I droped the el file into my emacs extentions directory
- I added the following to my .emacs
(setq load-path (cons "C:/emacs/org-googlecl" load-path)) (require 'org-googlecl) (setq googlecl-blogname "Technology and Me") (setq googlecl-username "my google username") (setq googlecl-footer "") ;;Add no footer (setq googlecl-blog-exists t) ;;Ask me if the blog exists before posting (setq googlecl-list-regexp "\\(.*\\),\\(http.*\\),?\\(.*\\)$") ;;update the reg-ex for listing (see below)
- I pip installed the google commandline as per http://code.google.com/p/googlecl/wiki/Install
-
The
googlecommand would not work out of the box for me so I had to add a batch script to the windows path
python c:\python\26\Scripts\google %*
-
Once the google command was working I found that the
org-googlecl-list-blogswas not running.-
The problem was that the regex was wrong as I had not added any tags to my posts. So I updated the
googlecl-list-regexpto account for the missing ,
-
The problem was that the regex was wrong as I had not added any tags to my posts. So I updated the
- The final tweek is that the quoting was wrong for windows on some of the commands so I changed it to match the windows style within org-googlecl
Testing org-googlecl
Just installed the org-googlecl emacs module. Hoping it will mean that I will blog more than once a year :)
Thursday, 21 January 2010
N900 - now with Emacs!
Thanks to this post. I have installed and configured emacs 23.1.1 onto my N900.
The only problem was that the minibuffer wasn't displaying, I found that the fix for this was to specify a max-height to the maxframe configuration mentioned in the post. I added the following line to my .emacs:
(setq mf-max-height 430)
Tuesday, 19 January 2010
A simple solution to downloading matching instance files in CC.net
At Serverside we use Cruise Control .Net as our continuous build server. I have found it to be easy to use and it integrates with NAnt and NUnit really well.
Today I hit upon a interesting problem in one of our builds: We needed a instance code line to be updated every time the base code line was updated. Where an instance is just a specific branded website of the base code. The instances are in the same repo, but in different "lines" of the repository, so we couldn't just update the whole trunk line.
The way I solved it was that every time the CC.Net project is triggered, the first task that CC.Net runs is a svn update on the instance lines.
I run svn in a exec task. The trick here is to remember to use the --username and --password arguments to make sure that you update with the right user.
My final exec node looks something like:
<exec> <executable>svn</executable> <baseDirectory>instance trunk directory</baseDirectory> <buildArgs>update --username xxx --password yyy</buildArgs> </exec>simple as that. The only problem is that the build is not run when instance code is checked in. However it looks like I may have to re write the build script to get that to work correctly.
Subscribe to:
Posts (Atom)
