Skip to content

Instantly share code, notes, and snippets.

@b333z
b333z / vsls
Last active July 20, 2021 22:55
vccode live share nixos
#!/usr/bin/env bash
# TODO: Look at nixpkgs/pkgs/build-support/setup-hooks/auto-patchelf.sh
# https://ms-vsliveshare.gallery.vsassets.io/_apis/public/gallery/publisher/MS-vsliveshare/extension/vsliveshare/0.3.423/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
set -eu
TOOLS="patchelf xsel"
DEPS="utillinux.out openssl.out icu zlib curl.out lttng-ust libsecret libkrb5"
@b333z
b333z / generate-compose.sh
Created December 27, 2017 10:48 — forked from derFunk/generate-compose.sh
generate docker-compose.yml by inspecting a running container
docker-yml() {
docker inspect -f $'
version: '2.2'
services:
{{.Name}}
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
command: {{json .Config.Cmd}}
environment: {{range .Config.Env}}
- {{.}}{{end}}
@b333z
b333z / gentoo-chroot
Last active August 29, 2015 14:19
gentoo scripts
#!/bin/bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
function chroot()
{
CHROOT_ROOT=$1
echo "Chrooting to $CHROOT_ROOT"
@b333z
b333z / issue-1208-r1.patch
Last active August 29, 2015 14:02
zfs - issue-1208
Info for issue-1208
@b333z
b333z / zfs_slog_zero_vsalloc_inline.patch
Last active January 2, 2016 07:18
This Systemtap script is to provide a workaround with removal of slog device that fails due to vs_alloc for the device != 0. As a safely precaution ZFS refuses to remove the device. It basically implements a linux version of a workaround described here: http://zpool.org/2012/01/10/how-to-fix-a-stuck-zfs-log-device.
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 4c8f8bf..6b4ca40 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -5250,6 +5250,13 @@ spa_vdev_remove_from_namespace(spa_t *spa, vdev_t *vd)
ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL);
ASSERT(vd == vd->vdev_top);
+ // slog stuck hack - barnes333@gmail.com - https://github.com/zfsonlinux/zfs/issues/1422
+ if (vd->vdev_islog == 1 && vd->vdev_removing == 1
@b333z
b333z / issue-1803.txt
Last active December 28, 2015 07:19
zfs issue-1803 test results
Test started: 2013-11-14_13-21-20
pre_pkg_setup() {
EGIT_REPO_URI="file:///zfs/zfs"
EGIT_BRANCH="issue-1803"
}
pre_pkg_setup() {
EGIT_REPO_URI="https://github.com/zfsonlinux/spl.git"
EGIT_BRANCH="master"
}
@b333z
b333z / ebuild_switch_source_control..txt
Created May 19, 2013 04:13
Switching source control details on 9999 gentoo ebuilds using /etc/portage/env
# cd /etc/portage/env
# find . -ls
1040459 4 drwxr-xr-x 4 root root 4096 May 17 20:57 .
1040460 4 drwxr-xr-x 2 root root 4096 May 17 21:00 ./sys-fs
1044487 4 -rw-r--r-- 1 root root 501 May 17 21:00 ./sys-fs/zfs
1044262 0 lrwxrwxrwx 1 root root 3 Oct 10 2012 ./sys-fs/zfs-kmod -> zfs
1043259 4 drwxr-xr-x 2 root root 4096 Jan 30 22:40 ./sys-kernel
1044264 4 -rw-r--r-- 1 root root 223 Sep 1 2012 ./sys-kernel/spl
# cat ./sys-fs/zfs-kmod # This allows me to jump around people's repos and branches
#!/bin/bash
@b333z
b333z / gist:4416090
Created December 30, 2012 23:48
git list ignored files
git ls-files -o -i --exclude-standard
@b333z
b333z / gist:4290844
Last active October 14, 2015 02:07 — forked from anonymous/gist:4290841
git add .gitkeep to working dir tree to preserve empty dirs
find . -type d -empty -exec touch {}/.gitkeep \;
@b333z
b333z / gist:4069201
Created November 13, 2012 23:45
shell replacment for watch
while true ; do clear ; <foo command here> ; sleep 5 ; done