blogng/blog/2012-11-21-netbsd-chronicles.markdown
Dhananjay Balan 58b20109cf 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")
2019-01-28 17:16:27 -05:00

28 lines
1.3 KiB
Markdown

---
author: dhananjayishere
comments: true
date: 2012-11-21 21:45:00
layout: post
slug: netbsd-chronicles
tags: netbsd
title: NetBSD Chronicles.
wordpress_id: 169330104
---
To be frank I wasn't doing much for almost an year, got lazy as one can ever be. Today was the day to break it. Got a little push do something and I got down to do it. I was looking at BSD development for a long time, and thought this is the best time to get involved. I am a total noob at BSD, I never really used one. So it was challenging when I started to install NetBSD into an old Comapq nx6120 that was lying around. I know anyone could get to the root shell easily, with help from brilliant click and go installers, configuring and customizing was the real problem.
Its 0300 now, and I got my laptop running NetBSD 6.0, and connected to wireless (easier than I thought - thanks to legacy hardware.)
**Configuring Intel PRO/Wireless **
** **Unlike linux, BSD can include all the microcode (firmware) in the distribution itself, due the flexibility of licensing system. Reading up _iwi(4)_ reveals youve to accept the EULA by setting the sysctl variable hw.iwi.accept_eula to 1
```
# sysctl -w hw.iwi.accept_eula=1
```
The university wireless is open, so I didnt had to mess too much.
```
# ifconfig ssid "SSID" iwi0 dhclient iwi0
```