aboutsummaryrefslogtreecommitdiffstats
path: root/put_in_db.js
blob: f5ec09ee13b407a73e315ce0a74de6421e608509 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
"use strict";

const fs = require("fs");
const path = require("path");

var blogs = [
  {
    title: "Turning C structs into Lua tables",
    slug: "c_struct_lua_table",
    body: fs.readFileSync(path.join(__dirname) + "/mds/cstruct2luatable.md"),
    teaser: fs.readFileSync(path.join(__dirname) + "/mds/cstruct2luatable.txt"),
    keywords: ["c", "lua"],
    lastUpdatedAt: Date.now(),
  },
  {
    title: "Lazy Makefiles",
    slug: "lazy_makefile",
    body: fs.readFileSync(path.join(__dirname) + "/mds/lazymakefiles.md"),
    teaser: fs.readFileSync(path.join(__dirname) + "/mds/lazymakefiles.txt"),
    keywords: ["makefile", "c", "c++"],
    lastUpdatedAt: Date.now(),
  },
  {
    title: "One Chat Client For Everything",
    slug: "one_chat_client_for_everything",
    body: fs.readFileSync(
      path.join(__dirname) + "/mds/oneclientforeverything.md",
    ),
    teaser: fs.readFileSync(
      path.join(__dirname) + "/mds/oneclientforeverything.txt",
    ),
    keywords: [
      "irc",
      "matrix",
      "mattermost",
      "matterbridge",
      "bitlbee",
      "irssi",
    ],
    lastUpdatedAt: Date.now(),
  },
  {
    title: "How to Get your SMS on IRC",
    slug: "how_to_get_your_sms_on_irc",
    body: fs.readFileSync(
      path.join(__dirname) + "/mds/howtogetyourSMSonIRC.md",
    ),
    teaser: fs.readFileSync(
      path.join(__dirname) + "/mds/howtogetyourSMSonIRC.txt",
    ),
    keywords: ["irc", "bot", "sms"],
    lastUpdatedAt: Date.now(),
  },
  {
    title:
      "What to do with your DNS when ODoH's Trust-Me-Bruh Model doesn't work for you",
    slug: "what_to_do_with_your_dns",
    body: fs.readFileSync(path.join(__dirname) + "/mds/DNS.md"),
    teaser: fs.readFileSync(path.join(__dirname) + "/mds/DNS.txt"),
    keywords: ["DNS", "DoH", "DoT", "ODoH", "Tor", "dnscrypt-proxy", "vagrant"],
    lastUpdatedAt: Date.now(),
  },
  {
    title: "After NTP comes NTS",
    slug: "after_ntp_comes_nts",
    body: fs.readFileSync(path.join(__dirname) + "/mds/NTP.md"),
    teaser: fs.readFileSync(path.join(__dirname) + "/mds/NTP.txt"),
    keywords: ["NTP", "NTS", "SOCKS5"],
    lastUpdatedAt: Date.now(),
  },
  {
    title: "Docker, Linux, Security. Kinda.",
    slug: "docker_linux_security",
    body: fs.readFileSync(path.join(__dirname) + "/mds/securedocker.md"),
    teaser: fs.readFileSync(path.join(__dirname) + "/mds/securedocker.txt"),
    keywords: ["docker", "linux", "security"],
    lastUpdatedAt: Date.now(),
  },
  {
    title: "A Disposable Firefox Instance",
    slug: "disposable_firefox_instance",
    body: fs.readFileSync(path.join(__dirname) + "/mds/disposablefirefox.md"),
    teaser: fs.readFileSync(
      path.join(__dirname) + "/mds/disposablefirefox.txt",
    ),
    keywords: ["vagrant", "linux", "libvirt", "firefox", "qemu", "ufw"],
    lastUpdatedAt: Date.now(),
  },
];

db.blogposts.insertMany(blogs);
// db.blogposts.updateMany(
//   { $set: blogs },
//   {
//     upsert: true,
//   },
// );