Skip to content

Instantly share code, notes, and snippets.

View nelsonaloysio's full-sized avatar

nelsonaloysio

View GitHub Profile
@nelsonaloysio
nelsonaloysio / toolbox-export.sh
Created July 7, 2024 07:17
Export toolbox applications the same way as with distrobox.
#!/usr/bin/env sh
# SPDX-License-Identifier: GPL-3.0-only
#
# This file is part of the distrobox project:
# https://github.com/89luca89/distrobox
#
# Just modified to work with toolbox:
# https://github.com/containers/toolbox
#
# Copyright (C) 2021 distrobox contributors
@nelsonaloysio
nelsonaloysio / sshx.rc.sh
Last active July 9, 2024 11:41
SSH/SCP with GPG encryption.
#!/usr/bin/env bash
# sshx.sh - SSH/SCP with GPG encryption.
MY_PGP_KEY="XXXXX"
MY_SSH_TAR="/path/to/file.tar.gz.gpg"
function ssh-host () {(
# Reads ~/.ssh/config and returns the host entry for the given host.
h=$(

AdwaitaClassic

Classic Adwaita icons, with folders in a brown shade.

Requires updated Adwaita icons, inherited from the theme.

@nelsonaloysio
nelsonaloysio / clustering.py
Created February 13, 2024 15:13 — forked from wzjoriv/clustering.py
Nearest Neighbor, K Nearest Neighbor and K Means (NN, KNN, KMeans) implemented only using PyTorch
import torch as th
"""
Author: Josue N Rivera (github.com/wzjoriv)
Date: 7/3/2021
Description: Snippet of various clustering implementations only using PyTorch
Full project repository: https://github.com/wzjoriv/Lign (A graph deep learning framework that works alongside PyTorch)
"""
def random_sample(tensor, k):
@nelsonaloysio
nelsonaloysio / hex.sh
Last active January 10, 2024 21:04 — forked from nberlette/hex.sh
[bash] rgb to hex
hex() { bash -c """printf "%02X%02X%02X" $(echo $* | tr , \ )"""; }
@nelsonaloysio
nelsonaloysio / flatpak install
Created January 2, 2024 21:14 — forked from user5145/flatpak install
how to build, install and remove flatpak applications from cli
1. Store in a repository
flatpak-builder --force-clean build-dir --repo=/path/to/local/repo your.application.Client.yml
2. Install from the repository
flatpak --user install localrepo your.application.Client
3. Install the repository
flatpak --user remote-add --no-gpg-verify local-repo /path/to/repo
4. Store in a folder

Mounting BitLocker-encrypted NTFS drives as read/write on MacOS Ventura

BitLocker encryption has become a common alternative for securing personal files and is nowadays natively supported by Linux, at least within GNOME. Some additional steps, however, are still required to ensure full MacOS compatibility. This guide describes the necessary steps to achieve it.

Requirements

We require three packages: macFUSE, ntfs-3g (and brew), and dislocker.

1/3: Install macFUSE

@nelsonaloysio
nelsonaloysio / cmus-spotify-modern-rc
Created September 6, 2023 19:25
cmus: rc and spotify-modern theme
# cmus-spotify-modern-rc
{
"aa": "afar",
"ab": "abkhazian",
"ae": "avestan",
"af": "afrikaans",
"ak": "akan",
"am": "amharic",
"an": "aragonese",
"ar": "arabic",
"as": "assamese",
{
"Afghanistan": "AFG",
"Albania": "ALB",
"Algeria": "DZA",
"American Samoa": "ASM",
"Andorra": "AND",
"Angola": "AGO",
"Anguilla": "AIA",
"Antigua and Barbuda": "ATG",
"Argentina": "ARG",