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 bash | |
| # 针对 error: Package ‘xxx’ in /nix/store/xxx is marked as insecure, refusing to evaluate. 的报错,打印它的依赖栈 | |
| # 由以下惯用命令得到启发: nixos-rebuild build --show-trace | rg 'while evaluating derivation' | |
| set -euo pipefail | |
| if [[ $# -gt 1 ]]; then | |
| echo "Usage: $(basename "$0") [hostname]" | |
| exit 1 | |
| fi |
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
| 9月 08 13:50:02 home-router open-webui[140332]: INFO [open_webui.apps.openai.main] get_all_models() | |
| 9月 08 13:50:08 home-router open-webui[140332]: ERROR [open_webui.apps.openai.main] Connection error: | |
| 9月 08 13:50:08 home-router open-webui[140332]: ERROR [open_webui.apps.openai.main] Connection error: | |
| 9月 08 13:50:08 home-router open-webui[140332]: ERROR [open_webui.apps.openai.main] Connection error: | |
| 9月 08 13:50:08 home-router open-webui[140332]: DEBUG [open_webui.apps.openai.main] get_all_models:responses() [None, None, None] | |
| 9月 08 13:50:08 home-router open-webui[140332]: DEBUG [open_webui.apps.openai.main] merge_models_lists <map object at 0x7f6cad8365c0> | |
| 9月 08 13:50:08 home-router open-webui[140332]: DEBUG [open_webui.apps.openai.main] models: {'data': []} | |
| 9月 08 13:50:08 home-router open-webui[140332]: INFO [open_webui.apps.openai.main] get_all_models() | |
| 9月 08 13:50:10 home-router open-webui[140332]: DEBUG [open_webui.main] Commit session after request | |
| 9月 08 13:50:10 home-router open-webui[140332]: INFO: |
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
| INFO: 10.40.10.1:0 - "POST /api/chat/completed HTTP/1.0" 500 Internal Server Error | |
| ERROR: Exception in ASGI application | |
| + Exception Group Traceback (most recent call last): | |
| | File "/nix/store/ivmgz1axqf7i0vr1pbm5r4i0hb01an0h-python3.12-starlette-0.37.2/lib/python3.12/site-packages/starlette/_utils.py", line 87, in collapse_excgroups | |
| | yield | |
| | File "/nix/store/ivmgz1axqf7i0vr1pbm5r4i0hb01an0h-python3.12-starlette-0.37.2/lib/python3.12/site-packages/starlette/middleware/base.py", line 190, in __call__ | |
| | async with anyio.create_task_group() as task_group: | |
| | File "/nix/store/3vg8ys3dm90a5bi692x3f2hza11b670d-python3.12-anyio-4.3.0/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 678, in __aexit__ | |
| | raise BaseExceptionGroup( | |
| | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) |
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
| def f(x: int): | |
| return x + 1 | |
| a: int = "abc" | |
| f(a) | |
| def g(): | |
| from collections import namedtuple |
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 -p 'python3.withPackages (ps: with ps; [ msgspec ])' -i python3 | |
| import msgspec | |
| print('hello') |
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 --packages python311 python311Packages.pypdf2 | |
| import PyPDF2 | |
| def merge_pdfs(input_path_list: list[str], output_path: str): | |
| pdfWriter = PyPDF2.PdfWriter() | |
| for input_path in input_path_list: | |
| pdf1 = PyPDF2.PdfReader(open(input_path, "rb")) |
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
| { | |
| "files.trimTrailingWhitespace": true, | |
| "python.languageServer": "Pylance", | |
| "python.analysis.typeCheckingMode": "strict", | |
| "python.analysis.diagnosticSeverityOverrides": { | |
| "reportImportCycles": "warning", | |
| "reportUnnecessaryComparison": "information", | |
| "reportUnnecessaryIsInstance": "information", | |
| "reportUnnecessaryContains": "information", | |
| "reportUnusedImport": "information", |
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
| #NOTE: not working yet, need debuging | |
| {pkgs ? import <nixpkgs> {}, ...}: | |
| pkgs.stdenv.mkDerivation rec { | |
| pname = "popo"; | |
| version = "3.56.1"; | |
| src = pkgs.fetchurl { | |
| url = "https://popo.netease.com/file/popolinux/popo_${version}_amd64_ubuntu.deb"; |
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
| { | |
| inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | |
| inputs.flake-utils.url = "github:numtide/flake-utils"; | |
| outputs = { self, nixpkgs, flake-utils }: | |
| flake-utils.lib.eachDefaultSystem (system: | |
| let | |
| pkgs = nixpkgs.legacyPackages.${system}; | |
| hpkgs = pkgs.haskell.packages.ghc923; | |
| in rec { |
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 -p "expect" -i expect | |
| #set timeout -1 | |
| cd ~/ws/nixos | |
| spawn nix repl | |
| send ":lf .\n" |
NewerOlder