Clutching at Security Blankets

Lessons learned while working in Information Security.

moc.navat@ymerej

Tags: server ops 

Earplugs. Yes.


26 August 2015

Earplugs. Own them and use them. You never know when you’re going to be working on a server in a datacenter that has an unkillable, unbearably loud thermal alarm going off at the time. It’s hard to work with your hands when they’re in your ears. Even when there’s no alarm, datacenters are loud and unpleasant. Reduce that unpleasantness with earplugs.

Tags: code ruby blog 

Creating a custom liquid tag for Jekyll


20 August 2015

In Things I Need To Create For This Blog I mentioned that I needed an easier way to create sidenotes than pasting in a bunch of ugly HTML in my Markdown. So, following the super simple template on the Jekyll page and not knowing any Ruby, I created a Sidenote liquid tag.

require 'securerandom'

module Jekyll
  class SidenoteTag < Liquid::Tag

    def initialize(tag_name, text, tokens)
      super
      @text = text
    end

    def render(context)
	  id = SecureRandom.random_number(36**12).to_s(36).rjust(6, "0")
      "<label for=\"sn-#{id}\" class=\"margin-toggle sidenote-number\"></label>
<input type=\"checkbox\" id=\"sn-#{id}\" class=\"margin-toggle\"/><span class=\"sidenote\">#{@text}</span>"
    end
  end
end

Liquid::Template.register_tag('sidenote', Jekyll::SidenoteTag)

Now all I need to do to create a sidenote is to put in a liquid tag:

{.% sidenote And sidenote text goes here %}

and it gets converted into a proper sidenote. Just like this.

Tags: blog 

Things I Need To Create For This Blog


16 August 2015

I’m having a good time figuring out how to build a static page blog using Jekyll, but there are a few pieces missing for it to really do what I need.

First, I’m trying to use Tufte.css for the look and feel of the pages because I haven’t seen anything more readable or pleasing to the eyes. Unfortunately, certain features like sidenotes and marginnotes require some funky inline HTML to work, and I haven’t figure out how to embed them automatically in the Markdown or Textile post data sources. That said, I can just embed the raw HTML in Markdown content if I’m OK with all that structure mixed in to my content.

So it looks like I’m going to need to build a custom filter to allow me to use simple directives and have them convert into appropriate sidenote and marginnote HTML. Update: Done. See this post for details.

Second, given how much of the work I do is in BigFix Relevance Language and BigFix Action Script, I’m going to have to extend the pygments syntax highlighter with a custom language lexer for those. And then there will be the fun of designing a syntax highlighting stylesheet that doesn’t pollute my pages with a rainbow of fruity highlighting modes.

Both of these things are fairly new to me, so I’m looking forward to figuring out how to do it.

Page: 3 of 4