Skip to content

Instantly share code, notes, and snippets.

@Mostly-BSD
Mostly-BSD / FreeBSD-AARCH64_and_RISCV64_Using_QEMU.md
Last active May 12, 2022 02:56
How to run FreeBSD ARM64 and RISC-V64 images under FreeBSD x86_64

How to run FreeBSD ARM64 and RISC-V64 images under FreeBSD x86_64

Quick and easy way to try out FreeBSD Arm64 and RISC-V64 images on a x86_64 host.

Notes:

  • We are going to use the pre-built VM images supplied by FreeBSD instead of installing from scratch.
  • We will convert the .raw image files to zvols
  • We will bridge the network interface on the host and use a tap interface on the VM

Step 1: Install Necessary Packages

@Mostly-BSD
Mostly-BSD / FreeBSD-Nvidia-510.md
Last active April 5, 2024 18:11
Step-by-step instructions on installing the latest NVIDIA drivers on FreeBSD 13.0 and above.

How to get the Latest NVIDIA drivers on FreeBSD

Step-by-step instructions on installing the latest NVIDIA drivers on FreeBSD 13.0 and above.

1.0 Clean Up Existing Drivers

IMPORTANT: Log out of X session. Make sure you Desktop Manager (sddm|slim) is off. You need to be on the console.

# Create a boot env incase we need to rollback
sudo bectl create `date +%Y%m%d`-BeforeNvidia-Upgrade
@Mostly-BSD
Mostly-BSD / Python Development on FreeBSD.MD
Last active November 29, 2021 20:30
Python Development on FreeBSD 13

Pythonic way to setup Python Development Environment on FreeBSD

This gist lists steps needed to setup python development environment on FreeBSD using isolated virtual environments.

Why not use pkg or ports?

  • Pythonic way is to create virtual enviroments for projects and add libs to these venvs not system python.
  • Binary packages available only for one python version. Currently this is 3.8.
  • Although we can build python packages against another version using ports, it's still not the Pythonic way.
#!/usr/bin/env bash
set -e
cd /tmp
fetch https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts
echo "server:" > /usr/local/etc/unbound/ads.conf
cat hosts | grep '^0\.0\.0\.0' | awk '{print "local-zone: \""$2"\" redirect\nlocal-data: \""$2" A 0.0.0.0\"\nlocal-data: \""$2" AAAA ::\"\n"}' >> ads.conf
rm -f hosts
service unbound restart
@Mostly-BSD
Mostly-BSD / 001-README.md
Last active May 3, 2021 01:36
Colorizing outputs of some FreeBSD CLI programs

Colorized outputs for some FreeBSD CLI programs

More schreenshots uploaded here.

Screen shot

Commands Colorized so far...

@Mostly-BSD
Mostly-BSD / VoidLinux-On-System76_GalagoPro2.md
Last active October 22, 2021 12:39
Some Notes on Void Linux on System76 Galagopro 2.

These are some notes for running void linux on System76 Galagopro 2. Don't blindly cut-copy-paste, use your common sense.

Kernel

Some useful Kernel boot options.

In /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="splash loglevel=4 slub_debug=P page_poison=1 ec_sys.write_support=1 atkbd.reset intel_pstate=skylake_hwp psmouse.synaptics_intertouch=1 video=eDP-1:2048x1152-32@60 i915.enable_dc=2 i915.enable_guc=3 i915.modeset=1 i915.disable_power_well=0 i915.fastboot=1"
@Mostly-BSD
Mostly-BSD / build-void-mipsel-musl.sh
Last active August 24, 2019 22:52
Shell Script to build minimum viable void linux packages for mipsel-musl
# Steps to build mipsel-musl packages from x86_64 (glibc)
# Bootstrap x86-64 glibc
./xbps-src binary-bootstrap
# Now cross compile base-chroot-musl for x86_64-musl
./xbps-src -a x86_64-musl pkg base-chroot-musl
# Prepare a new masterdir with the musl packages
./xbps-src -m masterdir-x86_64-musl binary-bootstrap x86_64-musl
@Mostly-BSD
Mostly-BSD / README.md
Last active September 1, 2019 12:22
Colorized outout of Void Linux's xbps-query and sv status commands

Instructions

Just some color for xbps-query and sv status commands.

  • xbps-install grc
  • Copy the attached 2 files in /usr/share/grc/
  • xbps-query -Rs <sreach-string> | grcat /usr/share/grc/conf.xbps-query
  • sv status /var/service/* | grcat /usr/share/grc/conf.sv
  • Enjoy!