Skip to content

Commit dd6c817

Browse files
committed
First stab at layout and content.
1 parent 16de9f1 commit dd6c817

13 files changed

+315
-15
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_site

_config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
auto: true
2+
pygments: true
3+
paginate: 10
4+
permalink: /:year/:month/:title/

_layouts/default.html

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
<!DOCTYPE html>
22
<html>
3-
<head>
4-
<title>{{ page.title }}</title>
5-
</head>
6-
<body>
7-
{{ content }}
8-
</body>
3+
<head>
4+
<title>{{ page.title }}</title>
5+
<link rel="stylesheet" type="text/css" href="/css/default.css" media="screen" />
6+
<link rel="alternate" type="application/atom+xml" title="Atom" href="/feeds/atom.xml" />
7+
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feeds/rss.xml" />
8+
</head>
9+
<body>
10+
<h1 class="header">
11+
<a href="/">#</a>
12+
Beware of programmers carrying screwdrivers
13+
</h1>
14+
<div class="content">{{ content }}</div>
15+
<div class="footer">
16+
<ul class="links">
17+
<li><a href="/about.html">About me</a></li>
18+
<li><a href="http://esm.logic.net/">My real blog</a></li>
19+
<li><a href="http://www.flickr.com/photos/edward_marshall">Flickr</a></li>
20+
<li><a href="http://github.com/logic">Github</a></li>
21+
<li><a href="/feeds/atom.xml" rel="alternate" type="application/atom+xml">Atom</a>/<a href="/feeds/rss.xml" rel="alternate" type="application/rss+xml">RSS</a></li>
22+
</ul>
23+
</div>
24+
</body>
925
</html>

