Skip to content

Instantly share code, notes, and snippets.

@jjzazuet
jjzazuet / openwrt-edge-router.md
Last active December 1, 2022 17:57
OpenWRT edge router

Base setup

Warning: the OpenWRT web UI backup process only includes a portion of the /etc directoy. Back it up manually to preserve any customizations done outside of uci/luci.

Flash the 64 EFI variant of the latest OpenWRT version.

Specifically, the x86-64-generic-ext4-combined-efi variant.

dd if=openwrt-21.02.0-x86-64-generic-ext4-combined.img bs=1M of=/dev/sdX

@jjzazuet
jjzazuet / k0s-arch.md
Last active December 5, 2022 08:51
k0s Arch notes

Arch can run k0s in a relatively stable way.

Initial setup requires:

  • Installing htop, openssh, nano, dhcpcd.
  • Manually adding localhost in /etc/hosts.
  • Setting the node's hostname in /etc/hostname.

Enable core services:

@jjzazuet
jjzazuet / ap205.md
Last active June 22, 2022 01:25
AP205 Instant Firmware upgrade

Download FW package and start TFTP server. I used uftpd on Debian.

Generate CCODE using AP's serial number:

echo -n "<CC>-<SN>" | sha1sum | tr -d " -"

Concatenate the resulting string with the following format:

CCODE-<CC>-<SHA1SUM_CODE>
@jjzazuet
jjzazuet / opencl-amd.md
Last active November 18, 2021 12:27
AMD OpenCL on Debian 11
@jjzazuet
jjzazuet / AsyncAction.java
Last active January 24, 2022 16:41
Volach - unused code
public void performAsyncAction(Runnable r, int tries) {
if (tries > 0) {
executor.execute(new Runnable() {
int left = tries;
public void run() {
try { r.run(); } catch (Throwable t) {
log.error("Some error");
if(--left > 0) {
executor.schedule(this, sleepSeconds, TimeUnit.SECONDS);
} else {
@jjzazuet
jjzazuet / rotate.java
Created February 25, 2019 18:42
Rotate double matrix clock-wise or counter-clock-wise
public static double[][] rotate(double[][] matrix, boolean ccw) {
double [][] out = new double[matrix[0].length][];
for (int i = out.length - 1, j = 0; i >= 0 && j < out.length; i--, j++) {
double[] x = new double[matrix.length];
out[ccw ? i : j] = x;
for (int k = x.length, l = 0; k >= 0 && l < x.length; k--, l++) {
if (ccw) { out[i][l] = matrix[l][j]; }
else { out[j][l] = matrix[k - 1][j]; }
}
}
@jjzazuet
jjzazuet / react-redux-typescript.ts
Created January 2, 2019 23:05
React with Redux in Typescript - wiring draft
/* ======== Start with action definitions ======== */
import {Action} from "redux";
import {ThunkAction, ThunkDispatch} from "redux-thunk";
import {RootState} from "gopher/state";
export enum Ui { LOCK, ERROR }
export enum Auth { USER_LOAD_START, USER_LOAD_END, AUTH_RESTART }
export type ActionType = Ui | Auth;
export interface FluxAction<T extends ActionType, P = any> extends Action<T> { payload: P; }
@jjzazuet
jjzazuet / gnome3-lite-trueos.md
Created October 1, 2018 06:40
gnome3-lite setup on TrueOS

Add packages

pkg search gnome3-lite
pkg install gnome3-lite-XXXX

If on VMware Fusion

pkg install xf86-video-vmware

Set system configuration on /etc/fstab

@jjzazuet
jjzazuet / test-key.txt
Created August 18, 2018 20:22
test-key
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBHBmlKI58raLjx5ONKvAzCtOiL/b7Ke134YV1vPZkXYy8uaoTtGRKXzMAttpXURbqTI6qNugRApGg+WCeFDVNA= <ssh://root@poopy.qnoa.io|nist256p1>
@jjzazuet
jjzazuet / button.css
Last active August 14, 2018 15:50
CSS cool button
btn {
background: linear-gradient(#aeb7ff, #5468ff);
box-shadow: 0 7px 13px -3px rgba(45,35,66,0.3), 0 2px 4px 0 rgba(45,35,66,0.4), inset 0 -2px 0 0 #4b58ba;
}