Skip to content

Instantly share code, notes, and snippets.

@indeedhat
indeedhat / array_has_missing_keys.php
Created May 22, 2024 18:30
Check php array against a shape
<?php
function array_has_missing_keys(array $shape, array $payload, ?array &$missing): bool
{
foreach ($shape as $k => $v) {
if (!is_array($v)) {
if (!array_key_exists($v, $payload)) {
$missing[] = $v;
}
continue;
}
@indeedhat
indeedhat / install.sh
Created July 18, 2023 11:17
Install atheros ar9271 driver ubuntu 22.04 (jammy)
# Add this line in /etc/apt/sources.list
# deb http://httpredir.debian.org/debian/ bullseye main contrib non-free
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 605C66F00D6C9793
sudo apt-get update --allow-unauthenticated
# this will produce an error... go with it
sudo apt-get install firmware-atheros
@indeedhat
indeedhat / notion.bat
Last active February 12, 2021 15:23
add notion.so to your hosts file (windows)
@echo off
echo 104.26.4.98 notion.so >> C:\Windows\System32\drivers\etc\hosts
echo 104.26.5.98 notion.so >> C:\Windows\System32\drivers\etc\hosts
echo 104.26.4.98 www.notion.so >> C:\Windows\System32\drivers\etc\hosts
echo 104.26.5.98 www.notion.so >> C:\Windows\System32\drivers\etc\hosts
echo 104.26.4.98 *.notion.so >> C:\Windows\System32\drivers\etc\hosts
echo 104.26.5.98 *.notion.so >> C:\Windows\System32\drivers\etc\hosts
echo 104.26.4.98 msgstore.www.notion.so >> C:\Windows\System32\drivers\etc\hosts
echo 104.26.5.98 msgstore.www.notion.so >> C:\Windows\System32\drivers\etc\hosts
@indeedhat
indeedhat / .gitignore
Last active February 12, 2020 00:13 — forked from brianm/.gitignore
Go net/rpc over ssh+netcat and unix domain sockets It would be nice if ssh.Session implemented io.ReaderWriter
local_client
server
client
ext