Skip to content

Instantly share code, notes, and snippets.

@valichek
valichek / gist:ba510de9ff2cf3d0c502
Created May 5, 2014 21:12
Strange behaviour of merge and into with map where keys are instances of AsyncChannel from http-kit
(ns clj-test-server.core
(:use org.httpkit.server))
; https://github.com/http-kit/http-kit/blob/master/src/java/org/httpkit/server/AsyncChannel.java
(def clients (atom nil))
(defn handler []
(future (let
[merged (merge {} @clients)]
@jxmorris12
jxmorris12 / torch_ddp_verify.py
Last active April 18, 2024 23:54
verify parameter weights & gradients in pytorch
def verify_ddp_weights_equal(model: torch.nn.Module, atol: float = 1e-5) -> None:
if hasattr(model, "module"):
model = model.module
world_size = get_world_size()
for name, param in model.named_parameters():
gathered_param = gather(param).reshape((world_size, -1))
absolute_diffs = (gathered_param[None, 0, :] - gathered_param).abs()
rank_params_eq = (absolute_diffs < atol).all()
assert rank_params_eq, f"❌ param [{name}] not equal - got max_absolute_diff={absolute_diffs.max()}"
@peterforgacs
peterforgacs / Windows10AWSEC2.md
Last active April 18, 2024 23:53
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

@reyrarnfredur
reyrarnfredur / links.md
Last active April 18, 2024 23:51
List of resources for game design I am interested in and/or currently using.
@morinted
morinted / README.md
Created June 22, 2017 15:16
Remove TypeRacer Input limit

This script removes the input length limit which can trip up Plover users.

Simply install the script into TamperMonkey (Chrome) or GreaseMonkey (Firefox) and get racing.

The script was created by community member nimble

id: swagger-ui
info:
name: Swagger UI
author: vidocsecurity
severity: low
description: Swagger UI exposes information about endpoints and sometimes it is vulnerable tu XSS
tags: swagger-ui,exposure
requests:
@paolocarrasco
paolocarrasco / README.md
Last active April 18, 2024 23:49
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@rponte
rponte / using-uuid-as-pk.md
Last active April 18, 2024 23:42
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@zoilomora
zoilomora / Temperature and Voltage from MikroTik Router by Telegraf.md
Last active April 18, 2024 23:39
Temperature and Voltage from MikroTik Router by Telegraf

Temperature and Voltage from MikroTik Router by Telegraf

Telegraf is a highly modular software provided by InfluxData that allows us to configure numerous Inputs and Outputs to collect any information.

In this case I have done the tests with my MikroTik hEX S router.

Mikrotik provides you with a MIB file with the OID addresses of its Routers.

Configure Telegraf

Create a file in /etc/telegraf/telegraf.d/ with extension .conf with the following content:

@x0nu11byt3
x0nu11byt3 / elf_format_cheatsheet.md
Created February 27, 2021 05:26
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation