Skip to content

Instantly share code, notes, and snippets.

View danmack's full-sized avatar

Dan Mack danmack

View GitHub Profile
@danmack
danmack / zig-binary-sizes.md
Created November 26, 2023 21:42
ziglang binary sizes by compiler option test

Zig Binary Sizes by Compiler Option

Testing binary sizes created by zig on an alpine linux using zig built from its master branch.

$ ls -l release* | sort -n -k4 | awk '{ printf("%21s %8d bytes\n", $NF, $5);}'
        releaseSmall    13696 bytes
releaseFast-stripped   186496 bytes
releaseSafe-stripped 224096 bytes
@danmack
danmack / gitlab-lfs-self-signed.md
Created October 20, 2023 20:26
Git LFS on Private Self-Signed GitLab Server

How to set up and work with an LFS repo

This writeup describes how to work with LFS on an internal / private gitlab server using self signed certificates.

Setting up your Git Software

Your git software (git cli command most likely) will need to have the git-lfs software installed. If you are on Ubuntu Linux, this add-on is available in the apt software repo, for example:

@danmack
danmack / nix-alpine.org
Last active April 4, 2024 18:44
install NIX package manager on Alpine Linux

NIX Package Manager Install on Alpine Linux

System Information

  • alpine 3.17.1, 3.18, 3.19 and edge x86-64
  • multiple linux kernels worked 6.1.8-lts w/zfs and 6.6.8-lts
  • edge, testing apk repos enabled

Preparation

@danmack
danmack / alpine-podman-rootless.md
Last active January 15, 2024 19:27
Podman Rootless on Alpine Linux

How to do rootless Podman on Alpine Linux

Using recent podman (3.x) on 5.10.x Alpine Linux Kernels

apk add podman util-linux

enable and start the cgroups and podman services

@danmack
danmack / gist:3a64940b46490b57d01138f9f205d30c
Last active May 7, 2019 19:44
nvidia card driver issue - fallback to nouveau
fc30 packages installed:
$ rpm -qa|grep nvidia
xorg-x11-drv-nvidia-418.56-1.fc30.x86_64
xorg-x11-drv-nvidia-kmodsrc-418.56-1.fc30.x86_64
xorg-x11-drv-nvidia-libs-418.56-1.fc30.x86_64
kmod-nvidia-5.0.11-300.fc30.x86_64-418.56-2.fc30.x86_64
xorg-x11-drv-nvidia-cuda-libs-418.56-1.fc30.x86_64
akmod-nvidia-418.56-2.fc30.x86_64
@danmack
danmack / make-rootless-conf
Created April 23, 2019 18:40
fedora 30 - building container image fails
[mack@hyperion skunk]$ cat mk-fc30-image
#!/bin/bash
cont=$(buildah from fedora:30)
buildah run "$cont" -- dnf update -y
buildah commit "$cont" fc30b
[mack@hyperion skunk]$ buildah images
IMAGE NAME IMAGE TAG IMAGE ID CREATED AT SIZE
docker.io/library/fedora 30 ad0d3c0bf762 Apr 3, 2019 17:20 311 MB
localhost/fc30b latest e1e8d0d135a7 Apr 23, 2019 13:35 311 MB
@danmack
danmack / inspect.bash
Last active April 19, 2019 15:56
buildah podman skopeo rodeo
mega:~/src/cont$ podman inspect localhost/fc30b
[
{
"Id": "d49e72ff10298e8a50b33c3b3b451acd342146858b0e4354dea926d785839620",
"Digest": "sha256:cd3852ebf1ab5ce7751e9fd15bd09acb247147ba3f24a47fcc2998ee948feffd",
"RepoTags": [
"localhost/fc30b:latest"
],
"RepoDigests": [
"localhost/fc30b@sha256:cd3852ebf1ab5ce7751e9fd15bd09acb247147ba3f24a47fcc2998ee948feffd"
@danmack
danmack / bug-report1.txt
Last active April 18, 2019 14:06
fedora:30 container not cannot run yum or dnf without SEGV
$ c=$(buildah from fedora:30)
Getting image source signatures
Copying blob 160e9aefb317: 85.15 MiB / 86.30 MiB [=============================]
Copying blob 160e9aefb317: 86.30 MiB / 86.30 MiB [==========================] 7s
Copying config ad0d3c0bf762: 1.99 KiB / 1.99 KiB [==========================] 0s
Writing manifest to image destination
Storing signatures
fano:~/src/cont$
fano:~/src/cont$ buildah run $c -- dnf update -y
{
"brand": "bhyve",
"alias": "centomdano",
"hostname": "centodano",
"dns_domain": "example.com",
"vcpus": 2,
"ram": 4096,
"resolvers": ["8.8.8.8", "8.8.4.4"],
"disks": [
{
@danmack
danmack / gist:6d69a6d2ab08e6dbf8a1727e9c2267a0
Created December 5, 2018 16:32
SmartOS add disk to bhyve linux container
Adding a new disk to a bhyve vm takes a few steps.
1. increase the quota on the zfs dataset to accomodate the additional
space.
2. create a zvol inside the zone
3. stop the vm and update its configuration to reflect the change
4. start the vm, login and use the disk
# update quota