Skip to content

Instantly share code, notes, and snippets.

View vcunat's full-sized avatar
💭
🇺🇦🤞🏽

Vladimír Čunát vcunat

💭
🇺🇦🤞🏽
  • cz.nic labs @CZ-NIC
  • Czech Republic
View GitHub Profile
@vcunat
vcunat / rebuild-amount.txt
Last active May 12, 2023 14:51
Packages dropped when marking OpenSSL 1.1 as vulnerable
$ git fetch https://github.com/mweinelt/nixpkgs.git just-for-vladimir
$ git checkout FETCH_HEAD
$ git rebase h/staging-next
$ env NIXPKGS_ALLOW_UNFREE=1 ./maintainers/scripts/rebuild-amount.sh --print HEAD HEAD~1
Estimating rebuild amount by counting changed Hydra jobs (parallel=unset).
415 x86_64-darwin
560 x86_64-linux
_3llo.x86_64-darwin /nix/store/qzn9vnxh5xl9mbw8bwb9111z3fbqn0nm-3llo-1.3.1
@vcunat
vcunat / schema.json
Created March 29, 2023 09:41
knot-resolver-config-schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Knot Resolver declarative configuration.",
"type": "object",
"properties": {
"version": {
"type": "integer",
"description": "Version of the configuration schema. By default it is the latest supported by the resolver, but couple of versions back are be supported as well.",
"default": 1
},
@vcunat
vcunat / schema.json
Created January 11, 2022 17:29
knot-resolver schema for YAML/JSON config [experimental]
{"$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": {"server": {"type": "object", "properties": {"hostname": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null}, "groupid": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null}, "nsid": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null}, "workers": {"anyOf": [{"enum": ["auto"]}, {"type": "integer"}], "default": 1}, "use_cache_gc": {"type": "boolean", "default": true}, "backend": {"enum": ["auto", "systemd", "supervisord"], "default": "auto"}, "watchdog": {"anyOf": [{"enum": [false]}, {"type": "object", "properties": {"qname": {"type": "string"}, "qtype": {"enum": ["A", "A6", "AAAA", "AFSDB", "ANY", "APL", "ATMA", "AVC", "AXFR", "CAA", "CDNSKEY", "CDS", "CERT", "CNAME", "CSYNC", "DHCID", "DLV", "DNAME", "DNSKEY", "DOA", "DS", "EID", "EUI48", "EUI64", "GID", "GPOS", "HINFO", "HIP", "HTTPS", "IPSECKEY", "ISDN", "IXFR", "KEY", "KX", "L32", "L64", "LOC", "LP", "MAILA", "MAILB", "MB"
@vcunat
vcunat / cloudfront.sh
Last active July 24, 2018 13:46 — forked from grahamc/cloudfront.sh
don't force dig to use IPv4
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bind.dnsutils -p traceroute -p curl
# impure: needs ping
#source: https://s3.amazonaws.com/aws-cloudfront-testing/CustomerTesting.html
function _e {
echo "> $@"
eval "$@" 2>&1 | sed -e "s/^/ /"
printf "Exit: %s\n\n\n" "$?"
}
@vcunat
vcunat / release.nix
Last active December 20, 2017 14:35
{ nixpkgs ? <nixpkgs> }: {
inherit (import nixpkgs {}) hello;
}
@vcunat
vcunat / keybase.md
Last active January 10, 2017 12:26
For keybase.io: proving github account ownership

Keybase proof

I hereby claim:

  • I am vcunat on github.
  • I am vcunat (https://keybase.io/vcunat) on keybase.
  • I have a public key whose fingerprint is B600 6460 B60A 80E7 8206 2449 E747 DF1F 9575 A3AA

To claim this, I am signing this object:

@vcunat
vcunat / default.nix
Created December 4, 2016 15:19
Linux->mingw cross-compiling shim: *-native is for packages not meant to be run on windows
let
lib = (import <nixpkgs> {}).lib;
pkgs-cross-xx = hostArch:
lib.mapAttrs
(name_: pkg: if lib.isDerivation pkg then pkg.crossDrv else pkg)
(pkgs-cross-xx-nocross hostArch);
pkgs-cross-xx-nocross = hostArch:
(import <nixpkgs> {
crossSystem = {
config = hostArch + "-w64-mingw32";
#!/usr/bin/env bash
if [ "$#" != 2 ]; then
echo "Usage: $0 commit-hash commit-hash"
echo -e "\tYou need to be in a git-controlled nixpkgs tree."
exit 1
fi
echo "Estimating rebuild amount, by packages visible to nix-env:"
echo "(If you get 0, it's an evaluation error, most likely.)"
@vcunat
vcunat / zbar.nix
Created July 26, 2016 18:20
Zbar: nix expression for linux->mingw cross-compilation, both 32 and 64-bit.
{stdenv, fetchurl, pkgconfig, xmlto, imagemagick, libiconv}:
stdenv.mkDerivation rec {
name = "zbar-0-10";
src = fetchurl {
url = http://downloads.sourceforge.net/project/zbar/zbar/0.10/zbar-0.10.tar.bz2;
sha256 = "1imdvf5k34g1x2zr6975basczkz3zdxg6xnci50yyp5yvcwznki3";
};
@vcunat
vcunat / R.log
Last active January 2, 2016 09:15
Failure while linking R, using NIX_DEBUG=1 to show linker flags
original flags to /nix/store/vck6gcw6acfj5zbclaxq95dkx8askvc0-binutils-2.23.1-dev/bin/ld:
-plugin
/nix/store/k7vgmahnycp3x1d4i63wbj61bn67khls-gfortran-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/liblto_plugin.so
-plugin-opt=/nix/store/k7vgmahnycp3x1d4i63wbj61bn67khls-gfortran-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper
-plugin-opt=-fresolution=/tmp/nix-build-R-3.2.3.drv-0/ccNJ1FPY.res
-plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc