Skip to content

Instantly share code, notes, and snippets.

View tlk's full-sized avatar
πŸ”†
πŸ‡©πŸ‡°

Thomas L. Kjeldsen tlk

πŸ”†
πŸ‡©πŸ‡°
View GitHub Profile

Ubiquiti UVC G3 standalone setting bug

When resetting the camera, the setup wizard asks if the camera is set to NVR or Standalone mode. If standalone mode is selected the setting is not stored and the camera is operating in the NVR-mode. This can not be changed from the web UI after the initial setup. This is how I managed to get the camera to standalone mode.

  1. Connect to the camera via SSH
  2. Edit configuration file /tmp/system.cfg and change parameter device.managed_mode from 1 to 0
  3. Save file
  4. Apply settings with command $cfgmtd -f /tmp/system.cfg -w
#!/bin/bash
set -euo pipefail
# ── Preconditions ────────────────────────────────────────────────────────────
need() { command -v "$1" >/dev/null 2>&1 || { echo "$1 is required." >&2; exit 1; }; }
need docker
need dpkg-deb
need fakeroot
package main
func main() {
// Two new vars, with :=.
x, y := returns_one_and_two()
print("x = ", x, "\n") // 1
print("y = ", y, "\n") // 2
// One of the vars is new, use := for both.
y, z := returns_one_and_two()
@erikcorry
erikcorry / aliasing-slices.go
Created March 24, 2021 09:43
Golang slices sometimes alias their underlying array, and sometimes don't.
// Prints false, false, false, true, false, true, true, false, true.
package main
func main() {
for i := 0; i < 10; i++ {
println(doesItAlias(i))
}
}
@vidarh
vidarh / closures-basic.c
Created December 18, 2009 12:10
A number of ways to implement closures in C, in preparation of an upcoming blog post
#include <stdio.h>
#include <stdlib.h>
struct closure {
void (* call)(struct closure *);
int x;
};