Skip to content

Instantly share code, notes, and snippets.

# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "addr2line"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
dependencies = [
Moved to https://github.com/PedroHLC/nix-ullib
@PedroHLC
PedroHLC / xdg-launch.sh
Last active December 11, 2023 15:17
Uses bash+awk+find+XDG_DATA_DIRS to launch an application by searching the first x-desktop that starts with the argument (you can use wildcards, remember to escape them)
#!/usr/bin/env bash
set -euo pipefail
LAUNCH_SEARCHING="$1"
exec $(awk '/^Exec=/{sub(/^Exec=/, ""); print $1}' $(echo -n "$XDG_DATA_DIRS" |\
xargs -d ':' -ri \
find -H '{}/applications/' -iname "${LAUNCH_SEARCHING}*.desktop" 2>/dev/null |\
head -n 1))
@PedroHLC
PedroHLC / pkgsx86_64_v3.benchmarking.md
Last active November 23, 2023 13:45
Some benchmarks for chaotic#pkgsx86_64_v3

Ran on /tmp (with useTmpfs), where the files are, and directly from TTY1 (without any DE running).


  • Shell A: nix shell nixpkgs#hyperfine nixpkgs#ffmpeg-headless

  • Shell B: nix shell nixpkgs#hyperfine chaotic#pkgsx86_64_v3.ffmpeg-headless

  • Benchmark parameter: hyperfine -w 3 -M 10

  • Benchmark command: ffmpeg -threads 1 -y -i 01._Radio_Ga_Ga.flac -f ogg /dev/null

(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{install:()=>l}),TaskPort;const t=JSON.parse('{"u2":"elm-localstorage","i8":"1.0.1"}'),r=t.i8,s="lobanov/"+t.u2;function l(e){const o=e.createNamespace(s,r);o.register("localGet",(e=>window.localStorage.getItem(e))),o.register("localPut",(({key:e,value:o})=>window.localStorage.setItem(e,o))),o.register("localRemove",(e=>window.localStorage.removeItem(e))),o.register("localList",(()=>{const e=Array(window.localStorage.length);for(let o=0;o<e.length;o++)e[o]=window.localStorage.key(o);return e})),o.register("localClear",(()=>window.localStorage.clear())),o.register("sessionGet",(e=>window.sessionStorage.getItem(e))),o.register("sessionPut",(({key:e,value:o})
@PedroHLC
PedroHLC / core.nix
Last active October 16, 2023 19:16
Useless NixOS
{ pkgs, lib, ... }:
{
# Docker is already initialized
boot = {
isContainer = true;
initrd.enable = false;
kernel.enable = false;
loader.grub.enable = false;
modprobeConfig.enable = false;
};
@PedroHLC
PedroHLC / write-script-derivation.nix
Created October 6, 2023 17:57
A more complex version of writeShellScriptBin that generates a lib directory and make some other stuff easy too
{ lib
, runtimeShell
, stdenvNoCC
}@p:
{ pname
, lib ? p.lib
, runtimeShell ? p.runtimeShell
, stdenv ? stdenvNoCC
, version ? null
, critical ? false
@PedroHLC
PedroHLC / nix-frog-with-capes-web.svg
Created August 25, 2023 14:59
My take in a NixOS logo using FontAwesome's frog with capes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PedroHLC
PedroHLC / http-errors.pt-br.json
Created June 9, 2023 15:03
ChatGPT, can you generate a JSON file containing user-friendly explanations to the HTTP response status codes in Portuguese (Brazil), but only the error ones?
{
"400": "Requisição inválida. O servidor não pode processar a solicitação devido a um erro do cliente.",
"401": "Não autorizado. O acesso requer autenticação ou as credenciais fornecidas são inválidas.",
"402": "Pagamento necessário. O pagamento é necessário para acessar o recurso solicitado.",
"403": "Proibido. O servidor entende a solicitação, mas se recusa a atendê-la. O acesso é proibido.",
"404": "Não encontrado. O servidor não pôde encontrar o recurso solicitado.",
"405": "Método não permitido. O método de solicitação não é permitido para o recurso solicitado.",
"406": "Não aceitável. O servidor não é capaz de fornecer uma representação adequada para o recurso solicitado.",
"407": "Autenticação de proxy necessária. O cliente deve autenticar-se com o proxy antes de acessar o recurso.",
"408": "Tempo limite de solicitação. O servidor encerrou a conexão devido à solicitação levar muito tempo.",
@PedroHLC
PedroHLC / podman-dnsname.nix
Created March 22, 2023 14:58
Returns dnsname-cni to nixpkgs' podman
{ pkgs, ... }:
{
environment.etc."cni/net.d/87-podman-bridge.conflist".source =
let
cfgExtraPlugins = [{
type = "dnsname";
domainName = "dns.podman";
capabilities.aliases = true;
}];
cfgPackage = pkgs.podman;