Skip to content

Instantly share code, notes, and snippets.

View nelsonaloysio's full-sized avatar
🐧

nelsonaloysio

🐧
View GitHub Profile
@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):

AdwaitaClassic

Classic Adwaita icons, with folders in a brown shade.

Requires updated Adwaita icons, inherited from the theme.

@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=$(
@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