DIY Wooden Long Desk

Posted by Dave Eddy on Dec 17 2019 - tags: diy

In 2016 I built an Overwatch Themed Desk for my bedroom to use with my gaming machine. Recently, I’ve been getting really into streaming on Twitch and I needed more desk space. I want to do more tech related streams, and gaming in general, and need more desk space for multiple computers.

I decided I should build a new longer desk to replace the desk I currently use. I wanted it to be the same height and depth, but this time make it 6 feet long.

Read More...


SmartOS COAL on Linux KVM with Virt Manager

Posted by Dave Eddy on Feb 12 2019 - tags: tech

COAL, or Cloud-on-a-Laptop, is an easy way to run and test SmartOS and the Triton Stack in a self-contained VM meant to be run on a laptop. The sdc-headnode repository makes a lot of assumptions when building a COAL image about using VMWare for virtualization on an OS X laptop. However, with some modifications it is possible to run COAL on Linux via KVM managed through virt-manager.

To get virt-manager setup and running on Void Linux, you can follow my guide KVM Virtualization with virt-manager on Void Linux.

Nested Virtualization (optional)

Before getting started with the COAL building process, you can choose to enable nested virtualization if your hardware supports it. This is required if you would like to run bhyve zones on your COAL setup. Note that this setup assumes an Intel CPU.

You can check if your CPU supports nested virtualization by running:

$ grep ^flags /proc/cpuinfo | grep -c ' vmx '
8

Read More...


KVM Virtualization with virt-manager on Void Linux

Posted by Dave Eddy on Feb 11 2019 - tags: tech

Running and managing virtual machines on Linux is very easy using the virt-manager GUI program. Under the hood, the virtualization technology takes advantage of KVM (Kernel Virtal Machine) in the Linux kernel. The result of both of these together is fast and efficient hardware virtual machines with a really easy and straightforward GUI to manage them.

For this post, I’ll be using the following tools I’ve talked about in my blog post Using Void Linux as my Daily Driver:

  • vsv - Void Service Manager
  • vpm - Void Package Manager

Installation

Install the following packages to get started:

sudo vpm i virt-manager libvirt qemu

Start the services that are created by these packages:

sudo ln -s /etc/sv/libvirtd /var/service
sudo ln -s /etc/sv/virtlockd /var/service
sudo ln -s /etc/sv/virtlogd /var/service

Use vsv to check the status of the services:

sudo vsv status virt

Read More...


Running a Bitcoin Full Node on SmartOS

Posted by Dave Eddy on Jan 20 2019 - tags: tech

Running a Bitcoin full node is a great way to ensure the health and integrity of the decentralized Bitcoin network. This blog post is meant to be a guide for compiling, running, and monitoring a Bitcoin full node on a server, and as such won’t delve too much into the specifics as to what the node does, or why it’s important to the network health. If you want to know more check out 6 Reasons To Run a Bitcoin Full Node.

getblockchaininfo

Put simply, running a full node will add to the large number of full nodes running across the world to support the Bitcoin network. The nodes ensure the rules of the protocol and consensus algorithms in place are upheld and enforced, which is what fundamentally allows Bitcoin to work and function the way it should.

Miners create new blocks and submit them to the network for verification - it’s the job of the full nodes to verify these blocks (groups of transactions) and ultimately accept or reject them based on their validity. Every full node will verify the validity of any and all blocks submitted to the network and, for each block, decide if it will be the next new block in the chain or whether it should be thrown out in the case that it is invalid (by either a bug in the mining software or a bad actor trying to undermine the network). Full nodes are the final arbiters when it comes to determining which transactions are valid or invalid.

Provision the VM

I provisioned a fresh SmartOS 16Q4 LTS instance with the following JSON payload:

Read More...


Run User Scripts on Suspend and Wakeup on Void Linux

Posted by Dave Eddy on Oct 01 2018 - tags: tech

While using Void Linux on my laptop, I wanted some way to trigger scripts as my user when the machine went to sleep and when it resumed. The main goal of this was to be able to lock my machine using i3lock on suspend.

I currently use xss-lock to register i3lock to be called whenever the screensaver is activated with this command (run at session start):

xss-lock -- ~/bin/i3lock-retry -enfi ~/Pictures/lock.png

With xss-lock running, I set my machine to lock automatically after 600 seconds (10 minutes) of inactivity with:

xset s 600

And locking my machine can be done manually by activating the screensaver with:

xset s activate

Note: i3lock-retry is a simple wrapper-script that calls i3lock continuously until it exits successfully (i.e. when the correct password has been entered). I’ve had some issues with i3lock crashing in the past and I just have this wrapper in place because of paranoia over ensuring my system locks correctly.

Read More...


Logging for runit on Void Linux with svlogger

Posted by Dave Eddy on Sep 26 2018 - tags: tech

Update 10/01/2018

svlogger can be easily replicated with vlogger(8), which is shipped with void-runit. This comment from Duncaen on reddit explains it:

