Skip to content

Instantly share code, notes, and snippets.

View SomeoneSerge's full-sized avatar

Someone SomeoneSerge

View GitHub Profile
for prefix in Target Host; do
for cross in true false; do
for case in Good Bad; do
outName=test${case}${prefix}_cross=${cross}
nix build -f test-hooks.nix --argstr depSet "$prefix$prefix" --arg cross "$cross" "test$case" -o "$outName"
nix log -f test-hooks.nix --argstr depSet "$prefix$prefix" --arg cross "$cross" "test$case" > "$outName".log
diff -s -u5 testGoodTarget_cross=true.log "$outName".log > "$outName.diff"
done
done
done
{
description = "A very basic flake";
outputs = { self, nixpkgs }: {
devShells.x86_64-linux.default = with nixpkgs.legacyPackages.x86_64-linux; mkShell {
shellHook = ''
read FLAKE_ROOT < <(
${lib.getExe nix} flake metadata --json | ${lib.getExe jq} .locked.path --raw-output
)
{ pkgs, ... }:
{
# ...
nix.settings.system-features = [ "expose-cuda" ];
nix.settings.pre-build-hook = pkgs.writers.writePython3 "nix-pre-build.py" { } (builtins.readFile ./nix-pre-build-hook.py);
# ...
}
@SomeoneSerge
SomeoneSerge / zmq-pub.ipynb
Last active March 6, 2023 20:19
Storing BLOBs in sqlite; random access, full dataset traversal, random shuffle, image decoding overhead, overhead for streaming over the network
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
-- test.sql
-- watch "sqlite3 < test.sql"
.mode table
CREATE TABLE t
(name TEXT)
;
import binascii
import codecs
from miio.discovery import Discovery
from miio.miioprotocol import MiIOProtocol
if __name__ == "__main__":
reply = MiIOProtocol.discover("192.168.5.1", timeout=60)
token = codecs.encode(reply.checksum, "hex")
device_id = binascii.hexlify(reply.header.value.device_id).decode()
@SomeoneSerge
SomeoneSerge / rid-of-safelinks.user.js
Last active July 10, 2022 23:36
GreaseMonkey script to clean up links (remove "https://eur02.safelinks.protection.outlook.com/..." bits) in the emails as displayed by ms outlook web app
let
pkgs = import <nixpkgs> { config.cudaSupport = true; config.allowUnfree = true; };
py = pkgs.python3.withPackages (ps: with ps; [
pytorch
]);
in pkgs.dockerTools.buildLayeredImage {
name = "docker-pytorch";
contents = [
py
];
This file has been truncated, but you can view the full file.
/nix/store/kb30f9livrnxswcx53cgwq9m49k1ksnj-python3.9-pytorch-1.11.0.drv
├───/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh
├───/nix/store/d0gl66iq1mld4qkmx5vs0ffzf7qnj01r-bash-5.1-p16.drv
│ ├───/nix/store/0zhkga32apid60mm7nh92z2970im5837-bootstrap-tools.drv
│ │ ├───/nix/store/b7irlwi2wjlx5aj1dghx4c8k3ax6m56q-busybox.drv
│ │ ├───/nix/store/bzq60ip2z5xgi7jk6jgdw8cngfiwjrcm-bootstrap-tools.tar.xz.drv
│ │ └───/nix/store/wzdwpgqf2384hr2npma78mqillg5lv08-unpack-bootstrap-tools.sh
│ ├───/nix/store/1h2k4r9m23y3mkp8dzahfhf9izhcqy41-bash51-005.drv
│ ├───/nix/store/38n3s6l5ijf0hsqqbjbknj0ipwzya5vk-bash51-011.drv
│ ├───/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh [...]
This file has been truncated, but you can view the full file.
30c30
< cmake -GNinja -DBUILD_DOCS=0 -DBUILD_NAMEDTENSOR=1 -DBUILD_PYTHON=True -DBUILD_TEST=False -DCMAKE_BUILD_TYPE=Release -DCMAKE_INCLUDE_PATH=/nix/store/x3bc3xh6560gbx0npb17z14l0g960wp1-blas-3-dev/include:/nix/store/83s0r0nydjnh72hay6nks21q3045xh3w-openblas-0.3.20-dev/include:/nix/store/480wkg7xhhrgydn1710bp6ay1s5l64ir-cudatoolkit-11-cudnn-8.3.2/include:/nix/store/xaqsmhgkmfpgb5a0vj2d809fkygfw6wy-magma-2.6.2/include:/nix/store/pzqv19y0v3ypzkyiqiyr5p181h68hvrb-nccl-2.12.10-1-cuda-11.6-dev/include:/nix/store/4y54n3qssgc49bsr0xbbavg3qjpc0z9q-numactl-2.0.14/include:/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12/include:/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12/include -DCMAKE_INSTALL_PREFIX=/build/source/torch -DCMAKE_LIBRARY_PATH=/nix/store/n904zi6lspddqm5y8cc51xnsz37rn1j8-blas-3/lib:/nix/store/lwfgy55vscqdxxn1w2gz1b3vck5v7792-openblas-0.3.20/lib:/nix/store/480wkg7xhhrgydn1710bp6ay1s5l64ir-cudatoolkit-11-cudnn-8.3.2/lib:/nix/store/xaqsmhgkmfpgb5a0vj2d809fkygfw6wy-magma-2.6.2/lib: