blogng/blog/2018-03-08-kuhs.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

33 lines
1.1 KiB
Markdown

---
comments: true
date: 2018-03-08
layout: post
tags: kuhs, dns
title: KUHS
---
[Kerala University of Health Sciences](https://en.wikipedia.org/wiki/Kerala_University_of_Health_Sciences),
a medical university that oversees 205 professional colleges in Kerala still hasn't
figured out DNS. Everytime I have to use a search engine to get the IP address
to find their site.
![kuhs-search](/images/kuhs-search.png)
So I decided to donate one. So here it is [__http://kuhs.space__](http://kuhs.space), (well, http because who has time for TLS, also I don't want people to give false hope of security)
I have notified them about this, Their email is on kuhs.ac.in and `MX` seems to point to a google apps
domain, hope their email actually works.
```
;; ANSWER SECTION:
kuhs.ac.in. 3500 IN MX 1 ASPMX.L.GOOGLE.COM.
kuhs.ac.in. 3500 IN MX 5 ALT1.ASPMX.L.GOOGLE.COM.
kuhs.ac.in. 3500 IN MX 5 ALT2.ASPMX.L.GOOGLE.COM.
kuhs.ac.in. 3500 IN MX 10 ASPMX2.GOOGLEMAIL.COM.
kuhs.ac.in. 3500 IN MX 10 ASPMX3.GOOGLEMAIL.COM.
```
_UPDATE Tue Jan 8 16:13:26 EST 2019__: They seems to have fixed their DNS records - https is still broken`