Skip to content

Instantly share code, notes, and snippets.

View h3ct0r's full-sized avatar
☢️
Quarantine

Héctor Azpúrua h3ct0r

☢️
Quarantine
View GitHub Profile
@h3ct0r
h3ct0r / query_gpu_usage_ssh.bash
Created July 2, 2021 17:26
Query GPU usage (with nvdia-smi) on a list of servers via SSH. It ask for password for all machines and store it on a variable which is cleared after the script is finished (no password is kept in the bash logs).
read -p "User please: " -s USER && read -p "Password please: " -s PASS && echo -e "\nBeginning SSH query with user: $USER\n" && for host in '150.164.212.21' '150.164.212.23' '150.164.212.24' '150.164.212.25' '150.164.212.26' '150.164.212.27' '150.164.212.28' '150.164.212.33' '150.164.212.36' '150.164.212.37' '150.164.212.40' '150.164.212.42' '150.164.212.43' '150.164.212.45' '150.164.212.71' '150.164.212.72' '150.164.212.73' '150.164.212.75' '150.164.212.76' '150.164.212.80' '150.164.212.81' '150.164.212.117' '150.164.212.141' '150.164.212.148' '150.164.212.164' '150.164.212.171' '150.164.212.204' '150.164.212.226'; do sshpass -p $PASS ssh -oStrictHostKeyChecking=no $USER@$host 'echo "host:$(hostname) GPU usage: $(nvidia-smi --query-gpu=utilization.gpu,memory.free,memory.total --format=csv,noheader)"' 2> /dev/null; done && PASS="" && USER=""
@RodolfoFerro
RodolfoFerro / click_connect_button.js
Last active November 27, 2023 06:28
Stop Colab from disconnecting, 2021.
function ClickConnect() {
console.log('Working')
document
.querySelector('#top-toolbar > colab-connect-button')
.shadowRoot.querySelector('#connect')
.click()
}
intervalTiming = setInterval(ClickConnect, 60000)
@stevecondylios
stevecondylios / resize-image-in-github-issue-github-flavored-markdown.md
Last active June 17, 2025 10:15
How to Resize an Image in a Github Issue (e.g. Github flavored Markdown)

How to Resize an Image in Github README.md (i.e. Github Flavored Markdown)

Percentage:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width=50% height=50%>

Pixels:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width="150" height="280">

@Amir22010
Amir22010 / convert_voc_to_yolo.md
Created February 22, 2020 22:01 — forked from myounus96/convert_voc_to_yolo.md
convert pascal voc dataset to yolo format

Convert PascalVOC Annotations to YOLO

This script reads PascalVOC xml files, and converts them to YOLO txt files.

Note: This script was written and tested on Ubuntu. YMMV on other OS's.

Disclaimer: This code is a modified version of Joseph Redmon's voc_label.py

Instructions:

  1. Place the convert_voc_to_yolo.py file into your data folder.
@shubhamwagh
shubhamwagh / TexturedMeshSteps.md
Last active August 3, 2025 20:13
Steps to create textured mesh from point cloud using Meshlab

Steps to create Textured Mesh from Point Cloud using Meshlab

Get your PointCloud into MeshLab

  • Import the pointcloud file in ".ply" file format in Meshlab. Before importing make sure you do some pre-processing / cleaning on point cloud so as to ease the process of meshing.

Point Cloud Simplification and Normals Computation

  • Next we need to reduce the number of point samples for smooth meshing.
    • So go to Filters -> Point Set -> Point Cloud Simplification. Enter Number of samples circa 5% of original number of points. Make sure Best Sample Heuristic is checked.
  • After point cloud simplification, make sure to select Simplified point cloud in the Show Layer Dialog on the right hand side. If not visible, it can be opened by navigating to View -> Show Layer Dialog. Now we need to compute normals for point set.
  • So go to Filters -> Point Set -> Compute normals for point sets . Enter Neighbour num between 10 - 100. Initially try with 10 and
@geoffyuen
geoffyuen / firestick4k.md
Last active July 5, 2025 08:28
Amazon Fire Stick 4k Tips and Tricks
@matheustguimaraes
matheustguimaraes / install-cuda-cudnn.md
Last active March 20, 2023 05:08
Install CUDA 10.0 and cuDNN v7.4.2 on Ubuntu 16.04

Install CUDA 10.0 and cuDNN v7.4.2 on Ubuntu 16.04

Install the latest NVIDIA driver

Update package lists, download and install NVIDIA driver

sudo apt-get update
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install nvidia-410
@KenjiOhtsuka
KenjiOhtsuka / sample.kt
Created October 30, 2018 18:40
Kotlin prepared statement (SQL)
package com.improve_future.sample
import java.io.Closeable
import java.sql.DriverManager
import java.sql.Statement
import java.text.SimpleDateFormat
class Connection(private val coreConnection: java.sql.Connection) :
java.sql.Connection by coreConnection, Closeable {
@jsheedy
jsheedy / skeletonize.py
Created June 10, 2016 23:56
OpenCV-Python skeletonize function
def skeletonize(img):
""" OpenCV function to return a skeletonized version of img, a Mat object"""
# hat tip to http://felix.abecassis.me/2011/09/opencv-morphological-skeleton/
img = img.copy() # don't clobber original
skel = img.copy()
skel[:,:] = 0
kernel = cv2.getStructuringElement(cv2.MORPH_CROSS, (3,3))
@rdeavila
rdeavila / git-update-fork.sh
Last active July 26, 2025 20:15
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream