Skip to content

Instantly share code, notes, and snippets.

@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active January 25, 2025 02:42
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@ayebrian
ayebrian / vmware.md
Last active January 25, 2025 02:40
VMware ESXi 8 / vCenter 8 / Workstation 17 license key 2024
@MjHead
MjHead / get-realtion-meta.php
Created August 17, 2022 07:59
Get meta data from JetEngine relations from the code
<?php
$rel_id = 111; // Set here your actual Relation ID. You can get it from an address bar on relation settings edit page
$relation = jet_engine()->relations->get_active_relations( $rel_id );
$parent_id = 111; // ID of prequired arent object from relation
$child_id = 111; // ID of prequired arent object from relation
$key = 'meta_key'; // Name/ID of meta field to get
$meta_value = $relation->get_meta( $parent_id, $child_id, $key );

How to pass the OSCP

  1. Recon
  2. Find vuln
  3. Exploit
  4. Escalate
  5. Document it

Time yourself

@ronen
ronen / ___pyi_so_conflict___.md
Created December 13, 2014 04:22
Minimal example of pyinstaller --onefile .so conflict

Minimal example to reproduce pyinstaller issue #1105

Problem with conflicting .so files pyinstaller/pyinstaller#1105

To reproduce:

  1. Download the gist
  2. Gist doesn't support directories, so manually create the submodule:

Recovering deleted files in Ubuntu with ext4 filesystem

Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.

Important

  • this procedure assumes that the partition that contained the deleted files is different from the root partition, as that was the scenario with which I had to deal (deleted files were in my home dir). The procedure needs that the partition that contained the files is unmounted, so if the deleted files were in the root partition, the process would be a bit different (e.g. storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.)
  • if something is not clear, you need more information, etc. check the sources below

With that out the way, let's begin.

@saiddddd
saiddddd / polars.md
Created January 25, 2025 02:29 — forked from bitsnaps/polars.md
A cheat sheet for polars python package

Polars Cheat Sheet

Here's a cheat sheet for the Polars Python package, covering many of its key functions and features:

Installation

pip install polars 

# Install Polars with all optional dependencies:
pip install 'polars[all]'
@jupdike
jupdike / IntersectTwoCircles.js
Last active January 25, 2025 02:26
Find the intersections (two points) of two circles, if they intersect at all
// based on the math here:
// http://math.stackexchange.com/a/1367732
// x1,y1 is the center of the first circle, with radius r1
// x2,y2 is the center of the second ricle, with radius r2
function intersectTwoCircles(x1,y1,r1, x2,y2,r2) {
var centerdx = x1 - x2;
var centerdy = y1 - y2;
var R = Math.sqrt(centerdx * centerdx + centerdy * centerdy);
if (!(Math.abs(r1 - r2) <= R && R <= r1 + r2)) { // no intersection
@amitmerchant1990
amitmerchant1990 / console.js
Created January 24, 2025 08:07
Calculate used localStorage size for a website
let totalSize = 0;
for (let key in localStorage) {
if (localStorage.hasOwnProperty(key)) {
let keySize = new Blob([key]).size; // Size of the key
let valueSize = new Blob([localStorage[key]]).size; // Size of the value
totalSize += keySize + valueSize;
}
}