_layouts/post.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
layout: default
3+
---
4+
<h1 class="postTitle"><a href="{{ page.url }}">{{ page.title }}</a></h1>
5+
<div class="post">
6+
{{ content }}
7+
<p class="meta">
8+
{{ page.date | date: "%b %d, %Y" }} |
9+
<a href="{{ page.url }}">Permalink</a>
10+
<br />
11+
{% for c in page.categories %}
12+
<span class="postCategory">{{ c }}</span>{% if forloop.last != true %},{% endif %}
13+
{% endfor %}
14+
</p>
15+
</div>
16+
17+
<div id="related">
18+
<h2>Related Posts</h2>
19+
<ul class="posts">
20+
{% for post in site.related_posts limit:3 %}
21+
<li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ post.url }}">{{ post.title }}</a></li>
22+
{% endfor %}
23+
</ul>
24+
</div>
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: post
3+
title: "Kerberos and ksu"
4+
categories:
5+
- linux
6+
- sysadmin
7+
- bash
8+
- shell
9+
- kerberos
10+
- xwindows
11+
- security
12+
---
13+
<p>Kerberos as a site-wide authentication mechanism has it's benefits, but the software that's typically used to drive it is getting a little long in the tooth. ksu, the kerberized equivalent to su, is only a partial implementation of what su does; there's no argument to ksu that says "this is a login shell, please set up the necessary environment". Even su has a couple of failings; in particular, if you're an X user, you're probably familiar with how su - doesn't bring your X authentication data along for the ride.</p>
14+
15+
<p>So, I fixed both of those a while back, with a really ugly shell script. Just in case anyone else might find it handy, here it is:</p>
16+
17+
{% highlight bash linenos=table anchorlinenos=True lineanchors=ksu %}
18+
#!/bin/sh
19+
20+
# Replacement for raw "ksu" in kerberized environments;
21+
# behaves more like "su -", and retains xauth data.
22+
23+
if [ $# -lt 1 ]
24+
then
25+
echo "Usage: `basename $0` <target user> [ <command> [ <arg> ] ... ]"
26+
exit 2
27+
fi
28+
29+
TARGET_USER="$1"
30+
shift
31+
32+
# be a basic login shell if no command is specified.
33+
if [ -z "$*" ]
34+
then
35+
TARGET_CMD='-l'
36+
else
37+
TARGET_CMD="-c '$*'"
38+
fi
39+
40+
# FD 4 becomes stdin
41+
exec 4>&0
42+
43+
xauth list | sed -e 's/^/add /' | {
44+
# FD 3 becomes xauth output
45+
# FD 0 becomes stdin again
46+
# FD 4 is closed
47+
exec 3>&0 0>&4 4>&-
48+
49+
exec /usr/bin/env -u PATH -u LD_LIBRARY_PATH \
50+
/usr/krb5/bin/ksu "${TARGET_USER}" -e /bin/bash -l -c "
51+
xauth -q <&3
52+
cd
53+
exec /usr/bin/env DISPLAY='${DISPLAY}' "'"$SHELL"'" ${TARGET_CMD} 3>&-"
54+
}
55+
{% endhighlight %}

_posts/2010-09-17-bash-history.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
layout: post
3+
title: "Bash history retention for root"
4+
categories:
5+
- linux
6+
- sysadmin
7+
- bash
8+
- shell
9+
---
10+
<p>A quick random Linux administration tip: add the following three lines to <kbd>root</kbd>'s <kbd>.bashrc</kbd>:</p>
11+
12+
{% highlight bash linenos=table anchorlinenos=True lineanchors=bashhist %}
13+
[ ! -d $HOME/.history ] && mkdir $HOME/.history
14+
set -- `/usr/bin/who -m`
15+
HISTFILE="$HOME/.history/`/bin/date +%Y-%m-%d.%T`.`/bin/hostname -s`.$$.$1"
16+
{% endhighlight %}
17+
18+
<p>Once you do, future login sessions as root will be saved in a directory named <kbd>.history</kbd> in <kbd>root</kbd>'s home directory, in the pattern:</p>
19+
20+
{% highlight console %}
21+
2010-09-17.13:53:27.foohost.14379.foouser
22+
{% endhighlight %}
23+
24+
<p>Why would you want to do something like this? First, each shell/session is stored to it's own file, rather than interleaving into a single file in whatever order you might have exited them. Second, it tells you both when you started the session (by the filename) and when you ended it (by the timestamp on the file). Third, for systems administered by multiple people, it tells you who was <kbd>su</kbd>'d to <kbd>root</kbd> when the session occurred (or just displays <kbd>root</kbd> for console logins), so you know which admin "owned" that session.</p>
25+
26+
<p>The main downside here is that you lose the ability to see multiple sessions' worth of history in your history buffer, but for systems with multiple admins, I haven't missed it (as getting someone else's history when scrolling back has proven more annoying than helpful for me), but if you lean hard on your history, this might not be a net win for you.</p>
27+
28+
<p>Also, I'd suggest resisting the urge to treat this as an "audit log" of any kind; it's trivially bypassed, meaning that this is for teams that trust each other. Use it instead as a way of recreating the how and why of a change after (occasionally <em>long</em> after) it was made.</p>

about.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: default
3+
title: "Beware of programmers carrying screwdrivers"
4+
---
5+
<div class="post">
6+
<p><a href="http://esm.logic.net/">See here.</a></p>
7+
</div>

css/default.css

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@import url("syntax.css");
2+
.highlighttable .linenos .linenodiv {
3+
border-right: 1px #CCC solid;
4+
padding-right: 10px;
5+
margin-right: 10px;
6+
}
7+
8+
.header { border-bottom: 1px dashed; }
9+
10+
.content { width: 80%; margin: 0 auto; }
11+
12+
.content :first-child { margin-top: 0; }
13+
14+
.meta { margin: 0; padding: 0; text-align: right; }
15+
16+
.footer { border-top: 1px dashed; }
17+
18+
.postTitle { margin-bottom: 0; }
19+
.post { margin: 10px; padding: 10px; border: 10px solid #CCC; }
20+
21+
.links li { list-style: none; float: left; padding: 3px 5px; }

css/syntax.css

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.highlight { background: #ffffff; }
2+
.highlight .c { color: #999988; font-style: italic } /* Comment */
3+
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
4+
.highlight .k { font-weight: bold } /* Keyword */
5+
.highlight .o { font-weight: bold } /* Operator */
6+
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
7+
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
8+
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
9+
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
10+
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
11+
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
12+
.highlight .ge { font-style: italic } /* Generic.Emph */
13+
.highlight .gr { color: #aa0000 } /* Generic.Error */
14+
.highlight .gh { color: #999999 } /* Generic.Heading */
15+
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
16+
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
17+
.highlight .go { color: #888888 } /* Generic.Output */
18+
.highlight .gp { color: #555555 } /* Generic.Prompt */
19+
.highlight .gs { font-weight: bold } /* Generic.Strong */
20+
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
21+
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
22+
.highlight .kc { font-weight: bold } /* Keyword.Constant */
23+
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
24+
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
25+
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
26+
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
27+
.highlight .m { color: #009999 } /* Literal.Number */
28+
.highlight .s { color: #d14 } /* Literal.String */
29+
.highlight .na { color: #008080 } /* Name.Attribute */
30+
.highlight .nb { color: #0086B3 } /* Name.Builtin */
31+
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
32+
.highlight .no { color: #008080 } /* Name.Constant */
33+
.highlight .ni { color: #800080 } /* Name.Entity */
34+
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
35+
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
36+
.highlight .nn { color: #555555 } /* Name.Namespace */
37+
.highlight .nt { color: #000080 } /* Name.Tag */
38+
.highlight .nv { color: #008080 } /* Name.Variable */
39+
.highlight .ow { font-weight: bold } /* Operator.Word */
40+
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
41+
.highlight .mf { color: #009999 } /* Literal.Number.Float */
42+
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
43+
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
44+
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
45+
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
46+
.highlight .sc { color: #d14 } /* Literal.String.Char */
47+
.highlight .sd { color: #d14 } /* Literal.String.Doc */
48+
.highlight .s2 { color: #d14 } /* Literal.String.Double */
49+
.highlight .se { color: #d14 } /* Literal.String.Escape */
50+
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
51+
.highlight .si { color: #d14 } /* Literal.String.Interpol */
52+
.highlight .sx { color: #d14 } /* Literal.String.Other */
53+
.highlight .sr { color: #009926 } /* Literal.String.Regex */
54+
.highlight .s1 { color: #d14 } /* Literal.String.Single */
55+
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
56+
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
57+
.highlight .vc { color: #008080 } /* Name.Variable.Class */
58+
.highlight .vg { color: #008080 } /* Name.Variable.Global */
59+
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
60+
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */

feeds/atom.xml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: nil
3+
---
4+
<?xml version="1.0" encoding="utf-8"?>
5+
<feed xmlns="http://www.w3.org/2005/Atom">
6+
<title>esm@github</title>
7+
<subtitle>Beware of programmers who carry screwdrivers</subtitle>
8+
<link href="http://github.logic.net/atom.xml" rel="self"/>
9+
<link href="http://github.logic.net/"/>
10+
<updated>{{ site.time | date_to_xmlschema }}</updated>
11+
<id>http://github.logic.net/</id>
12+
<author>
13+
<name>Ed Marshall</name>
14+
<email>[email protected]</email>
15+
</author>
16+
{% for post in site.posts %}
17+
<entry>
18+
<title>{{ post.title }}</title>
19+
<link href="http://github.logic.net{{ post.url }}"/>
20+
<updated>{{ post.date | date_to_xmlschema }}</updated>
21+
<id>http://github.logic.net{{ post.id }}</id>
22+
<content type="html">{{ post.content | xml_escape }}</content>
23+
</entry>
24+
{% endfor %}
25+
</feed>

feeds/rss.xml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
layout: nil
3+
---
4+
<?xml version="1.0" encoding="utf-8"?>
5+
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
6+
<channel>
7+
<title>esm@github</title>
8+
<link>http://github.logic.net/</link>
9+
<description>Beware of programmers who carry screwdrivers</description>
10+
<lastBuildDate>{{ site.time }}</lastBuildDate>
11+
{% for category in site.categories %}
12+
<category>{{ category }}</category>
13+
{% endfor %}
14+
{% for post in site.posts %}
15+
<item>
16+
<title>{{ post.title }}</title>
17+
<link>http://github.logic.net{{ post.url }}</link>
18+
<guid>http://github.logic.net{{ post.url }}</guid>
19+
<pubDate>{{ post.date }}</pubDate>
20+
<description>{{ post.content | xml_escape }}</description>
21+
{% for category in post.categories %}
22+
<category>{{ category }}</category>
23+
{% endfor %}
24+
</item>
25+
{% endfor %}
26+
</channel>
27+
</rss>

index.html

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
layout: default
3+
title: "Beware of programmers carrying screwdrivers"
4+
---
5+
{% for post in paginator.posts %}
6+
<h1 class="postTitle"><a href="{{ post.url }}">{{ post.title }}</a></h1>
7+
<div class="post">
8+
{{ post.content }}
9+
<p class="meta">
10+
{{ post.date | date: "%b %d, %Y" }}
11+
<br />
12+
{% for c in post.categories %}
13+
<span class="postCategory">{{ c }}</span>{% if forloop.last != true %},{% endif %}
14+
{% endfor %}
15+
</p>
16+
</div>
17+
{% endfor %}
18+
19+
<div class="paginator">
20+
<div style="float: left">
21+
{% if paginator.next_page %}
22+
<a href="/page{{ paginator.next_page }}/">&larr; Older</a>
23+
{% endif %}
24+
</div>
25+
26+
<div style="float: right">
27+
{% if paginator.previous_page %}
28+
<a href="
29+
{% if paginator.previous_page == 1 %}
30+
/
31+
{% else %}
32+
/page{{ paginator.previous_page }}
33+
{% endif %}">Newer &rarr;</a>
34+
{% endif %}
35+
</div>
36+
37+
<div style="clear: both">
38+
</div>
39+
</div>
40+
41+
<br />

index.md

-9
This file was deleted.

0 commit comments

Comments
 (0)