blog.masa23.jp

Sending 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-08

How 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-03

Apache 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

Network Command Notes for Linux/FreeBSD

Personal notes on frequently used and easily forgotten network commands. Checking Operation Linux FreeBSD Check interfaces ip link show ifconfig -l Check interfaces (including addresses) ip addr ifconfig Check interface packet counters ip -s link dev netstat -idb -I ARP table ip -4 neighbor arp -a IPv6 neighbor table ip -6 neighbor ndp -a Bridge Operation Linux FreeBSD Add interface brctl addif br0 eth0 ifconfig bridge0 addm vtnet0 Remove interface brctl delif br0 eth0 ifconfig bridge0 deletem vtnet0 Create bridge interface brctl addbr br0 ip link set up dev br0 ifconfig bridge0 create ifconfig bridge0 up Delete bridge interface ip link set down dev br0 brctl delbr br0 ifconfig bridge0 down ifconfig bridge0 destroy VLAN Operation Linux FreeBSD Create VLAN interface ip link add link eth0 name eth0.
2021-01-29

Content Protection Using Web Accelerator

This article is the 13th entry in the Sakura Internet Advent Calendar 2020. Content Protection Using One-Time URL When distributing content to a specific group, it often involves downloading content after password authentication. However, when using it with a CDN, BASIC authentication might not be available, and changing the URL can result in the cache being treated as a different entity, making CDN utilization difficult. Web Accelerator has a One-Time URL feature, which I’ll introduce for content protection.
2020-12-13

Using Sakura Cloud Web Accelerator (CDN) with AWS S3

This content was moved from Qiita. While it’s common to deliver images and other content with S3 + CloudFront, if the delivery target is limited to Japan, it might be cheaper to use S3 + Sakura Cloud’s CDN service, Web Accelerator. So, let’s set it up. I haven’t verified if the actual billing will be cheaper. The delivery fee for CloudFront is 0.140 USD (15.8 yen as of December 28, 2017) per GiB in Japan, so Web Accelerator, which costs 5 yen (including tax) per GiB, seems cheaper.
2018-12-28

Ubuntu 18.04 Configuration Notes

This content was moved from Qiita. Configuration Notes for Ubuntu 18.04 Personal notes on changes in Ubuntu versions that caught my attention. Changing the Hostname # hostnamectl set-hostname sv1.example.jp Setting up iptables With netplan, it doesn’t work well with if-pre-up.d? Using iptables-persistent works well. # apt install iptables-persistent # <configure iptables> # iptables-save > /etc/iptables/rules.v4 # ip6tables-save > /etc/iptables/rules.v6 Configuring netplan Place the file in yaml format in /etc/netplan/*.yaml network: ethernets: ens3: addresses: - 192.
2018-05-28

Using Let's Encrypt with Sakura Cloud Web Accelerator (CDN)

This content has been moved from Qiita. Let’s use Let’s Encrypt with Sakura Cloud Web Accelerator. Update (2021/01/29) The Web Accelerator now has an auto-renewal feature for Let’s Encrypt, so there’s no need for the following efforts anymore! 🎉 Announcing Automatic Renewal of Let’s Encrypt Certificates on Web Accelerator Using Automatic Renewal Certificates for Let’s Encrypt on Web Accelerator Overview When using a custom domain with Sakura Cloud Web Accelerator, you can enable SSL (including HTTP2 support) by installing an SSL certificate.
2017-01-25

No Connectivity When More Than 20 IP Addresses Are Added with keepalived

This content has been moved from Qiita. In a certain setup, keepalived is used as a load balancer with VRRP and LVS. This load balancer is configured with numerous IP addresses (due to SSL certificates, etc.) as shown below. I encountered a problem where the newly added IP addresses had no connectivity. keepalived Load Balancer Configuration (DSR Configuration) IP addresses used for SSL on the VIP are routed from the router using static routes and added as needed.
2016-05-16

Struggles with Golang Date Formatting

This content has been moved from Qiita. To specify date formatting in Golang, you use the time.Format function. I needed to format dates for graphite-api using the following format: However, I encountered issues where it worked on some environments but not on others, wasting a lot of time. The problem turned out to be a bug that was fixed in a Golang version update. Specifying the Format Specified format: HH:SS_YYYYMMDD So in Golang: Format("15:04_20060102") Test Code package main import ( "fmt" "time" ) func main() { now := time.
2016-05-16