Skip to content

Instantly share code, notes, and snippets.

View hellodword's full-sized avatar
🔞

hellodword

🔞
View GitHub Profile
@osy
osy / tpm-rant.md
Last active October 5, 2024 16:39
TPM provides zero practical security

TPM provides zero practical security

TPM (Trusted Platform Module) is as useful for preventing real attackers as the TSA is at preventing real terrorists. The architecture is fundamentally flawed and most existing implementations are completely broken. I thought this argument was settled decades ago[1] when "trusted computing" was introduced mostly as a way to provide DRM and ownership capabilities to organizations. It has largely failed to impact the consumer market when it was introduced back in the early 2000s. However, recently there seems to be a movement by certain parties to reintroduce this failed product back to the market. Microsoft argues that in order to use Windows 11, you need TPM 2.0 compatible hardware because[2]:

The Trusted Platform Module(TPM) requirement ena

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/product.schema.json",
"title": "sing-box config schema",
"type": "object",
"$defs": {
"listableString": {
"$comments": "ref:https://github.com/SagerNet/sing-box/blob/b0db869b052aa32ec1716e43f7c1f50d7e491057/option/types.go#L77",
"description": "allow not having to be an array when there's single item",
"oneOf": [
@atyachin
atyachin / Android_Emulator_AWS_EC2_ARM64_2022.txt
Last active November 15, 2024 14:04
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
Android Emulator (ARM64) on EC2 - 2022
---------------------------------------
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)
@grahamperrin
grahamperrin / freebsd-wifi-adaptors.md
Last active September 26, 2024 16:51
FreeBSD: Wi-Fi: suggested adaptors

FreeBSD: Wi-Fi: suggested adaptors

There are numerous suggestions, I'm not yet aware of any other collection.

If the list below grows to become useful, someone might like to adapt its content for the FreeBSD wiki.

Suggestions, in chronological order

https://forums.freebsd.org/posts/381779 (2018-03-17)

@nhapentor
nhapentor / $Running a Private Ethereum Blockchain using Docker.markdown
Last active May 24, 2024 18:25
Setup and run a cluster of nodes to build a private Ethereum network in Docker environment

Running a Private Ethereum Blockchain using Docker

Put genesis.json, Dockerfile, docker-compose.yml and .env files together in the same folder. Then run the command.

docker-compose up
@qdm12
qdm12 / main.go
Last active February 12, 2024 01:17
DNS over HTTPS server resolver under 300 lines of clean Go code
package main
import (
"bytes"
"context"
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"log"
@mrphrazer
mrphrazer / flattening_heuristic.py
Created March 4, 2021 20:28
Flattening Heuristic Implementation
# (c) Tim Blazytko 2021
# implementation based on the blog post "Automated Detection of Control-flow Flattening"
# https://synthesis.to/2021/03/03/flattening_detection.html
import sys
from miasm.analysis.binary import Container
from miasm.analysis.machine import Machine
from miasm.core.locationdb import LocationDB
@sindresorhus
sindresorhus / esm-package.md
Last active November 17, 2024 22:07
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.
@alexkuang0
alexkuang0 / labelMailsByAddress.js
Created December 29, 2020 14:33
Apps Script for Gmail - Label mails by address
const PARENT_LABEL = 'example.com'
const LABEL_SEPARATOR = '-'
const LEVEL_SEPARATOR = '.'
const getLabelOrCreate = (labelName) => GmailApp.getUserLabelByName(labelName) || GmailApp.createLabel(labelName)
function labelMailsByAddress() {
const allTargetThreads = GmailApp.search(`label:${PARENT_LABEL} `)
allTargetThreads.forEach(thread => {
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv