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/mod_passenger.so
<IfModule mod_passenger.c>
  PassengerRoot /usr/pkg/lib/ruby/vendor_ruby/2.6.0/phusion_passenger/locations.ini
  PassengerRuby /usr/pkg/bin/ruby26
</IfModule>

Create text file with ed

Unix alike system have ed for editing text file which is i feel strange at first. I learned some time ago to create small text file out of curiosity.

Lets try by creating a text file containing 3 lines.

  1. type ed on terminal
  2. type a then enter (a is append command in ed)
  3. type your text file content.
  4. To end input mode type . then enter on a line.
  5. Type w filename.txt then enter to save to a file.
  6. Type q to quit from ed.

Here we will show in a terminal.

OpenBSD Virtualization in Action

BSD’s recently have progress for things called virtualization. FreeBSD have BHyve, NETBSD have NVMM and OpenBSD have VMM. OpenBSD VMM have been around for 1-2 years maybe and i decided to try it now. My laptop running OpenBSD 6.6 with 4GB of RAM which is having enough spare RAM to launch a VM. First thing i download OpenBSD 6.6 ISO image. My first VM will be OpenBSD guest to make things simple.

Next, we need to enable VMD through /etc/rc.conf.local by adding “vmd_flags=”. We can also start vmd immediatelly using “rcctl start vmd”.

Bleeding edge Netbeans 11.3 on DragonflyBSD 5.8

To install netbeans 11.3 do “pkg install netbeans” on your root terminal. It will take time to download 292MB netbeans + 60MB openjdk8 packages. After done installing dont forget to set PATH and JAVA_HOME environment variables. Edit your .profile file on home directory and add /usr/local/openjdk8 to “PATH=xxx:/usr/local/openjdk8; export PATH” statement. Also create JAVA_HOME=/usr/local/openjdk8; export JAVA_HOME.