Andrew Stacey


About
Andrew Stacey
Information about my research, teaching, and other interests.

By: Andrew Stacey
Contact details


Andrew Stacey


blosxom icon


Mon, 21st Sep 2009 (HowDidIDoThat :: nLab)

n-Lab n-Notes

I am currently the systems administrator for the n-Lab project. This has involved me learning a fair bit and so there have been many occasions where there has been something that I've thought: "I'd better write that down so I remember what I did.". In addition, I may not always be the systems administrator for this project which makes it doubly important that I record everything significant that I do, and there may be others who wish to set up a similar project in which case it will be useful to have a record of what I did so that they can see how not to do it.

Also, there are various statistics and information that may be of interest to users or observers of the n-Lab project but that don't really fit as content of the n-Lab itself.

[Full link]
Last modified on:
Mon, 21st Sep 2009


Thu, 26th Nov 2009 (HowDidIDoThat :: nLab)

nLab CSS Garden

In the search for a "style" for the n-Lab, here's a CSS garden to play in. It's ever-so-strongly based on the CSS Zen Garden (indeed, I'm using a bit of their code). The garden itself is a page from the n-Lab copied here so that CSS stylesheets can be added at will.

See more ...

[Full link]
Last modified on:
Thu, 26th Nov 2009


Fri, 14th Aug 2009 (HowDidIDoThat :: nLab)

Setting up the n-Lab

The nlab is in the process of migrating to a new host. This is a record of the steps needed to get it working.

See more ...

[Full link]
Last modified on:
Tue, 2nd Aug 2011


Thu, 24th Sep 2009 (HowDidIDoThat :: nLab)

Local Previews of nLab Pages

One of the annoying things about using Instiki (which is, I should say, not specific to Instiki but goes for anything where the processing goes on "over there") is that to see what a page really looks like, I need to send it to the server and have a look. This can be irritating as I might need to do several minor tweaks to get things looking right, and I can never figure out the indentations first go on lists. In addition, using the it's all text addon for firefox, I can edit pages using Emacs. It's extremely annoying to have to essentially close the file and reopen it for a minor edit (okay, I have Emacs running in server mode so it doesn't take long, but I lose my place in the buffer and have to load in any modes again). Fortunately, the formatter for Instiki can run as a standalone process.

See more ...

[Full link]
Last modified on:
Thu, 24th Sep 2009


Fri, 21st Aug 2009 (HowDidIDoThat :: nLab)

nLab Statistics

Here are some statistics gleaned from the logs of three Instiki processes. Two are versions of the nlab: the original host and the migration. The third is a much smaller installation, included just for some comparison. The significant details are:

Nickname Database Size Connection
nLab sqlite3 110Mb Mongrel proxied through lighttpd
migrated nLab MySQL 110Mb Apache with Phusion Passenger
Mini sqlite3 1Mb Webbrick

See more ...

[Full link]
Last modified on:
Tue, 25th Aug 2009


Tue, 9th Mar 2010 (HowDidIDoThat :: nLab)

Converting the nForum to MathML

A side benefit of the awesome SVG-Editor in instiki is the creation of a public itex server. This makes it possible to send some itex off to the server and get back some MathML. A bit like those public latex servers that convert latex equations to images, but better. So if a forum can use latex->png's to display mathematics, surely it can use itex->mathml ...

The nForum runs on the Vanilla forum platform. Vanilla gets bonus marks for already serving XHTML, so it's not hard to switch it to XHTML+MathML+SVG. One change is needed to the main code: in the file appg/headers.php the content-type needs changing to application/xhtml+xml. Next, one needs to use a MathML-aware theme. Fortunately, it's not hard to adapt the default theme to be valid XHTML+MathML+SVG. The way I constructed that was to change the header and then keep feeding the pages through the w3 validator until everything passed.

The next question is how to generate the MathML. Given that the nForum supports the nLab, which runs a variant of markdown with itex, the obvious solution was to write a wrapper around markdown that essentially did the same. The result is the Markdown+Itex formatter. This also incorporates the wikilink plugin so it all happens in one place.

Various existing plugins also needed modification to work correctly. For some, the modifications were minor: mainly replacing ampersands in URLs with entities. For others, the modifications were a little more serious. Here's a complete list of the extensions that the nForum uses, together with a summary of the modifications.

  • ApplicantEmailVerification
  • CategoryRoles
  • CheckNames
  • CustomStyles
  • DuplicateEmailCheck
  • FeedThis
    Lots of ampersands needed escaping here.
  • ForcedCategory
  • GuestPost
    Guest posts are only allowed in one category on the nForum so this is only turned on in that category. In that category, guests can also start discussions (not just comment on existing ones). More seriously, reCAPTCHA does not serve and has no intention of serving valid XHTML so the form has to be redesigned. Fortunately, I found someone else who'd already done that and used theirs as a template. (The reload captcha and audio versions don't work yet.)
  • GuestSignIn
  • GuestWelcome
  • HtmlFormatter
  • ksesXHTML
  • MarkAllReadRedux
    A stray ampersand got hunted down and escaped.
  • Markdown
  • MarkdownItex
  • MembersList
  • NewPostNotifier
  • ParticipatedThreads
  • PreviewPost
  • PseudoTabs
  • reCAPTCHA
    As with GuestPost, this needed extensive modification to make it valid XHTML.
  • RemoveStickyDiscussions
  • ReservedNames
  • RoleListFix
  • SetList
  • StickyOrder
  • SubCategories
  • Textile
    Couple of spaces misplaced.
  • vLaTeX
    In the process of writing the Markdown+Itex extension, this got severely updated.
  • Wikilinks

Resources

[Full link]
Last modified on:
Tue, 9th Mar 2010


Mon, 9th Nov 2009 (HowDidIDoThat :: nLab)

MySql Notes

Some useful MySQL queries:

  1. Find all revisions from a particular IP:

    SELECT page_id,updated_at FROM revisions WHERE ip = "X.X.X.X";
    
  2. Find all revisions for yesterday:

    SELECT name FROM pages WHERE id IN (SELECT page_id FROM revisions WHERE DATE(updated_at) = DATE_SUB(CURDATE(),INTERVAL 1 DAY));
    
  3. Check column settings:

    SHOW FULL COLUMNS FROM table;
    
  4. Reset columns to case-sensitive (with appropriate settings):

    ALTER TABLE `table` MODIFY `column` type CHARACTER SET charset COLLATE collation NOT NULL? DEFAULT?;
    

    The point here is that all this information has to be given, it doesn't work just trying to change the collation.

  5. Find unique entries from a column:

    SELECT DISTINT column FROM table;
    

[Full link]
Last modified on:
Tue, 9th Mar 2010