Skip to content

Instantly share code, notes, and snippets.

@jimklimov
jimklimov / _INSTALL.md
Created March 19, 2021 18:50 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@jimklimov
jimklimov / config
Created February 10, 2021 15:42 — forked from terrywang/config
~/.ssh/config behind firewall (ssh via HTTP proxy) and faster session creation by reusing already established connection
# User ssh configuration file ~/.ssh/config
# Gist https://gist.github.com/terrywang/3997931
# man ssh_config for more information
# Inspired by the blog post below to fight the NSA
# https://stribika.github.io/2015/01/04/secure-secure-shell.html
# Outside of the firewall, with HTTPS proxy
# Package connect-proxy is required.
# Amazon EC2
@jimklimov
jimklimov / BSConfig.pm
Created September 15, 2020 19:55
Snippet for BSConfig.pm selector of suitable OBS workers per job
# Add-on logic for OBS server config to allow only certain hosts to build certain projects
# For specific build constraints, for example to require a specific
# security level of the workers.
# Return 0 (false) if this worker is not suitable for this job.
# Return 1 (true) to allow execution of this job on this worker.
# Used from bs_dispatch via
# { next if !$BSConfig::dispatch_constraint->($ic->{$job}, $workerinfo{$idle}); }
#
@jimklimov
jimklimov / zfs recv lags discussion.txt
Created August 12, 2020 13:42
zfs recv lags discussion
(2020-08-10 02:40:30) jimklimov: cheers all who won't sleep :) doing some ZFS replications and hit that annoyance again about how slow it is to `zfs recv` many small snapshots. Is there some tunable to speed it up a bit? Looking at speed numbers in the console, it seems that for every incremental snapshot it spends over 60s regardless of size. So empty 312byte snapshots take a minute at average 5 b/s, and larger multimegabyte snaps take 70s, and huge ones average at relatively decent looking speeds in MB/s range. What can I do to not wait that 1 minute every snap?
(02:47:40) jimklimov: looking at the consoles, I see it doing zero I/O on source and destination pools (zpool iostat 1), then the send|recv pipe says "receiving incremental stream of X into Y" and there is a burst of I/O for a second, and the pipe logs how it received a few kilobytes in a lot of seconds...
(02:58:43) jimklimov: using Adam's scripts from http://dtrace.org/blogs/ahl/2014/08/31/openzfs-tuning/ I see that the destination pool txg-syncin
@jimklimov
jimklimov / gist:d97d6b68f967cb5e648369fddd395276
Last active May 22, 2020 12:11
Real-time debugging in systemd
`systemctl log-level debug`, previously `systemd-analyze log-level debug`, or a specific signal (see systemd(1))
for a single invokation can pass the envvar, e.g.: `SYSTEMD_LOG_LEVEL=debug systemctl daemon-reexec`
@jimklimov
jimklimov / ssh_config
Created April 9, 2020 09:27 — forked from rbenaley/ssh_config
GitHub ssh access via HTTP Proxy
host github.com
user git
hostname ssh.github.com
port 443
proxycommand socat - PROXY:<hostname>:%h:%p,proxyport=<port>
@jimklimov
jimklimov / jenkins-script-console-joblist.groovy
Last active June 26, 2019 09:19
List currently known Jenkins jobs along with their status and labels, if any
// List currently known Jenkins jobs along with their status and labels, if any.
// Primary use-case for us is to find enabled obsolete jobs, we have a few
// we don't want deleted just yet, and to avoid enabled jobs without an agent
// label assigned so they are not picked up by random unsuitable machines.
import hudson.model.Job
//getAllItems searches a global lookup table of items regardless of folder structure
Jenkins.instance.getAllItems(Job.class).each { Job job ->
String jobLabelString
@jimklimov
jimklimov / local.sh
Created April 4, 2018 13:18 — forked from bk2204/local.sh
Reasonably portable technique for local variables in shell scripts
#!/bin/sh -e
# This shell script demonstrates how to use the local keyword to create
# dynamically-scoped variables in various shells. Notably, this technique works
# with AT&T ksh, as well as bash, dash, mksh, pdksh, zsh, busybox sh, and other
# Debian Policy-compliant sh implementations.
# Simple Perl-compatible testing framework. Produces TAP output.
COUNT=0
is () {