~dbalan/blogng unlisted

a6ba9db8 — Dhananjay Balan 1 year, 7 months ago hsts
Some more editing.
bebf07c4 — Dhananjay Balan 1 year, 7 months ago
Rewrote HSTS post
edd06386 — Dhananjay Balan 1 year, 7 months ago
Drafts for HSTS
Drafts for captive portal
comments: suggest a few edits that can probably be ignored
3e814e99 — Dhananjay Balan 1 year, 8 months ago
Fix whitespace errors
eed134df — wildconceits 1 year, 8 months ago
Gentle edits of plotter post
bd274a6b — Dhananjay Balan 1 year, 8 months ago
Draft 1.
5a4058ca — Dhananjay Balan 1 year, 8 months ago
Add RC scout to footer
6af3ba8c — Dhananjay Balan 1 year, 8 months ago
Fix links
aa854a76 — Dhananjay Balan 1 year, 8 months ago
Draft for plotter post.
c3c45a2b — Dhananjay Balan 1 year, 8 months ago
Remove unused fonts from repo.
1df7ecf6 — Dhananjay Balan 1 year, 8 months ago
Serve fonts from local server and remove tufte fonts
1106321f — Dhananjay Balan 1 year, 9 months ago
Published as tweets!
3c1d9989 — Dhananjay Balan 1 year, 9 months ago
First version ssh tricks
0f851f0c — Dhananjay Balan 1 year, 9 months ago
Tracking freebsd current
1aa5977a — Dhananjay Balan 1 year, 9 months ago
Fix tags format
6d9b3223 — Dhananjay Balan 1 year, 9 months ago
Update new post script for new tagging format
58b20109 — Dhananjay Balan 1 year, 9 months ago
Convert from old categories to tags

import sys
import yaml

with open(sys.argv[1]) as fp:
    data = fp.read()

if not data.find("---") == 0:
    # no head
    print("NO YAML HEAD FOUND")
    sys.exit(-1)

data = data[3:]
head_end = data.find("---")

head = data[0:head_end]
data = data[head_end+3:]

metadata = yaml.safe_load(head)

cats = metadata.pop('categories', None)
if cats != None:
    if type(cats) == list:
        tags = cats
    elif type(cats) == str:
        tags = cats.split()

    tags = list(map(lambda t: t.lower(), tags))

    metadata["tags"] = ", ".join(tags)
    new_data = f"---\n{yaml.dump(metadata, default_flow_style=False)}---{data}"
    # write it
    print(f"coverted: categories to tags: {tags} - {sys.argv[1]}")
    with open(sys.argv[1], "w") as fp:
        fp.write(new_data)
    sys.exit(0)

if not metadata.get("tags", None):
    metadata["tags"] = "untagged"
    new_data = f"---\n{yaml.dump(metadata, default_flow_style=False)}---{data}"
    print(f"untagged: {sys.argv[1]}")
    # write it
    with open(sys.argv[1], "w") as fp:
        fp.write(new_data)
    sys.exit(0)

print("No changes needed")
eb676545 — Dhananjay Balan 1 year, 9 months ago
Implement Tags!
f41c5e6a — Dhananjay Balan 1 year, 10 months ago
Experiments in owning data, part 2
Next