This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
from copy import deepcopy | |
from functools import partial | |
from itertools import cycle | |
from pprint import pprint | |
from timeit import timeit | |
from typing import List, Tuple | |
import numpy as np | |
import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.04 | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update \ | |
&& apt-get --yes install curl xz-utils sudo \ | |
&& apt-get clean && rm -rf /var/lib/apt/lists/ \ | |
&& useradd -m -G sudo --password "!" --shell /bin/bash my-user \ | |
&& (echo 'my-user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, config, pkgs, ... }: | |
let | |
ldconfig = pkgs.writeScript "ldconfig" '' | |
#! /usr/bin/env bash | |
cleanup() { | |
rm -f "$TMP" | |
} | |
trap cleanup EXIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nix-shell | |
#! nix-shell -i python -p "(import ./. { config = { allowUnfree = true; cudaSupport = true; }; }).python3.withPackages (ps: with ps; [ pytorch ])" | |
import torch | |
a = torch.randn(1, 3, 128, 128, device="cuda") | |
torch.nn.functional.conv2d(a, torch.randn(1, 3, 2, 2, device="cuda")) | |
print("ok") |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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 contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Replace href with originalsrc in outlook | |
// @version 1 | |
// @grant none | |
// @match https://outlook.office.com/* | |
// @run-at document-start | |
// ==/UserScript== | |
function replaceHrefs() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- test.sql | |
-- watch "sqlite3 < test.sql" | |
.mode table | |
CREATE TABLE t | |
(name TEXT) | |
; | |