Skip to content

Instantly share code, notes, and snippets.

View pshirshov's full-sized avatar
😹

Paul S. pshirshov

😹
View GitHub Profile
0. Don't have a SIM card in when you're updating radio firmware or it will bomb out partway through as it changes from internal IP to IP passthrough
1. Disable external IP passthrough mode: Network Setting -> Broadband -> Cellular APN -> #1 -> Modify icon -> "IP Passthrough" slider to off
2. Use "management" Wi-Fi AP as general Wi-Fi AP (with limitations) -> Network Setting -> Bridge1 -> Modify icon -> Move the Wi-Fi AP interface to the pane on the right alongside LAN1
NOTE: by default, once you do the above, the router will happily pass traffic from devices on the Wi-Fi AP to other devices on the LAN1 subnet, but will block traffic originating from the Wi-Fi AP from exiting to the Internet via the LTE side of the device. You can clumsily hack around this by setting another device, e.g. another Wi-Fi AP or Raspberry Pi or Cray supercomputer, as the default gateway for the LAN1 subnet in your DHCP server config, and pointing *that* device at the Zyxel as *its* default GW. This adds additional hops, but enabl
@pshirshov
pshirshov / nix-quick-install.sh
Last active February 12, 2024 00:00
nix-quick-install
#!/usr/bin/env bash
set -e
function prepare_layout() {
wipefs -a -f "$DISK1"
dd if=/dev/zero of="$DISK1" bs=50M count=1
partprobe
udevadm settle
@pshirshov
pshirshov / s3clean.sh
Created December 28, 2022 18:13
s3 mass bucket removal
#!/usr/bin/env bash
set -x
set -e
PREFIX=$1
buckets=$(aws s3api list-buckets | jq -r '.Buckets | map(.Name) | .[] | select(. | startswith("'${PREFIX}'-"))')
for bucket in $buckets; do
aws s3 rb s3://$bucket --force
@pshirshov
pshirshov / config.nix
Created October 30, 2022 11:35
pxe/nixos
{ config, pkgs, lib, ... }:
{
#...
services.pixiecore = let
nixos = (import "${lib.cleanSource pkgs.path}/nixos/lib/eval-config.nix" {
system = "x86_64-linux";
modules = [ ./pxe.nix ];
});
build = nixos.config.system.build;
@pshirshov
pshirshov / pixie.nix
Created January 26, 2022 13:18
NixOS / flakes / pixiecore
services.pixiecore =
let
key = "...";
nixpkgs = lib.cleanSource pkgs.path;
nixos = (import "${lib.cleanSource pkgs.path}/nixos/lib/eval-config.nix" {
system = "x86_64-linux";
modules =
[
"${lib.cleanSource pkgs.path}/nixos/modules/installer/netboot/netboot.nix"
({ pkgs, ... }: {
@pshirshov
pshirshov / fixes.md
Created October 25, 2020 20:05 — forked from spaced/fixes.md
wayland tweaks

scaling hidpi: everything is very small needed steps:

  • settings -> display -> scale = 1
  • settings -> enforce fonts dpi -> 162dpi
  • settings -> symbols -> scale up

meta/win/idea issue:

  • settings -> input -> keyboard -> extended -> toggle left alt with left win
  • idea: help -> custom properties:
class GoogleClient() {
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest
import com.google.api.client.http.javanet.NetHttpTransport
import com.google.api.client.json.jackson2.JacksonFactory
import com.google.api.services.oauth2.Oauth2
import com.google.auth.http.HttpCredentialsAdapter
import com.google.auth.oauth2.{AccessToken, UserCredentials}
import scala.jdk.CollectionConverters._
// shared data
@pshirshov
pshirshov / PrefixTree.scala
Created October 31, 2019 15:38
Simple prefix search tree (trie)
case class PrefixTree[K, V](values: Seq[V], children: Map[K, PrefixTree[K, V]]) {
def findSubtree(prefix: List[K]): Option[PrefixTree[K, V]] = {
prefix match {
case Nil =>
Some(this)
case head :: tail =>
children.get(head).map(_.findSubtreeOrRoot(tail))
}
}
@pshirshov
pshirshov / Markdium-Scala.scala
Created October 8, 2019 08:31
Markdium-Monorepo or Multirepo? Role-Based Repositories
lazy val conditionalProject = if (condition) {
project.in(...)
} else {
null
}
@pshirshov
pshirshov / Markdium-Shell.bash
Created October 8, 2019 08:31
Markdium-Monorepo or Multirepo? Role-Based Repositories
# generates pure JVM project
./sbtgen.sc
# generates JVM/JS cross-project
./sbtgen.sc --js
# generates pure JVM project for just one of our components
./sbtgen.sc -u distage