Skip to content

Instantly share code, notes, and snippets.

@sxiii
sxiii / remove.sh
Created October 5, 2020 05:35
Docker Swarm - Remove all Down nodes automatically
#!/bin/bash
# Requirements: linux, docker, grep, awk
# This script removes all "Down" (off) nodes from Docker Swarm
# Useful to clean stuff from time to time, if you have auto-joining nodes for example
sudo docker node rm $(sudo docker node ls | grep Down | awk -F" " '{ print $1 }')

Get pretrained weights:

wget https://dl.fbaipublicfiles.com/detr/detr-r50-e632da11.pth

Remove class weights

checkpoint = torch.load("detr-r50-e632da11.pth", map_location='cpu')
del checkpoint["model"]["class_embed.weight"]
del checkpoint["model"]["class_embed.bias"]
torch.save(checkpoint,"detr-r50_no-class-head.pth")
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 25, 2024 10:17
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@chiang-yuan
chiang-yuan / 2023-07-09-latex-matplotlib-on-HPCs.md
Last active April 25, 2024 10:09
Use latex with matplotlib on HPCs where you can't sudo!

Have you ever wanted to use LaTeX with matplotlib? You are definitely not alone. There are many tutorials out there that can guide you through the installation process. Then we can just follow the official documentation to make plots by activating plt.rcParams['text.usetex'] = True.

What we need to do is just installing typical latex by

sudo apt update
sudo apt install texlive # for minimum latex build
sudo apt install dvipng texlive-latex-extra texlive-fonts-recommended # required by matplotlib
@zoellner
zoellner / cognito_oidc_thumbprint.js
Last active April 25, 2024 10:09
node.js script to obtain the thumbprint for a Cognito User Pool to use as OpenID Connect Identity Provider
const openssl = require('openssl-wrapper');
const axios = require('axios');
const config = {
region: 'us-east-1',
userPoolId: 'your-user-pool-id'
};
getThumbprint()
.then(console.log)
@mm0202
mm0202 / docker-compose.yml
Last active April 25, 2024 10:09
logstash+elasticsearch+kibanaの設定。elasticsearchの永続化用パスの設定部分の書き換えと`docker network create`でelastic-stackを追加すれば、動くはず。
version: '3.0'
services:
logstash:
image: docker.elastic.co/logstash/logstash:6.3.2
restart: always
container_name: logstash
networks:
- elastic-stack
elasticsearch:
@loleg
loleg / generate.py
Last active April 25, 2024 10:06
A small Python script to generate certificates using an SVG template
#!/usr/bin/python
from xml.dom import minidom
import csv, os, re, string, subprocess
from argparse import ArgumentParser
import tempfile
# Create a SVG file with nodes having at least one of:
# name_black
# name_white
@kensleDev
kensleDev / Download.ps1
Last active April 25, 2024 10:02
Dev terminal setup for Powershell
$powershellDir = "~\.config\powershell"
New-Item -ItemType Directory -Force -Path $powershellDir
cd $powershellDir
Invoke-WebRequest -Uri 'https://gist.githubusercontent.com/kensleDev/13f9290876e782b2e67aab8b463e55f7/raw/66cdc60aa61da8a88a480c14b5fe817beba7dab9/profile.ps1' -OutFile 'profile.ps1'
Invoke-WebRequest -Uri 'https://gist.githubusercontent.com/kensleDev/13f9290876e782b2e67aab8b463e55f7/raw/cda7a409a315bf767f830897b0b8f53611e11f1e/Install.ps1' -OutFile 'Install.ps1'
Invoke-WebRequest -Uri 'https://gist.githubusercontent.com/kensleDev/13f9290876e782b2e67aab8b463e55f7/raw/13c1f7eb8ffa50e385c3b960c76ded9389bdaf3e/takuya.omp.json' -OutFile 'takuya.omp.json'