Project

General

Profile

Projects

Filters

Apply Clear

  • NUT - For UPS Monitoring

    Main config files here:

    vi /usr/local/etc/nut

    • Bhyve

      To kill a Byve process

      Find the Process ID (PID) of the bhyve process:
      Use pgrep or ps to find the process ID associated with your specific VM.

      pgrep -l bhyve

      7790 bhyve

      Or

      ps aux | grep bhyve

      root 7929 0.0 0.0 14164 2668 1 S+ 09:08 0:00.00 grep bhyve...

    • Create Bhyve startup scripts for boot

      startbhyvevm.sh - Used to start a VM and handle reboots & shutdown
      startbhyvevms.sh - Used to call startbhyvevm.sh to start each VM
      listofvms - List of VM name and path to settings parameters for each VM called by startbhyvevms.sh

      See Files.

    • crontab

      View, edit or create new crontab:

      crontab -e

      SHELL=/bin/sh
      # Order of crontab fields
      # minute hour mday month wday command
      @reboot /tank/myscripts/startbhyvevms.sh

      View cronjobs:

      root@HONE-SERVER:/home/sam # crontab -l...

    • Install Janssen Server

      Start the VM:

      bhyve -AHP -s 0:0,hostbridge -s 31:0,lpc \
      -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,/dev/zvol/tank/vms/vm3/janssen-ubuntu24-zvol \
      -s 0:5:0,virtio-rnd \
      -c 4 -m 8192M \
      -s 29,fbuf,tcp=0.0.0.0:5903,w=800,h=600,wait \
      -s 30,xhci,tablet \...

    • Install RockyLinux 10.1 into Bhyve VM for wardrobestores2.ddns.net

      bhyve -AHP -s 0:0,hostbridge -s 1:0,lpc \
      -s 2:0,virtio-net,tap4 -s 3:0,virtio-blk,/dev/zvol/tank/vms/vm4/tws-rockylinux-zvol \
      -s 0:5:0,virtio-rnd \
      -s 4:0,ahci-cd,/tank/images/Rocky-10.1-x86_64-minimal.iso -c 2 -m 4096M \
      -s 29,fbuf,tcp=0.0.0.0:5904,w=800,h=600,wait \...

    • Install Windows 2019 Data Centre

      Setting up a guest for Windows versions 10 or earlier can be done directly from the original installation media and is a relatively straightforward process. Aside from minimum resource requirements, running Windows as guest requires wiring virtual machine memory (flag -w) and booting with an UEFI bootrom....

    • Migrate wardrobestores.co.uk to new hosting provider (OPIL)

      wardrobestores.co.uk is currently with EUKHost.

    • MySQL CLient Output into a variable for /bin/sh script

      Various scripts below for getting results into a variable, Tab formatted

      myvariable=$(echo "SELECT * FROM NIC" | mysql -s --database=opil -u"$user" -p"$pass" -h"$host")

      -s makes results Tab delimited

      result=`mysql -s -u "$user" -p"$pass" -h"$host" <<EOF...

    • NGINX

      Use to create multiple reverse proxies to origin servers using SSL and certificates.

      Create jail container:

      zfs create tank/jails/containers/nginx

      Create jail then install nginx and nginx-acme:

      pkg install nginx nginx-acme

      Updating FreeBSD-ports repository catalogue......

      • ISPConfig

        Start the VM:

        bhyve -AHP -s 0:0,hostbridge -s 31:0,lpc \
        -s 2:0,virtio-net,tap2 -s 3:0,virtio-blk,/dev/zvol/tank/vms/vm2/ispconfig-debian12-zvol \
        -s 0:5:0,virtio-rnd \
        -c 4 -m 4096M \
        -s 29,fbuf,tcp=0.0.0.0:5902,w=800,h=600,wait \
        -s 30,xhci,tablet \...

    • Squid Proxy Server

      Create directories for certificates:

      /usr/local/etc/squid/certs/janssen1.ddns.net

      Enable SSH in jail for passing certificates from other VMs and jails over to the Squid Server.

      Use SCP for passing certificates over:

      scp -r /etc/letsencrypt/live/* sam@192.168.1.153:/home/sam/janssen1.ddns.net/...

    • vpnserver

      pkg install openvpn

      Updating FreeBSD-ports repository catalogue...
      FreeBSD-ports repository is up to date.
      Updating FreeBSD-ports-kmods repository catalogue...
      FreeBSD-ports-kmods repository is up to date.
      All repositories are up to date.
      The following 5 package(s) will be affected (of 0 checked):...

    • ZFS Zpool Create Mirror

      The recommended way to create a ZFS mirror in FreeBSD is to use GPT-partitioned disks rather than raw drives, labeling them to ensure consistency. The best approach involves creating one partition on each disk (e.g., ada2p1, ada4p1) and using zpool create <pool_name> mirror /dev/gpt/disk1 /dev/gpt/disk2....

    • ZFS Zvol

      Steps to Rename a Zvol:

      1. Stop services: Shut down VMs or applications using the zvol (e.g., bhyve virtual machine).
      2. Rename the zvol:

      zfs rename tank/vm-disk1 tank/new-vm-disk1
      E.G.

      zfs rename tank/linuxdebian12disk tank/vm-2-linuxdebian12disk...

Also available in: Atom