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 python3 | |
| # Made for: https://github.com/TheJJ/ceph-balancer/issues/68 | |
| """ | |
| Compute the exact counts involved in the jj-balancer's 0-move situation. | |
| Key discovery: pg_num = 2048 (not 512 as I initially assumed). | |
| Verification: 12288 total shards / 6 (pool size) = 2048 PGs. | |
| The -vvv log confirms: ideal_14T = 153.623 = 12288 / 1168.69 * 14.61089. |
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 python3 | |
| # This script outputs passwords that the Ubuntu Chromium Snap stores in plain text by default. | |
| # | |
| # It should also work for any other Chromium that uses `--password-store=basic` (which is what | |
| # the Snap uses by default unless the user has manually connected it to a passowrd store backend). | |
| # See | |
| # https://chromium.googlesource.com/chromium/src/+/1fbcd1d2fcab302f8593393135fe6253a963101f/docs/linux/password_storage.md | |
| # It is a repro for Ubuntu bug: | |
| # |
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
| """Minimal repro: torch.profiler CUDA events on worker threads get wrong thread IDs. | |
| When `torch.profiler.profile()` is active and CUDA operations happen on | |
| worker threads (e.g. from `ThreadPoolExecutor`), the exported Chrome trace | |
| has CUDA runtime events (like `cudaLaunchKernel`) with `tid` values based | |
| on `pthread_self()` instead of `gettid()` (Linux kernel TID). | |
| This happens because `torch.profiler.profile()` registers `RecordFunction` | |
| callbacks via `at::addThreadLocalCallback()`, so only the thread that | |
| called `profile().__enter__()` gets callbacks. Kineto's |
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
| -- Creates the table recording the current migration. | |
| SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; | |
| BEGIN; | |
| -- Note: `create or replace function` cannot be run concurrently; postgres | |
| -- will error with "tuple concurrently updated" when that happens. | |
| -- That's why we wrap it in a transaction-level exclusive advisory lock. | |
| -- See http://stackoverflow.com/questions/40525684/tuple-concurrently-updated-when-creating-functions-in-postgresql-pl-pgsql/44101303 |
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 `firefox-vm.nix` builds a simple NixOS VM with XFCE and Firefox inside. | |
| # | |
| # Build and run it with: | |
| # | |
| # nix-build '<nixpkgs/nixos>' -A vm -I nixos-config=./firefox-vm.nix | |
| # result/bin/run-nixos-vm | |
| # | |
| # Log in as "root" with empty password. | |
| # | |
| # To delete the VM state (storage): |
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
| (bootloader) product:sunfish | |
| (bootloader) serialno:17191JEC203691 | |
| (bootloader) variant:SM7 UFS | |
| (bootloader) max-download-size:0x10000000 | |
| (bootloader) slot-suffixes:_a,_b | |
| (bootloader) version-bootloader:s5-0.5-10252351 | |
| (bootloader) version-baseband:g7150-00112-230505-B-10075601 | |
| (bootloader) secure-boot:PRODUCTION | |
| (bootloader) secure:yes | |
| (bootloader) hw-revision:MP1.0 |
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
| { config, lib, pkgs, ... }: | |
| with lib; | |
| let | |
| cfg = config.services.ceph-benaco; | |
| inherit (pkgs.callPackage ../helpers.nix {}) ensureUnitExists; | |
| in |
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
| # ./ghc-performance-categorizer.py ghci-v-output-1.txt --sort-by time | |
| TASK time ms mem MB | |
| ------------------------------------------------ | |
| systool:cpp 4 2 | |
| systool:merge-objects 11 3 | |
| Simplify 38 68 | |
| ByteCodeGen 70 164 | |
| initializing 72 119 | |
| systool:as 175 68 |
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 python3 | |
| # Moves contents of one directory tree into another, safely. | |
| import argparse | |
| import filecmp | |
| import shlex | |
| import sys | |
| from dataclasses import dataclass |
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
| // Demo of how mmap() affects VIRT, RES, SHR memory usage in Linux. | |
| // | |
| // A useful resource for more background: | |
| // https://techtalk.intersec.com/2013/07/memory-part-2-understanding-process-memory/ | |
| // Required for: | |
| // * `O_TMPFILE` | |
| // * `fallocate()` | |
| #define _GNU_SOURCE |
NewerOlder