Skip to content

Instantly share code, notes, and snippets.

@xxorax
xxorax / ssh-hostname-unhash.sh
Last active November 11, 2024 01:25
Unhash the hostnames hashed in your known_hosts file by passing their names.
#!/bin/bash
# based on http://unix.stackexchange.com/questions/175071/how-to-decrypt-hostnames-of-a-crypted-ssh-known-hosts-with-a-list-of-the-hostna/175199#175199
function replace {
host="$1"
found=$(ssh-keygen -F "$host" 2>/dev/null | grep -v '^#' | sed "s/^[^ ]*/$host/")
if [ -n "$found" ]; then
ssh-keygen -R "$host" &>/dev/null
echo "$found" >>~/.ssh/known_hosts
echo "Found and replaced: $host"
@Ikalou
Ikalou / git_and_unity.md
Last active December 17, 2024 17:47
Git and Unity

EDIT: this is an old post and a lof the information in this document is outdated.

Using Git with Unity

Git logo

Git is a popular free and open source distributed version control system.

I am new to Unity, but as a long time git user, I wanted to use git for my

@wojteklu
wojteklu / clean_code.md
Last active April 21, 2025 06:12
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@fabianoriccardi
fabianoriccardi / Comparison Espressif ESP MCUs.md
Last active March 26, 2025 02:51
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. The reported specifications are referred to the SoC, not to the modules (silver shield).

ESP8266 ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6
Announcement Date 2014, August 2016, September
@sekcompsci
sekcompsci / Comparison Espressif ESP MCUs.md
Last active April 21, 2025 11:43 — forked from fabianoriccardi/Comparison Espressif ESP MCUs.md
Comparison chips (SoCs) table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6. Forked from @fabianoriccardi

Comparison chips (SoCs) 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
@Paraphraser
Paraphraser / Checking your Raspberry Pi's view of its power supply.md
Last active April 17, 2025 15:30
Checking your Raspberry Pi's view of its power supply (sometimes it's not the wall-wart)

Checking your Raspberry Pi's view of its power supply

Sometimes it seems like the first (and sometimes only) advice you get offered for almost any problem with a Raspberry Pi is "check your power supply". You think something like:

"hey, I'm using an official power supply sold as being matched with my Pi so how can there be any problem?"

You look up the specs then stick a controlled load across your supply and confirm that it can deliver the required number of Watts.

Yet your problems persist…

@dhmacher
dhmacher / New-PasswordLink.ps1
Created December 16, 2022 13:53
Powershell code to generate a password pusher URL (using pw.strd.co)
@gd3kr
gd3kr / embeddings.py
Created February 15, 2024 20:35
compute embeddings for tweets in tweets.json
"""
a simple script that reads tweets inside a json file, uses openai to compute embeddings and creates two files, metadata.tsv and output.tsv, which cam be used to visualise the tweets and their embeddings in TensorFlow Projector (https://projector.tensorflow.org/)
"""
# obtain tweets.json from https://gist.github.com/gd3kr/948296cf675469f5028911f8eb276dbc
import pandas as pd
import json
from openai import OpenAI
#!/bin/bash
export WSLKERNEL=`uname -a | cut -d " " -f3 | cut -d "-" -f1`
export CHECKOUT_DIR=`linux-msft-wsl-$WSLKERNEL`
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git --depth=1 -b $CHECKOUT_DIR
cd $WSLKERNEL
sudo make -j$(nproc) KCONFIG_CONFIG=Microsoft/config-wsl CONFIG_USB_STORAGE=m CONFIG_USB_UAS=m
sudo make -j$(nproc) KCONFIG_CONFIG=Microsoft/config-wsl CONFIG_USB_STORAGE=m CONFIG_USB_UAS=m modules
sudo make -j$(nproc) KCONFIG_CONFIG=Microsoft/config-wsl CONFIG_USB_STORAGE=m CONFIG_USB_UAS=m modules_install