I wrote vlogger(8) which works similar, by default it logs to syslog and if /etc/vlogger is an executable file it will exec into /etc/vlogger with the service name as argument.

The script would be something like this:

#!/bin/sh
exec svlogd /var/log/$1

The main idea is to make it simple to switch from logging to syslog to svlogd by just creating /etc/vlogger. Its part of the runit-void package and services could be shipped with this as default at some point.

I created /etc/vlogger as an executable with the following contents:

#!/bin/sh
logdir=/tmp/sv/log/$1
mkdir -p "$logdir"
exec svlogd -tt "$logdir"

Updated my existing log services with:

cd /var/service
for f in */log/run; do sudo ln -svf /usr/bin/vlogger "$f"; done

And restarted them with:

sudo sv restart /var/service/*/log

The rest of the post is left here for historical purposes.


I’ve been using Void Linux on my laptop for the last month or so and it has just been fantastic; using runit to manage services has been so incredibly easy. I wrote vsv to make the output a little more colorful and the usage slightly easier, but even just using sv directly has just been great.

Read More...


vsv - Void Service Manager

Posted by Dave Eddy on Sep 20 2018 - tags: tech

In my previous post, Using Void Linux As My Daily Driver, I wrote that I used vpm as a wrapper for the xbps-* commands to manage packages on Void Linux. I like how convenient the tool is and how it works (it knows it’s a wrapper command and it doesn’t try to hide that fact). It also makes the output very colorful, which I do like a lot. I know that’s a bit of a simple reason, but I personally just like very colorful output (with the option to disable it of course).

Managing services on Void Linux is already fairly easy using the sv command; however, I felt a couple of things could be made simpler and that the output could be more obvious at a quick glance.

With that, vsv was born.

vsv is a bash script wrapper for the sv command that can be used to query and manage services via runit. It was made specifically for Void Linux but should theoretically work on any system using runit to manage services.

vsv was inspired by vpm. vsv is to sv what vpm is to the xbps-* commands. vsv is available under the MIT License on GitHub:

https://github.com/bahamas10/vsv

Read More...


Using Void Linux As My Daily Driver

Posted by Dave Eddy on Sep 15 2018 - tags: tech

I’ve been using Void Linux on my laptop for the last couple of weeks and I have been absolutely loving it. The whole system feels lean, minimal, fast, and has amazing battery life. I’ve found a majority of the software that I’ve used previously on Arch Linux is either available or compiles just fine on Void. I’ve run into a couple of issues because I’m using the musl build of Void, but I’ve managed to deal with them without too much trouble.

</img>

vpm - Void Package Manager

On the basic usage page for XBPS, there are a number of example commands for installing a package, searching for a package, removing a package, etc.

Read More...


Manage PATH Variable in Bash

Posted by Dave Eddy on Sep 12 2018 - tags: tech

Over the weekend I wrote what can only be described as a completely over-engineered solution to something that was really nothing more than a minor annoyance to me. I noticed that some paths in my $PATH environmental variable were duplicated, and some were there that didn’t exist on the filesystem, and over all it was just a bit of a mess.

I remember encountering the pathmunge bash function a couple years ago but I didn’t want something that relied on grep or any external commands - I wanted to be able to manage $PATH (and $MANPATH) with pure bash.

Introducing bash-path.

Functions to modify colon separated variables like $PATH or $MANPATH

https://github.com/bahamas10/bash-path

All of the logic is in a single file and can be sourced or copied directly into a bashrc file to be used. I pulled in bash-path to my dotfiles with this simple commit

Example

Given the following environment:

$ . path.bash
$ PATH='/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'

You can add to $PATH using path_add (similar to pathmunge):

$ path_add /my/new/bin
$ path_add /my/new/sbin before
$ echo "$PATH"
/my/new/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/my/new/bin

Read More...


ThinkPad X1 Carbon Gen 6 BIOS Update

Posted by Dave Eddy on Sep 09 2018 - tags: tech

I purchased the ThinkPad X1 Carbon (6th Gen) laptop over a month ago and have been happily using Void Linux on it for the last couple of weeks or so. The battery on this thing is absolutely amazing - without any tuning specifically for the battery itself, I can get really great battery life.

I posted about my install on reddit and was asked specifically about the power usage. I said:

I keep firefox with ~15 tabs open and have a couple terminal windows open - that’s my daily workflow, and I can get like 8 full hours on this laptop! Sleeping however is a nightmare. It doesn’t support s3 out of the box and I have yet to try this patch to enable deep sleep - i’ll report back when I do. When the laptop is suspended it’ll last about 48 hours before it is completely dead (WHICH IS TERRIBLE).

However, my friend Mike showed me this tweet showing that the latest ThinkPad BIOS update added support for better sleeping on Linux! I really wanted better battery life when sleeping, so I jumped into trying to update it as fast as I possibly could - and in that process, I learned a lot and failed pretty hard at first. This is my journey into getting a good nights sleep on my ThinkPad with Linux.

Read More...