Skip to content

Instantly share code, notes, and snippets.

View hugosenari's full-sized avatar
🌞

Hugo Sena Ribeiro hugosenari

🌞
View GitHub Profile
@hugosenari
hugosenari / flake.nix
Last active July 6, 2023 21:33
NixOS Flake Template
{
description = "NixOS Flakes Template";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = inputs: {
nixosConfigurations.HOSTNAME = inputs.nixpkgs.lib.nixosSystem {
modules = [ ./configuration.nix ];
system = "x86_64-linux";
};
};
@hugosenari
hugosenari / lsof.txt
Created May 24, 2023 23:52
nixos rebuild files
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nixos-reb 3237568 root cwd DIR 259,2 4096 14814237 /home/hugosenari/Code/nixos-config
nixos-reb 3237568 root rtd DIR 259,2 4096 2 /
nixos-reb 3237568 root txt REG 259,2 987864 6423924 /nix/store/gsnqgx5ai6czlqjipiawc5x8c4bv2ndj-bash-5.1-p16/bin/bash
nixos-reb 3237568 root mem REG 259,2 3059040 6051885 /nix/store/h68xxa8rkns0cm15vmypr41wnm18320g-glibc-locales-2.35-224/lib/locale/locale-archive
nixos-reb 3237568 root mem REG 259,2 2400600 6315581 /nix/store/3xwi7gsyzl3sy4cq2467gca9zdk8yz9r-glibc-2.35-224/lib/libc.so.6
nixos-reb 3237568 root mem REG 259,2 15616 6315588 /nix/store/3xwi7gsyzl3sy4cq2467gca9zdk8yz9r-glibc-2.35-224/lib/libdl.so.2
nixos-reb 3237568 root mem REG 259,2 250992 6315574 /nix/store/3xwi7gsyzl3sy4cq2467gca9zdk8yz9r-glibc-2.
type
MySeq*[T] = object
data: ptr UncheckedArray[T]
proc createSeq*[T](elems: varargs[T]): MySeq[T] =
result.data = cast[typeof(result.data)](alloc(elems.len * sizeof(T)))
@hugosenari
hugosenari / deprecated.nix
Last active February 24, 2023 06:50
NixOS depracated options
{
services = [ "beegfs" "bird" "bird6" "beegfsEnable" "buildkite-agent" "cgmanager" "chronos" "couchpotato" "cryptpad" "dd-agent" "deepin"
"dnscrypt-proxy" "flashpolicyd" "fourStore" "fourStoreEndpoint" "fprot" "frab" "geoip-updater" "gogoclient" "kippo"
"mailpile" "marathon" "mathics" "meguca" "mesos" "moinmoin" "mwlib" "openfire" "openvpn" "osquery" "prey" "quagga" "racoon"
"railcar" "redis" "riak" "rmilter" "seeks" "shellinabox" "ssmtp" "venus" "virtuoso" "wakeonlan" "winstone"];
programs = ["bash" "oblogout" "qt5ct" "tilp2" "way-cooler"];
security = ["hideProcessInformation" "klogd" "rngd" "setuidOwners" "setuidPrograms"];
systemd = ["generator-packages"];
}
@hugosenari
hugosenari / じゃんけんぽん.nim
Last active May 29, 2024 07:22
Nim じゃんけんぽん
from std/random import randomize, sample
randomize()
type
✊🤚✌️ = enum
✊, 🤚, ✌️
🏆 = enum
👈, 🤷, 👉
@hugosenari
hugosenari / dumbness.nim
Created April 6, 2022 12:52
command line memoization
# import a lot of things because I'm to lazy (or dumb) to think about what imports
import std/[
algorithm,
asyncdispatch,
asyncfile,
asyncnet,
asyncstreams,
base64,
browsers,
@hugosenari
hugosenari / README.md
Created February 28, 2022 03:29
Englightenment 0Nix Test
{ config, pkgs, lib, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
@hugosenari
hugosenari / README.md
Last active August 31, 2021 05:16
slack message

Send message to slack

usage with github actions:

jobs:
  InformDeploy:
    runs-on: ubuntu-latest
    steps:
 - uses: cachix/install-nix-action@v13
@hugosenari
hugosenari / default.nix
Last active August 18, 2021 05:25
random gif from giphy
{ token, rating ? "pg-13", tag ? "so-excited", timestamp ? "n" }:
let
random_gif_response = builtins.fetchurl {
url = "https://api.giphy.com/v1/gifs/random?api_key=${token}&tag=${tag}&rating=${rating}&t=${timestamp}";
name = "random_gif_json";
};
random_gif_json = builtins.readFile random_gif_response;
in builtins.fromJSON random_gif_json