NetBSD way to check battery status

Different with OpenBSD which we can use apm command to check battery status, NetBSD have different way. Below command work well on NetBSD 9 amd64.

envstat -d acpibat0


Digest Gem Ruby 2.6

Digest gem on ruby 2.6 is part of standard library. No need to do “gem install digest” anymore ! Here is proof on NetBSD 9.

Sinatra Ruby web app server on NetBSD 9

To host sinatra ruby web application on NetBSD 9 we need to install apache http server, ruby, and passenger.

To install ruby 2.6, login as root and do pkgin install ruby. This will automatically install ruby version 2.6. After installed, install sinatra and your other gems using gem install sinatra.

Next is to install apache http server. On terminal execute pkgin install apache. Copy rc.d script from /usr/pkg/share/examples/rc.d/apache to /etc/rc.d folder (this step just following after install message). Edit /etc/rc.conf and add a line containing apache=YES to enable auto start of apache on system start up.

Install passenger module to apache by executing pkgin install ap24-ruby26-passenger. After install edit /usr/pkg/etc/httpd/httpd.conf and add as follow.

LoadModule passenger_module lib/httpd/
<IfModule mod_passenger.c>
  PassengerRoot /usr/pkg/lib/ruby/vendor_ruby/2.6.0/phusion_passenger/locations.ini
  PassengerRuby /usr/pkg/bin/ruby26