Updating Lambda Functions for this Blog

This blog has a neat surprisingly monolothic install procedure. I like that it works when it works. It's not good at updating specific items though and I find myself updating some Lambda functions several times a day. One reason is to try to use Node.js 6.10 instead of the original 4.3 environment. Or reducing memory to 256MB instead of 512MB. Or adding webpack with tree-shaking (AKA dead-code elimination) to make those Lambda functions not 40k lines long (but 'only' 2k lines).

Anyway, doing this by deleting everything and re-installing everything is fine until the day there are blog entries and re-installing might unexpectedly wipe our your blag articles. Thus I'd rather be able to refresh the Lambda functions knowing that nothing else will be modified.

So here the simple steps for a more granular update procedure, mainly for for Lambda functions:

List them all

aws --region us-east-1 lambda list-functions \
| jq -r '.Functions[] | select( .FunctionName | startswith("blog_")) | .FunctionName'

Delete them all

aws --region us-east-1 lambda list-functions \
| jq -r '.Functions[] | select( .FunctionName | startswith("blog_")) | .FunctionName' \
| xargs -n 1 --replace={} aws --region us-east-1 lambda delete-function --function-name={}

Redeploy them all

Actually deploy what's missing.

node upload_lambda.js

A good way would be to have two different releases which would make a roll-back very simple too.


SoftEther - Part 3

Another year, and another installation of SoftEther again. Every time it gets a bit better though!

Server side

Extract the vpnserver part into /usr (its default location)

cd /usr/vpnserver
./vpnserver start

Now configure with the excellent Windows GUI. And enable SecureNAT and its DHCP server.

When done, do those on the server side:

cat >/etc/systemd/system/softether-vpnserver.service <<EOF
Description=SoftEther VPN Server
ExecStart=/usr/vpnserver/vpnserver start
ExecStop=/usr/vpnserver/vpnserver stop
#ExecStartPost=/bin/sleep 1 ; /sbin/brctl addif br0 tap_softether #only sometimes needed
systemctl start softether-vpnserver
systemctl enable softether-vpnserver

Client side

Install the vpnclient and vpncmd software package (vpnclient should be enough as it includes the vpncmd part). Again, install into /usr

(select 2 to configure the vpnclient)
NicCreate box3
AccountCreate mybox3 /SERVER:vpn.fqdn:5555 /HUB:Box3Hub /USERNAME:myuser /NICNAME:box3
AccountPasswordSet mybox3
(password for user myuser)
# Autostart:
AccountStartupSet mybox3
# Connect:
AccountConnect mybox3
# Check
AccountStatusGet mybox3

And to start it all with a fixed IP, add to /etc/rc.local:

( /usr/vpnclient/vpnclient start ; sleep 10 ; ip addr add 192.168.30.XX/24 dev vpn_box3 ) &

Moving Blog

My old blog is reachable here: https://harald.aws.qw2.org/wordpress/

Copied from http://harald.studiokubota.com/wordpress/ and converted via HTTrack into static web pages. As a result I can finally use https!