Skip to content

Instantly share code, notes, and snippets.

@yjlcoder
yjlcoder / bbb_download.py
Created April 4, 2021 19:39
Download Big Buck Bunny Lossless 1080P Video
#! /usr/bin/env python3
"""
This script is to download Big Buck Bunny lossless 1080P version
The video is 1920x1080 24 FPS as a sequence of PNG files.
Video Source: https://media.xiph.org/BBB/BBB-1080-png/
Author: Yang Liu
Date: 2021-04-04
@sindresorhus
sindresorhus / esm-package.md
Last active December 25, 2025 12:39
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@kiler129
kiler129 / README.md
Last active December 18, 2025 20:20 — forked from seeker2921/ilo-console.sh
Run iLO remote console from shell

iLO Remote Console

This small script lets you start iLO Java-based console from shell.

But why not HTML5?

  • iLO 2/3 doesn't have HTML5 console
  • Mounting local (from the client computer) ISOs is PAINFULLY slow via HTML5 client

TL;DR

If you just start it, it will ask you for everything:

Reverse Engineering SP110e LED Controller

Through Bluetooth sniffing, using this method I've been able to (semi reliably) control the SP110e controller via Homebridge.

You can find this controller for very cheap here: https://www.aliexpress.com/item/4000773623427.html?spm=a2g0o.productlist.0.0.4f09329cJ7C1H4&algo_pvid=542e757b-587f-4540-8652-2195883f1349&algo_expid=542e757b-587f-4540-8652-2195883f1349-0&btsid=0bb0622a16012309671478585ed4bd&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

This entire guide is for Bluetooth LE libraries, and uses hexidecimal.

LE configuration

---<<BOOT>>---
KDB: debugger backends: ddb
KDB: current backend: ddb
Type Physical Virtual #Pages Attr
ConventionalMemory 000080000000 0 000630d8 WC WT WB
LoaderData 0000e30d8000 0 00008000 WC WT WB
LoaderCode 0000eb0d8000 0 00000095 WC WT WB
LoaderData 0000eb16d000 0 00002103 WC WT WB
LoaderCode 0000ed270000 0 000000f2 WC WT WB
ConventionalMemory 0000ed362000 0 0000005e WC WT WB
@fepitre
fepitre / qvm-portfwd-iptables
Last active November 25, 2025 18:58 — forked from Joeviocoe/qvm-portfwd-iptables
Qubes-os port forwarding to allow external connections
#!/bin/bash
# Frédéric Pierret <[email protected]>
# Adapted from previous work:
# - https://gist.github.com/daktak/f887352d564b54f9e529404cc0eb60d5
# - https://gist.github.com/jpouellet/d8cd0eb8589a5b9bf0c53a28fc530369
# - https://gist.github.com/Joeviocoe/6c4dc0c283f6d6c5b1a3f5af8793292b
[ "$DEBUG" = 1 ] && set -x
@z3ntu
z3ntu / rotation_matrix.py
Last active January 22, 2025 08:34
generate the iio rotation matrix
#!/usr/bin/python3
import glob
import os
import sys
import time
"""
(according to Android emulator, seems to be inverse for iio)
upright/normal: 0 9.81 0

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@i-am-tom
i-am-tom / FizzBuzz.hs
Last active December 21, 2024 10:17
Arguably the fastest implementation of FizzBuzz ever written.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UnsaturatedTypeFamilies #-}
import GHC.TypeLits
import Prelude hiding (Functor, Semigroup)
type Main = (Fizz <> Buzz) <$> (0 `To` 100)
@lizthegrey
lizthegrey / attributes.rb
Last active August 29, 2025 15:40
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'