Skip to content

Instantly share code, notes, and snippets.

@craig-m
craig-m / README.md
Last active May 18, 2024 01:49
Packer Vagrant VirtualBox Ubuntu 22.04 install with Cloud-Init

Ubuntu Packer VirtualBox

A simple Packer + Vagrant VirtualBox install of Ubuntu live-server 22.04 (x86) using Cloud-Init, and documentation of my host desktop.

host setup

A fresh install of any supported LTS or the latest Ubuntu desktop version is good. I have tested this on ubuntu 18.04.6 running on an i5-4570 (4 core 3.20GHz) with 16GB of RAM, a nearly 10 year old computer. Get a dedicated machine, it need not be fancy or new.

Update and get setup with some tools + deps first:

@varenc
varenc / README.md
Last active May 18, 2024 01:42
Keep your Mac from waking by disabling the `InternalPreventSleep` assertion from `com.apple.powermanagement.acwakelinger`

Disable AC Wake lingering in macOS using undocumented pmset features

Every time your Mac wakes from sleep powerd creates an InternalPreventSleep assertion labeled com.apple.powermanagement.acwakelinger with a 45 second timeout. That assertion ensures that even if your Mac needs to wake for 2 seconds to recieve a push notification that it stays on for 45 seconds. Seemingly there's no way to control this. And recent versions of macOS love to wake quite frequently.

Forunately we can disable this. The built in pmset tool has many undocumented features but thankfully it's open source

Cruicially there's an undocumented pmset disabledassertion feature that just makes macOS ignore certain power assertions. To effectively disable acwakelinger we just run this:

$ sudo pmset disableassertion InternalPreventSleep
@veekaybee
veekaybee / normcore-llm.md
Last active May 18, 2024 01:40
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@kayabaNerve
kayabaNerve / deanon_dero.md
Created May 17, 2024 14:53
Deanonymization of the Dero Network

The Dero Protocol

The protocol uses a pair of rings, one for the senders, one for the receivers, represented as a singular ring. With each transfer, a list of ElGamal ciphertexts is provided for all accounts within the joint ring. This ElGamal ciphertext is formed as r * G, (r * K) + (a * G), where r is some randomness, K is the key for the account the ciphertext is for, and a is the amount.

The Dero Wallet Protocol

Dero offers an 'encrypted message' with every transaction. Even if the user does not explicitly provide one, a message will exist (either with internally provided values or left empty). For the only defined type of message, the message is encoded as the index of the sender, a CBOR-encoded object, and zero-padding. The message is encrypted with the Chacha20 stream created by a key of H(H(r * K) || K) where r is some randomness and K is the key for the account the ciphertext is for.

The Issue

@ww9
ww9 / gist_markdown_examples.md
Last active May 18, 2024 01:30
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
@mayufo
mayufo / 验证中国身份证 前6位对应地区码
Created January 16, 2018 10:12
验证中国身份证 前6位对应地区码
var GB2260 = {
"110000": "北京市",
"110100": "北京市市辖区",
"110101": "北京市东城区",
"110102": "北京市西城区",
"110103": "北京市崇文区",
"110104": "北京市宣武区",
"110105": "北京市朝阳区",
"110106": "北京市丰台区",
"110107": "北京市石景山区",
@Klerith
Klerith / regular-exp.ts
Created September 15, 2023 16:38
Validadores usando expresiones regulares
export class Validators {
static get email() {
return /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
}
}
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 18, 2024 01:26
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

<div className="flex flex-col">
<div className="overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="inline-block min-w-full py-2 sm:px-6 lg:px-8">
<div className="overflow-hidden">
<table className="min-w-full">
<thead className="border-b">
<tr>
<th
scope="col"
className="px-6 py-4 text-left text-sm font-medium text-gray-900"
<div className="relative flex min-h-screen flex-col justify-center overflow-hidden bg-gray-50 py-6 sm:py-12">
<div className="relative w-full bg-white px-6 pt-10 pb-8 shadow-xl ring-1 ring-gray-900/5 sm:mx-auto sm:max-w-lg sm:rounded-lg sm:px-10">
<form
>
<label className="mb-2 block" htmlFor="name">
Name
</label>
<input
id="name"