Autonomous Machines & Society.

2023-08-16
Reset Windows Server Password

chntpw does not work this time. it will auto restore

the SAM file.

instead, under directory C:\Windows\System32, swap Utilman.exe (remember to back it up) with cmd.exe then click widgets in login window to popup command prompt, type net user <username> <password> to reset.

reference

Read More

2023-08-13
resource utilization monitor tool

linux

htop for ram and processes. s-tui for cpu/gpu temperatures

Read More

2023-08-12
Notable Tips

do not use slash in note names, which might cause issues for our syncing program.

Read More

2023-08-08
Exploring Alternative Linux Cd Managers: Goto, Go-Shell, Up, And Autojump

cd manager Linux alternative

goto supports bash and zsh (compdef needed)

go-shell supports powershell

up navigates to parent directory, supports fish, bash, zsh

autojump

Read More

2023-08-07
Aldente Windows & Linux Alternative

to increase stability, you need to prevent computer from overheating (throttle). also, replace normal laptop ram with ecc ram (not server-grade reg-ecc)

but ecc is only supported on Xeon processors.

moreover, you could just use UPS+NUC instead of laptop, to prevent this bloody battery issue.


will these charging limits still work if we close the lid? if not, we could possibly damage the battery.


to prevent damage to computer battery due to overcharging

Linux

kernel 5.5 or newer:

1
2
echo 60 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold

with platform-specific drivers, look for: /sys/devices/platform/.*/.*(battery|charge|thresh|limit).*

For ThinkPads and selected other laptops tlp/tlpui (acts like powertop which turns off usb devices, so be careful when running long-term programs) provides a unified way

to configure charge thresholds and recalibrate the battery.

Sometimes tp-smapi from apt will not install and you need to fetch the source and compile yourself. Activate the plugin by sudo modprobe tp_smapi

Run sudo systemctl start tlp to initiate service. Run sudo tlp-stat -s to check status.

Windows

Read More

2023-07-30
Setting Docker Container Storage Quota With Overlay And Different Storage Drivers

Docker container storage quota

--storage-opt is supported only for overlay over xfs with ‘pquota’ mount option.

change data-root to somewhere else in /etc/docker/daemon.json

edit /etc/fstab and add our xfs block on new line (find uuid using blkid)

1
2
docker run --storage-opt size=10M --rm -it alpine

when using devmapper make sure size is greater than 10G (default)

1
2
docker run --storage-opt size=11G --r'm -it alpine

zfs, vfs (not a unionfs, but for testing) storage drivers also supports disk quota. you may use it by changing data-root to the related storage device.

Read More

2023-07-27
Controlling Computers With Hardware Operations And Software Tools: A Comprehensive Guide

硬件操作电脑

https://github.com/kyegomez/CyberTron

https://github.com/eric-ai-lab/MiniGPT-5

bubogpt has attached many spacial adaptors, which may help controlling computers


use larq for low-end neural network training.


applications:

game playing/live streaming

hacking

assistent

virtual worker

digital life


high level self-replication: ideology reconstruction

self-consciousness (internal mirror)

based on low-level self-replication


install snapshot-free oses to eliminate data corruption and save time from rolling back to previous state when running virtual machines, or use docker containers with xfs support.


perform responsiveness check by interval, using some deterministic responses or commands (something (different) must happen because of something)


使用USB3.0录屏卡(HDMI)作为视频输入(类似于摄像头),延迟越低越好

you may configure pixel format (jpeg for fast computation) when using different capture cards

为了通用一般用专门的硬件键鼠模拟器 或者带OTG的RPi模拟键鼠 接收操控方电脑的指令 输出HID信号


reference

For recent raspbian you only need to turn on overlay switch in system configuration. (do not use other tools, since they will interfere)

For debian-like distros (ubuntu) you can use bilibop-lockfs or fsprotect (install/enable aufs-dkms or overlay filesystem before that)

For linux that is set to run in ram (tinycore linux), you can use it as-is, but it may oom so quick that you have to abandon it.


stackoverflow 提到可以用蓝牙进行鼠标键盘模拟 (requires extra setup)

Linux有驱动可以实现HID输出

Use USB Gadget with OTG cables.

用台湾的数据线

RPi4支持OTG(通过USB-C供电接口) micro HDMI需要转接

scrcpy –otg 可以识别周边设备 发送HID指令

定时开关机电源线 加类似于Deep Freeze或者Live CD机制 使得电脑可以接收任意操作而不崩溃

python usb-gadget wrapper

Read More

2023-07-14
Python Dsl

textX with syntax highlighter and LSP support, just like Xtext

ply: python lex-yacc

dhparser

lark

Read More

2023-07-05
Python Encoding Issue

windows has encoding issue on python intepreter.

run like this:

1
2
3
python -X utf8=1 <args>
# flag: sys.flags.utf8_mode

Read More

2023-06-16
Incremental Testing, Build Tools, Cacheing, Logging

how to log error emitted from better-exceptions?


logging tutorial at betterstack & official

other logging libraries: loguru structlog (able to show locals/globals around error)


better-exceptions


to ensure the consistency of tests, you need to collect input/output pairs (and compare with expected/actual output), if it is deterministic.


monkeytype, pytype (by google), runtype (Dispatch)


better assertion


enum class in python


use cache in pytest

use redis lru_cache, put decorators to json serializable functions

use build tools, forcing program to read and write files in the process

type checking using mypy

code static analysis

code formatter like black


tools:

pydoit with “up to date” signals for non-file objectives

scons

ruby rake

Read More