Joggler2024mar18
Mar 18, 2024
Technology
1. flash
Download the Download Debian Bookworm (Kernel 6.1) for OpenFrame (~196 MB)
from following website:
Wrote it to usb disk:
Disk /dev/sdb: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: D
Units: sectors of 1 * 512 = 512 bytes
# gunzip -c /home/dash/Downloads/boo-ext2-1028-43-bookworm-6.1.82op.img.gz| dd of=/dev/sdb
Insert the disk, boot into the system:
Username/passwd is of/joggler
.
2. system info
System info:
root@openframe:/home/of# uname -a
Linux openframe 6.1.82op #1 SMP PREEMPT_DYNAMIC Sat Mar 16 03:43:01 GMT 2024 i686 GNU/Linux
root@openframe:/home/of# cat /etc/issue
Debian Bookworm \n \l eth0:\4{eth0}
3. Auto-Login
Install byobu and enable it as the default login session:
# apt install -y byobu
# byobu-enable
Edit the logind.conf
file:
$ sudo vim /etc/systemd/logind.conf
...
[Login]
NAutoVTs=1
ReserveVT=2
Enable the autologin in tty1:
$ sudo mkdir /etc/systemd/system/getty@tty1.service.d/
$ sudo vim /etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin of %I $TERM
Type=idle
Auto-start program in byobu:
$ cat ~/.byobu/windows.tmux
new-session bash ;
new-window htop ;
new-window top;
Change the items in /etc/fstab
:
#tmpfs /tmp tmpfs noatime,size=192M 0 0
#tmpfs /var/cache/apt tmpfs noatime,size=256M 0 0
#tmpfs /var/lib/apt/lists tmpfs noatime,size=256M 0 0
#tmpfs /var/log tmpfs noatime,size=16M 0 0
Create swap :
# dd if=/dev/zero of=/swapfile bs=1M count=2048
# mkswap /swapfile
# chmod 600 /swapfile
# swapon /swapfile
# echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
4. Auto Monitor
Install some packages:
sudo apt install -y cmake build-essential git s-tui scdoc
git clone https://github.com/ReimuNotMoe/ydotool.git
cd ydotool
mkdir build
cd build
cmake ..
make -j `nproc`
sudo make install
Install ydotoold service:
cp /usr/local/lib/systemd/user/ydotoold.service /etc/systemd/system/ydotoold.service
systemctl enable ydotoold
systemctl start ydotoold
Always switch to next frame:
# cat /root/test.sh
ydotool key 29:1 56:1 59:1 59:0 56:0 29:0; sleep 2;
while true
do
sleep 2
ydotool key 62:1 62:0
done
5. share on web
Get the latest tty-share
from https://github.com/elisescu/tty-share/releases
:
Put it under home directory, then add following lines in .bashrc
:
[[ $(tty) == '/dev/tty1' ]] && /home/of/tty-share_linux-386 --listen 0.0.0.0:8188 --no-wait --command byobu
Then you should disable byobu
for the default term:
$ byobu-disable
6. switch
6.1 not working
Add auto switch tab on every reboot:
# crontab -e
@reboot sleep 60 && /usr/bin/myswitch.sh
# cat /usr/bin//myswitch.sh
ydotool key 29:1 56:1 59:1 59:0 56:0 29:0; sleep 2;
while true
do
sleep 5
ydotool key 62:1 62:0
done
6.2 working
Change the VT configurations:
$ cat /etc/systemd/logind.conf
[Login]
NAutoVTs=2
ReserveVT=3
$ cat /etc/systemd/system/getty@tty2.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin of %I $TERM
Type=idle
Edit the autologin programs in ~/.bashrc
:
[[ $(tty) == '/dev/tty2' ]] && sudo /usr/bin/myswitch.sh
enable the getty@tty2:
# sudo systemctl enable getty@tty2