Skip to content

Instantly share code, notes, and snippets.

View t184256's full-sized avatar

Alexander Sosedkin t184256

View GitHub Profile
@t184256
t184256 / flake.nix
Last active January 18, 2022 18:09
a flake breaking my hydra
{
description = "a broken flake to report a bug";
outputs = { self }: {
hydraJobs.test.x86_64-linux = derivation {
name = "test"; builder = "/bin/sh"; args = ["-c" "/bin/sh -c :> $out"];
system = "x86_64-linux";
__contentAddressed = true;
outputHashAlgo = "sha256"; outputHashMode = "recursive";
};
};
@t184256
t184256 / onenetbook4.linpack.log
Last active July 15, 2021 23:47
OneNetbook 4 Core i7 LINPACK results
This is a SAMPLE run script for running a shared-memory version of
Intel(R) Distribution for LINPACK* Benchmark. Change it to reflect
the correct number of CPUs/threads, problem input files, etc..
*Other names and brands may be claimed as the property of others.
Fri Jul 16 01:38:31 AM CEST 2021
Sample data file lininput_xeon64.
Current date/time: Fri Jul 16 01:38:31 2021
CPU frequency: 4.388 GHz
@t184256
t184256 / window-juggler.py
Created March 14, 2020 23:49
A script to move my terminal window to/from my tablet when I leave/reenter the workspace, tmux + sway/i3
#!/usr/bin/env nix-shell
#!nix-shell -i python -p "python3.withPackages(ps: with ps; [ i3ipc ])"
# A script I've thrown together
# to use my tablet as a somewhat usable extra screen.
# The core idea is to ssh (mosh) to my work laptop,
# attach to a tmux session creating a new group (`tmux new-session -t tablet`)
# and then create a tmux binding to exchange windows between tablet and laptop
# (`bind Tab swap-window -t tablet`).
nix-repl> (import ./pkgs { arch="aarch64"; }).talloc.depsBuildBuild
[ «derivation /nix/store/nwd6y51bx215y6m6kqpl7ai8467pslla-python-2.7.17.drv» «derivation /nix/store/jj5v3lbyxp3m4k5109c8jsxy6ga8f7pr-zlib-1.2.11.drv» ]
nix-repl> (import ./pkgs { arch="aarch64"; }).talloc.depsBuildTarget
[ ]
nix-repl> (import ./pkgs { arch="aarch64"; }).talloc.nativeBuildInputs
[ ]
nix-repl> (import ./pkgs { arch="aarch64"; }).talloc.depsHostHost
@t184256
t184256 / autopatcher.xsh
Created May 22, 2019 10:44
tooling for sampling-fix-418
import glob
import sys
for fname in glob.glob('scripts/test-*.py'):
print('###', fname)
if !(grep -q sanity_test @(fname)):
if not !(grep -q sanity_tests @(fname)):
patch --verbose @(fname) < sanity_tests_plural.patch or sys.exit(1)
aliases['nxu'] = ['sudo', 'nix-channel', '--update']
NX_DEFAULT_ARGS = ['--cores', '4']
$NX_OFFLOAD_HOST = 'fig'
aliases['nxo'] = ['nixos-rebuild', 'build',
'--build-host', $NX_OFFLOAD_HOST] + NX_DEFAULT_ARGS
aliases['nxl'] = ['nix', 'build', '--no-link',
'-f', '<nixpkgs/nixos>', *NX_DEFAULT_ARGS,
'config.system.build.toplevel']
def _nxg(*_):
SERVER_KEY=server-key.pem
ADDRESS=555.555.555.555 # change this
# creating a key for our ca
if [ ! -e ca-key.pem ]; then
openssl genrsa -des3 -out ca-key.pem 1024
fi
# creating a ca
if [ ! -e ca-cert.pem ]; then
openssl req -new -x509 -days 1095 -key ca-key.pem -out ca-cert.pem -utf8 -subj "/CN=MyCA"
@t184256
t184256 / what_a_monad_is_try1.md
Created September 23, 2018 20:02
What is a monad, attempt 1 of several

Skippable intro

tazjin once told me something koanish in the lines of:

When a man 'understands' monads, he writes a blog post about it. And it takes three such posts for him to really understand monads.

This text is my first 'post' in this hypothetised progression. I anticipate missing the point, so the intended audience is not other neophytes, but seasoned FP folk looking at me condenscendingly before replying "you're not there yet".

@t184256
t184256 / userdata_not_getable.rs
Created July 24, 2018 18:17
Userdata does not implement Getable
#[macro_use]
extern crate gluon_codegen;
extern crate gluon;
#[macro_use]
extern crate gluon_vm;
use std::sync::Arc;
use gluon::vm::{self, ExternModule};
use gluon::{import::Import, RootedThread};
@t184256
t184256 / getable_woes.rs
Created July 24, 2018 17:37
Getable woes
#[macro_use]
extern crate gluon_codegen;
extern crate gluon;
#[macro_use]
extern crate gluon_vm;
use gluon::vm::{self, ExternModule};
use gluon::{import, Compiler, Thread};
use gluon::{import::Import, RootedThread};