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/python3 | |
# CC0, originally written by t184256. | |
# This is an example Python program for Linux that remaps a keyboard. | |
# The events (key presses releases and repeats), are captured with evdev, | |
# and then injected back with uinput. | |
# This approach should work in X, Wayland, anywhere! |
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
#[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}; |
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
{ | |
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"; | |
}; | |
}; |
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/python3 | |
# Sorry everyone, it's a real mess. | |
import atexit | |
import inspect | |
import evdev | |
import evdev.ecodes as ec |
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
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 |
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 "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`). |
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-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 |
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 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) |
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
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(*_): |
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
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" |
NewerOlder