Skip to content

Instantly share code, notes, and snippets.

@joshlk
joshlk / 0_nvidia_benchmark.md
Last active March 29, 2024 06:06
Benchmark bandwidth and latency of P2P NVIDIA GPUs (NVLINK vs PCI)

NVIDIA GPU P2P Benchmark bandwidth/throughput and latency

Using https://github.com/NVIDIA/cuda-samples

You can also view the GPU topology using nvidia-smi topo -m

  1. Download repo git clone https://github.com/NVIDIA/cuda-samples.git
  2. Checkout the tag that corresponds with the right CUDA version: git checkout tags/v11.1
  3. You might need to install some additional packages sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev
  4. Either build everything by just execting make in root dir. Or cd Samples/p2pBandwidthLatencyTest; make
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
foo() {
debugger;
console.log(...arguments);
}
@aku
aku / gen_images.mjs
Last active March 29, 2024 06:03
Generate images using Draw Things HTTP API
import { writeFile } from 'fs/promises'
const DRAW_THINGS_URL = 'http://127.0.0.1:7860/sdapi/v1/txt2img'
const BATCH_COUNT = 5
const IMG_SIZE = 512
const MAX_FILE_NAME_LEN = 30
const prompt = 'bunch of carrots'
const params = {
var Bar1 = base => class extends base {
componentWillMount(){
super.componentWillMount();
console.log('Bar1');
}
};
var Bar2 = base => class extends base {
componentWillMount(){
super.componentWillMount();
@sekcompsci
sekcompsci / Comparison Espressif ESP MCUs.md
Created June 18, 2021 03:56 — forked from fabianoriccardi/Comparison Espressif ESP MCUs.md
Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

A minimal table to compare the Espressif's MCU families.

ESP8266 ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6
Announcement Date 2014, August 2016, September 2019, September 2020, December
@lzjluzijie
lzjluzijie / warp.js
Created February 25, 2024 07:55
Cloudflare Warp 24PB key generator
# See https://halu.lu/%E6%9D%82%E8%B0%88/cloudflare-warp/
# Depolyed at https://warp.halu.lu/
// Change keys if needed
const keys = [
"9WO41D5p-6OP8xj27-36gQG75D",
"R65K12Up-aU907O2e-4nuvD581",
"06LM94EJ-1nl0V2d7-V847va5y",
]
@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 06:00
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@sandorex
sandorex / build-gsi.sh
Last active March 29, 2024 05:58
Script to build GSI AP file for odin
#!/bin/bash
# build-gsi.sh - https://gist.github.com/sandorex/031c006cc9f705c3640bad8d5b9d66d2
# other files needed:
# otatools-mini - https://mega.nz/file/TLgHDD6L#Kwxb04VoJDtXa6XLHxsxbHAIusXc0VHM12dqAbvRWlQ
# vbmeta.img - https://mega.nz/file/HGoGzC5J#VZUJ6n_GVCaGRzgaO2up0FhFx52swhcO0T6ewlUW5Mk
#
# Copyright 2023 Aleksandar Radivojevic (https://github.com/sandorex)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
@streetturtle
streetturtle / sp
Last active March 29, 2024 05:51 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#