BurgundyWall is located in Calgary, Canada, and the inspiration for the domain name is was located at the end of my living room. If you're really curious you can read (a very little) about me.
For various reasons I don't really like black even if it's very good at what it does.
The readability of a Django model with aligned fields vs after running black is a good example of why I'd never use it by default.
Anyhow…
It would be nice to use black
occasionally on snippets of code from
inside my editor (vim
) but that almost never works as the first line
is already indented.
Not gonna lie, getting this to work was hard, plus I'm still not
super happy with the results but it's good enough. You can set
a static ip in the Proxmox cloud-init
disk and that's what you'll
end up with on first boot.
Note: this probably also applies to Ubuntu 18.04
We currently host some of our customers on our private cloud and as a result we need to manage an ssl certificate for them as well. Traditionally we've used a standard SSL provider but this was not only pricey, more importantly it was a lot of work for the support staff to get certs, update certs, deploy certs, etc.
I just figured out how to compress any file to a fixed size. I can't even begin to tell you how revolutionary this is.
This will change the world over night:
- you'll be able to download a 4k movie in a Tweet™
- upload an image of your hard drive in milliseconds
- compression speed is O(n), as fast as your disk can read
- written in python, zero external dependencies
- any file compresses to ~ 130 bytes, yes, you read that right
Because I believe in Open Source I'm releasing this to the world. Pull requests for decompress()
are welcome.
I couldn't sleep last night and ended up wondering if you'd make more money over 15 years if you made 1% interest the first year up to 15% on the last year or vice versa, making 15% the first year and 1% the last.
So my gut tells me that making 15% the first year will yield more money as you're making interest on a larger amount (after the first year) and compound interest loves time.
Maybe you'll end up with same at the end but I can't imagine having an incrementing interest rate will yield more than a decrementing one.
To the spreadsheets!
Here's a crappy little script that automates the steps in Fix proxmox containers that won't start
#!/bin/bash
if [ -z "$1" ]; then
containers=`pct list | grep stopped | awk '{print $1 " "}'`
else
containers=$1
fi
echo "restarting containers: $containers"
for m in $containers; do
lxc-start -n $m &
echo "force started $m"
done
echo "sleeping for 2 minutes while containers start"
sleep 120
for m in $containers; do
echo "shutting down $m"
pct shutdown $m;
echo "starting $m"
pct start $m &
done
With the version v0.10.0
of Nomad a very important new feature has landed, network namespaces. Network namespaces allows integration with Consul Connect and that allows you to connect to remote services without having to know their address and port. Plus some security stuff but I care more about my services working than being securely broken.
You can read more official information here:
- https://www.nomadproject.io/guides/integrations/consul-connect/index.html
- https://www.hashicorp.com/blog/hashicorp-nomad-0-10-beta/
- https://www.hashicorp.com/blog/consul-connect-integration-in-hashicorp-nomad/
Consul Connect in Nomad are called sidecars. However… sidecars are an advanced feature and the docs and examples are very confusing. At least I found them very confusing. So here is a slightly modified version of the example job file with lots of comments that hopefully explains how to use this great new feature.
My cluster was throwing warning Legacy BlueStore stats reporting detected
and we could just not abide that.
Here's a simple way to upgrade:
cd /var/lib/ceph/osd
ls # note your osd numbers
ceph osd set noout
for n in 7 8 9 10 11 12 ; do
systemctl stop ceph-osd@$n.service;
ceph-bluestore-tool repair --path ceph-$n;
systemctl start ceph-osd@$n.service;
systemctl status ceph-osd@$n.service;
done
# I like to wait until the cluster goes back to green
# before doing the same on the next host
ceph osd unset noout