Skip to content

Instantly share code, notes, and snippets.

View nicholasaiello's full-sized avatar

Nicholas Aiello nicholasaiello

View GitHub Profile
@nicholasaiello
nicholasaiello / README.md
Last active June 26, 2023 09:48
Fix WiFI and BT in Venus OS

Enable WiFi and Bluetooth on Pi Zero 2 W

The following steps worked for me, but consider them untested. Use at your own risk!

That being said, the process should be fairly quick, as long as you use the custom image provided in this thread. Otherwise, the Pi02 won't even boot.

Setup

SD card

@nicholasaiello
nicholasaiello / get-unique-id.sh
Created February 28, 2022 00:52
Allow /sbin/get-unique-id to reference wlan if eth0 does not exist
#!/bin/sh
NET_INF=/sys/class/net/eth0/address
if ! [ -f "$NET_INF" ]; then
NET_INF=/sys/class/net/wlan0/address
fi
sed -e 's,:,,g' "$NET_INF"
@nicholasaiello
nicholasaiello / check-node-sync.py
Created February 6, 2022 21:17
Check sync state of local node
import json
import subprocess
# TODO: support chcking s1,s2,s3 nodes
REMOTE_NODE_URL = 'https://api.harmony.one'
def get_latest_headers(api=None):
cmd = ['./hmy', 'blockchain', 'latest-header']
if api != None:
@nicholasaiello
nicholasaiello / Dockerfile
Last active January 23, 2022 16:46
Multi-platform build support (Dockerfile), and fix protoc download url for aarch64 platforms (map aarch64 -> aarch_64)
FROM --platform=$TARGETPLATFORM ubuntu:18.04
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETARCH
ARG TARGETOS
ARG TARGETPLATFORM
ARG GOLANG_VERSION="1.16.3"
SHELL ["/bin/bash", "-c"]
@nicholasaiello
nicholasaiello / .config
Last active January 19, 2022 20:53
Custom kernel config used for crypto machines, powered by CM4 Lite 8gb. Original code is from https://github.com/raspberrypi/linux
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.10.92 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=100201
CONFIG_LD_VERSION=235020000
CONFIG_CLANG_VERSION=0
CONFIG_LLD_VERSION=0
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Web Worker Transfers</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Math.ab VS Bitwise abs</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@nicholasaiello
nicholasaiello / index.html
Last active December 27, 2017 16:02
checking if string is of a certain type: array vs regex (http://jsbench.github.io/#4c7766792d730fb775b5b384d359a894) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>checking if string is of a certain type: array vs regex</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@nicholasaiello
nicholasaiello / index.html
Last active December 16, 2017 00:31
Current Watchlist reaction logic vs new algo #jsbench #jsperf (http://jsbench.github.io/#24d639a3c8c16b7184e8d328092180c8) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Current Watchlist reaction logic vs new algo #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@nicholasaiello
nicholasaiello / index.html
Created December 13, 2017 17:55
Test Object Array vs primitive array (http://jsbench.github.io/#c4dc7542e7c34020130bcb2fae5d706a) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test Object Array vs primitive array</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>