-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-001.html
287 lines (258 loc) · 14.7 KB
/
page-001.html
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<html>
<head>
<title>Craig Weber</title>
<meta charset="UTF-8">
<meta name=viewport content='width=device-width'>
<meta name="google-site-verification" content="cw0Nbm73FcLB9kSYvCUhc5q-6CrLFcgJQy0h_qzG0O8" />
<link href='https://fonts.googleapis.com/css?family=Neuton|Merriweather|Inconsolata:400,700' rel='stylesheet'
type='text/css'>
<link rel="stylesheet" type="text/css" href="https://blog-test.weberc2.com/assets/theme//style.css">
<link rel="alternate" type="application/json" title="Craig Weber" href="https://blog-test.weberc2.com/index.json">
<script>
function submitAnalytics() {
const analyticsUrl = "https://blog-analytics.weberc2.com";
var body = document.getElementById("body");
var img = document.createElement("img");
var qstring = [
`path=${encodeURIComponent(window.location.pathname)}`,
`host=${encodeURIComponent(window.location.hostname)}`,
`proto=${encodeURIComponent(window.location.protocol)}`,
`referer=${encodeURIComponent(window.referer)}`,
].join("&");
img.setAttribute("src", `${analyticsUrl}/?${qstring}`);
body.appendChild(img);
}
</script>
</head>
<body onload="submitAnalytics()">
<h1 id="site-header"><a id="site-title" href="https://blog-test.weberc2.com/index.html">Craig Weber</a></h1>
<div id="page" class="center-column">
<div id="post-list">
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/homelab-intro.html>Kubernetes + Raspberry Pi Homelab: Introduction</a></h2>
<div class="post-meta">
<span class="post-date">2021-01-03</span>
<span class="tag"><a href="https://blog-test.weberc2.com/homelab/index.html">homelab</a></span>
</div>
<div class="post-body">
<p>As I alluded to in my <a href="https://blog-test.weberc2.com/posts/k3s-tailscale.md">last post</a>, I've finally decided to pull the trigger
and build my own homelab: a personal computing environment for playing around
with new tools and approaches for developing or operating software, including
software that is personally useful.
<a href=https://blog-test.weberc2.com/posts/homelab-intro.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/k3s-tailscale.html>K3s + Tailscale</a></h2>
<div class="post-meta">
<span class="post-date">2020-12-30</span>
<span class="tag"><a href="https://blog-test.weberc2.com/homelab/index.html">homelab</a></span>
</div>
<div class="post-body">
<p>I've recently been working on my Raspberry Pi Kubernetes cluster. I also use
<a href="https://tailscale.com/">Tailscale</a> for my home VPN (because it's performant and absurdly easy to
setup and configure). I wanted to run Kubernetes services on my VPN using
private DNS names (e.g., <code>foo.local</code>) and addresses from the Tailscale address
space (e.g., <code>100.*</code>) as opposed to the host network address space (e.g.,
<code>192.168.*</code>).</p>
<a href=https://blog-test.weberc2.com/posts/k3s-tailscale.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/golang-iterator-sketch.html>Go generics iterator sketch</a></h2>
<div class="post-meta">
<span class="post-date">2020-06-17</span>
<span class="tag"><a href="https://blog-test.weberc2.com/golang/index.html">golang</a></span>
</div>
<div class="post-body">
<p>The new Go generics proposal and playground gives us something to play with.
Here's a sketch of what a basic iterator library could look like. It's based on
function types instead of interfaces; I think this gives better ergonomics than
interface-based designs, especially if the proposal drops its seemingly
arbitrary <a href="https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#methods-may-not-take-additional-type-arguments">restrictions for method types</a>.</p>
<p>I'm not sure about returning a pointer to the type as opposed to a <code>(T, bool)</code>
tuple. In particular, I suspect this will cause unnecessary allocations, but I
haven't tested at all.</p>
<a href=https://blog-test.weberc2.com/posts/golang-iterator-sketch.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/multiple-github-account-tips.html>Tips for working with multiple GitHub accounts</a></h2>
<div class="post-meta">
<span class="post-date">2020-04-25</span>
</div>
<div class="post-body">
<p>I use GitHub for my work and personal projects with different profiles for
each. Because it's a good security/privacy practice, each profile has its
own distinct SSH key. However, this causes problems because the <code>git</code> CLI
will always try to use the first SSH key that maps to the <code>github.com</code>
domain even if that key has no permissions for the target repository. The
other more straightforward problem with multiple accounts is that the
GitHub.com browser cookie asserts that you are only logged into one account
at a time.</p>
<p>My solutions for these problems are <a href="https://direnv.net/"><code>direnv</code></a> and <a href="https://support.mozilla.org/en-US/kb/containers">Firefox
Containers</a>, respectively. These use cases are straightforward
applications of these technologies, so I'm not claiming any innovation here,
but rather it took me a long time to identify these solutions, and I hope
this saves others some time. If you're not familiar with these tools, read
on for details.</p>
<a href=https://blog-test.weberc2.com/posts/multiple-github-account-tips.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/5-myths-infra-as-code.html>5 myths about infrastructure-as-code via general purpose programming languages
</a></h2>
<div class="post-meta">
<span class="post-date">2020-04-15</span>
</div>
<div class="post-body">
<p>There's an ongoing debate among infrastructure-as-code practitioners between
configuration languages like YAML and HCL and using "real programming
languages" (including domain specific programming languages) to generate
configuration. The debate is going very poorly because there is a lot
of confusion about the "real programming languages" position, so I want to
correct some of the common points of confusion ("myths") so the conversation
can focus on more substantial concerns.</p>
<a href=https://blog-test.weberc2.com/posts/5-myths-infra-as-code.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/blog-infra-updates.html>Blog infrastructure updates</a></h2>
<div class="post-meta">
<span class="post-date">2020-03-28</span>
<span class="tag"><a href="https://blog-test.weberc2.com/meta/index.html">meta</a></span>
</div>
<div class="post-body">
<p>Another year, another blog update. BitBucket is deprecating their Mercurial
support, and while I really do appreciate Mercurial, it's just easier for me to
keep everything in GitHub than trying to find another Mercurial provider. Also,
GitHub seems to be improving at a pretty rapid pace. So voila, this blog is now
hosted on GitHub. This includes my pet static site generator, <a href="https://github.com/weberc2/neon"><code>neon</code></a> which
is used to generate this site.
<a href=https://blog-test.weberc2.com/posts/blog-infra-updates.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/blog-infrastructure.html>New blog infrastructure</a></h2>
<div class="post-meta">
<span class="post-date">2019-04-06</span>
<span class="tag"><a href="https://blog-test.weberc2.com/meta/index.html">meta</a></span>
</div>
<div class="post-body">
<p>I <em>finally</em> got around to automating the publishing of this blog. It hasn't
been a high priority, since I only post a couple of times a year, but it's
always bothered me that something that is such an ideal candidate for
automation hasn't been automated. Anyway, I finally did it and I want to
describe the setup in case it's helpful for anyone looking to do the same.</p>
<a href=https://blog-test.weberc2.com/posts/blog-infrastructure.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/golang-docker-scratch-app.html>Deploying Go apps on Docker scratch images</a></h2>
<div class="post-meta">
<span class="post-date">2018-11-04</span>
<span class="tag"><a href="https://blog-test.weberc2.com/golang/index.html">golang</a></span>
<span class="tag"><a href="https://blog-test.weberc2.com/docker/index.html">docker</a></span>
</div>
<div class="post-body">
<p>NOTE: If you're here for the TL;DR, skip to the bottom.</p>
<p>A few months ago I built out some monitoring infrastructure at work using Go. I
deployed it to ECS (a Docker orchestrator, functionally similar to Kubernetes),
and for fun I decided to see how minimal I could make the image. I've used
Alpine base images before (which weigh in at about 5 MB and usually another 5 MB
for a small Go binary), but being that Go advertises itself as requiring only a
Linux kernel (most programming languages depend on an interpreter, a VM, and/or
system libraries--the latter abstract over kernel functionality and sometimes
provide a stable interface to the kernel), I wanted to see how true or practical
this was, and I wanted to better understand the things that I was taking for
granted by using distros.</p>
<p>As a matter of context, Docker has a special base image called <code>scratch</code> which
is empty--an application running on a scratch base image only has access to the
kernel (at least to the extent that containers provide isolation).</p>
<a href=https://blog-test.weberc2.com/posts/golang-docker-scratch-app.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/go-getting-started.html>Getting started with Go, 2018 edition</a></h2>
<div class="post-meta">
<span class="post-date">2018-10-14</span>
<span class="tag"><a href="https://blog-test.weberc2.com/golang/index.html">golang</a></span>
</div>
<div class="post-body">
<p>A little over 2.5 years ago, I wrote a tutorial about <a href="https://blog-test.weberc2.com/posts/installing-go-on-linux-and-osx.md">installing Go</a>. Since
then, one of the more significant changes to the Go ecosystem has been the
addition of <a href="https://github.com/golang/go/wiki/Modules">modules</a>, which effectively does away with the hardest part of
installing Go--<code>$GOPATH</code>. This change occurred in the latest version: Go 1.11.</p>
<p>In addition to installing Go, I wanted to make a guide that can get you from
nothing to a real project in half an hour. Most languages focus their
introductory material on the language and briefly cover setting up a toy
program. When you're done, you realize you have no idea how to build a
multi-file program, how to add dependencies (or at least how to add them in a
way that won't break other things on your system), how to get an editor up
and running, etc.</p>
<p>I'm not going to focus much at all on Go the language here, since it's super
easy to learn and there are already many great tutorials (the official
<a href="https://tour.golang.org">Tour</a> is probably not a bad place to start). I'm only going to go deep
enough to give you a lay of the land; if I've done my job, it should be easy
enough to Google for specific resources on any given topic (for example,
testing).</p>
<p>Now without further ado...</p>
<a href=https://blog-test.weberc2.com/posts/go-getting-started.html>Read More</a>
</div>
</div>
<div class="post">
<h2 class="post-title"><a href=https://blog-test.weberc2.com/posts/golang-interfaces-and-nil.html>Go's interfaces and nil by example</a></h2>
<div class="post-meta">
<span class="post-date">2016-10-30</span>
<span class="tag"><a href="https://blog-test.weberc2.com/golang/index.html">golang</a></span>
</div>
<div class="post-body">
<p>I've recently been involved in conversations with a few Go developers who have
expressed frustration about Go's interfaces with respect to nil. It seems not
everyone understands that interfaces are a reference type (like a pointer), and
they can reference other reference types (i.e., pointers, maps, slices, etc).
Because all reference types have a nil (zero) value, an interface can be nil
or an interface can reference a nil pointer; people may fail to realize that
the nility of the interface is independent from the nility of the thing it
points to, and when we ask (for example) <code>if err != nil</code>, we're actually asking
<em>is the interface nil?</em>, not <em>is the value behind the interface nil?</em>. Here are
a few examples that will (<em>hopefully</em>) demonstrate this clearly:</p>
<a href=https://blog-test.weberc2.com/posts/golang-interfaces-and-nil.html>Read More</a>
</div>
</div>
</div>
<div id="pagination">
<div class="pagination" id="pagination-prev">
<a href=https://blog-test.weberc2.com/index.html>« Previous</a>
</div>
<div class="pagination" id="pagination-next">
<a href=https://blog-test.weberc2.com/page-002.html>Next »</a>
</div>
</div>
</div>
<div id="footer">
<div id="footer-content" class="center-column">
<div class="footer-section">
<h4>About</h4>
<p>
Software enthusiast. Amateur blogger. I build things at
<a href="https://tempus.com">Tempus.</a> Thoughts and
opinions are my own.
</p>
</div>
<div class="footer-section">
<h4>Contact</h4>
<ul>
<li><a href="https://stranger.social/@weberc2">Mastodon</a></li>
<li><a href="https://github.com/weberc2">Github</a></li>
<li><a href="https://blog-test.weberc2.com/index.json">Syndicated Feed</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Copyright</h4>
Craig Weber 2016
</div>
</div>
</div>
</body>
</html>