blog.masa23.jp
Notes on Ubuntu 22.04
Upon upgrading to Ubuntu 22.04, it seems that the way to specify gateway4 and gateway6 in netplan has been deprecated.
Error Messages `gateway4` has been deprecated, use default routes instead. See the 'Default routes' section of the documentation for more details. `gateway6` has been deprecated, use default routes instead. See the 'Default routes' section of the documentation for more details. Before Fix network: ethernets: ens3: addresses: - 192.168.0.2/24 gateway4: 192.168.0.1 nameservers: addresses: - 8.
…
2022-04-28Configuring Wireguard with netplan
Here’s a note on setting up Wireguard using netplan. I couldn’t find many Japanese articles on this topic.
Tested on Ubuntu 20.04.
Server Side Generating private and public keys # umask 077 # wg genkey | tee private.key | wg pubkey > public.key netplan configuration network: tunnels: wg0: mode: wireguard key: <Generated private.key> port: 50000 # UDP port number to listen on addresses: [ 192.168.2.1/30 ] # IP address for wg0 peers: - allowed-ips: [0.
…
2021-04-29Publishing a Website with Web Accelerator and Object Storage
I tried using the newly integrated feature that allows linking Sakura Cloud’s Web Accelerator with Object Storage.
Web Accelerator Now Supports Object Storage Integration
This blog is a static site generated by Hugo, so I wanted to distribute this site using Object Storage and Web Accelerator.
Currently, it is being distributed via Web Accelerator + Sakura Rental Server.
Creating a Bucket in Object Storage For pricing information, please check here
…
2021-04-15Splitting Logs Every Hour with logrotate and Compressing with zstd
I will leave a note about when I wanted to split nginx logs every hour while compressing them with zstd using logrotate.
Overview Simply putting the settings in /etc/logrotate.conf or /etc/logrotate.d/ will basically execute it with the daily CRON of /etc/cron.daily/logrotate.
This time, since I want to rotate logs every hour, I prepared a separate logrotate setting and made it run using the timer function of systemd.
Enabling zstd # apt install zstd Zstandard Wikipedia logrotate I will create /etc/logrotate-nginx.
…
2021-03-29Installed an Outlet in the Storage Room
A while ago, during the Golden Week due to COVID-19, I did a DIY project to add an outlet in the storage room.
Note that I have a second-class electrical worker license.
I heard that SNS might get chaotic if I don’t properly mention this, so just in case
Necessary Items Item Purchase Link Embedded Outlet Amazon Rakuten Gypsum Board Clamps Amazon Rakuten Gypsum Board Saw Amazon Rakuten VVF Cable Amazon Rakuten Drill for making holes in the wall (electric or manual) Screwdriver (electric or manual) Securing the Power Source Since there is an outlet directly behind the place where I want to install the outlet in the storage room,
…
2021-03-02Using Global IP Addresses with LXD Containers on Sakura Cloud
This is a note about using global IP addresses directly on LXD containers or assigning local switch IP addresses directly in Sakura Cloud.
We will be building this on Ubuntu 20.04.
Configuration Directly connected to the router + switch Two disks: one for the VM OS and one for the LXD containers Setup The OS installation steps are omitted. We use the Ubuntu 20.04.01 LTS archive image provided by Sakura Cloud.
…
2021-02-11Occasional Panic with FreeBSD 12.2 Jail and epair+bridge
This is a note about experiencing kernel panic in an environment using jail+epair+bridge (VIMAGE) on FreeBSD 12.2.
Environment vtnet0 => bridge0 => epair0a => jail(epair0b) Various settings are written in jail.conf, and processes to remove the epair from the bridge and delete the epair are included in exec.poststop.
exec.poststop ="/sbin/ifconfig bridge0 deletem epair1a"; exec.poststop+="/sbin/ifconfig epair1a destroy"; Stopping this jail environment caused kernel panic about once every 2-3 attempts.
Fatal trap 12: page fault while in kernel mode cpuid = 3; apic id = 03 fault virtual address = 0x410 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff80b9f237 stack pointer = 0x28:0xfffffe003369c370 frame pointer = 0x28:0xfffffe003369c3f0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 4456 (ifconfig) trap number = 12 panic: page fault cpuid = 3 time = 1612947580 KDB: stack backtrace: #0 0xffffffff80c0aa85 at kdb_backtrace+0x65 #1 0xffffffff80bbed3b at vpanic+0x17b #2 0xffffffff80bbebb3 at panic+0x43 #3 0xffffffff8108e911 at trap_fatal+0x391 #4 0xffffffff8108e96f at trap_pfault+0x4f #5 0xffffffff8108dfb6 at trap+0x286 #6 0xffffffff81066938 at calltrap+0x8 #7 0xffffffff80bb9591 at _rm_rlock_hard+0x3c1 #8 0xffffffff80ce5ce6 at rtinit+0x2a6 #9 0xffffffff80d3873e at in_scrubprefix+0x29e #10 0xffffffff80d5001d at rip_ctlinput+0x8d #11 0xffffffff80c4922c at pfctlinput+0x5c #12 0xffffffff80cbb4fa at if_down+0x12a #13 0xffffffff80cb90d0 at if_detach_internal+0x150 #14 0xffffffff80cb8df0 at if_detach+0x50 #15 0xffffffff8297ebb1 at epair_clone_destroy+0x81 #16 0xffffffff80cc0c4d at if_clone_destroyif+0xdd #17 0xffffffff80cc0b12 at if_clone_destroy+0x1a2 Uptime: 3m28s 55 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu, (kgdb) #0 doadump () at src/sys/amd64/include/pcpu_aux.
…
2021-02-10Sending Data from BME280 to Graphite using ESP32
This is a record of obtaining temperature, humidity, and pressure with the BME280 and sending it directly to Graphite via ESP32’s Wi-Fi connection. There will be no explanation of Graphite or Grafana. Items Used Item Name Purchase ESP-32S AliExpress Amazon 楽天 BME280 AliExpress Amazon 楽天 Connection Diagram The BME280 and ESP-32S are connected via I2C. The GPIO21 of ESP-32S serves as SDA, and GPIO22 serves as SCL. ESP-32S
…
2021-02-08How to Take FreeBSD Crash Dumps
Leaving this as a personal memo because I forget every time.
How to Take FreeBSD Crash Dumps Add dump settings to /etc/rc.conf dumpdev="/dev/vtbd0p3" dumpdir="/var/crash" Assign the swap area to dumpdev. Check the device assigned to swap with swapinfo.
# swapinfo Device 1K-blocks Used Avail Capacity /dev/vtbd0p3 4194264 0 4194264 0% It seems dumpdev="AUTO" also works.
If it’s a one-time thing, you can execute it as follows: dumpon /dev/vtbd0p3 Check the current settings # dumpon -v -l kernel dumps on vtbd0p3
…
2021-02-03Apache 2.4 ACL Rewrite from 2.2
Personal notes from the past.
In Apache 2.4, you can still use Allow and Deny for ACL settings with mod_access_compat.
Rewriting ACL from Apache 2.2 to 2.4 Allowing All Apache 2.2 <Directory "/home/www"> Order allow,deny Allow from all </Directory> Apache 2.4 <Directory "/home/www"> Require all granted </Directory> Denying All Apache 2.2 <Directory "/home/www"> Order deny,allow Deny from all </Directory> Apache 2.4 <Directory "/home/www"> Require all denied </Directory> Allowing Specific IP Address Apache 2.
…
2021-02-02