Autologin Windows 10

https://www.winhelponline.com/blog/users-must-enter-a-user-name-and-password-to-use-this-computer-missing-windows-10/

control userpasswords2

netplwiz

Click Start, Settings, and click Accounts.

Click on Sign-in options

Turn off the radio button under the Require Windows Hello sign-in for Microsoft accounts section.

Registry branch:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device

Value name:

DevicePasswordLessBuildVersion

Data:

  • 0 means Require Windows Hello sign-in is disabled
  • 2 means Require Windows Hello sign-in is enabled

Older SSH Server Compatibility

Newer SSH client cannot connect to older SSH server (dropbear openwrt) because:

The RSA SHA-1 hash algorithm is being quickly deprecated across operating systems and SSH clients because of various security vulnerabilities, with many of these technologies now outright denying the use of this algorithm.

error message: no mutual signature algorithm

edit /etc/ssh/ssh_config

HostKeyAlgorithms=+ssh-rsa
PubkeyAuthentication yes
PubkeyAcceptedKeyTypes=+ssh-rsa

error message: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,kexguess2@matt.ucc.asn.au

Windows, the OpenSSH Client (ssh) reads configuration data from a configuration file in the following order:

By launching ssh.exe with the -F parameter, specifying a path to a configuration file and an entry name from that file.
A user's configuration file at %userprofile%\.ssh\config.
The system-wide configuration file at %programdata%\ssh\ssh_config.

The OpenSSH website has a page dedicated to legacy issues such as this one. It suggests the following approach, on the client:

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 123.123.123.123

or more permanently, adding

Host 123.123.123.123
KexAlgorithms +diffie-hellman-group1-sha1

The OpenSSH website has a page dedicated to legacy issues such as this one. It suggests the following approach, on the client:

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 123.123.123.123

or more permanently, adding

Host 123.123.123.123
KexAlgorithms +diffie-hellman-group1-sha1

to ~/.ssh/config

https://confluence.atlassian.com/bitbucketserverkb/ssh-rsa-key-rejected-with-message-no-mutual-signature-algorithm-1026057701.html
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration
https://unix.stackexchange.com/questions/340844/how-to-enable-diffie-hellman-group1-sha1-key-exchange-on-debian-8-0

Setup Modoboa Email Server on Ubuntu 22.04.2 LTS

Ubuntu 22.04.2 LTS
Minimum RAM 1gb (without clamav)
Minimum RAM 2gb (with clamav)

clamav-daemon start condition failed?
clamav-freshclam service needs lot of memory (out of memory will cause service to restart loop, then will be blocked by clamav CDN)
Rate limited / blocked from clamav CDN update, stop clamav-freshclam service for a while before restarting again

modoboa need pycairo
pycairo need packages:
sudo apt install libcairo2-dev pkg-config python3-dev

git clone https://github.com/modoboa/modoboa-installer
cd modoboa-installer
sudo python3 run.py --stop-after-configfile-check <domain>

update installer.cfg, set letsencrypt on
[certificate]
type=letsencrypt

[letsencrypt]
email=admin@domain.tld

run installer
sudo python3 run.py --debug <domain>

To limit clamav resource usages:
https://www.geekytuts.net/fix-high-server-load-and-memory-cpu-consumption-of-clamd-clamav/

To enable RAR scanning:
https://forum.proxmox.com/threads/av-scanning-in-rar-archives-not-working.71139/

To enable DKIM and SPF filter:
https://www.linuxbabe.com/mail-server/setting-up-dkim-and-spf

NOTE: DigitalOcean block outgoing port 25, alternative solution using sendgrid as relay to postfix
https://docs.sendgrid.com/for-developers/sending-email/postfix

Sources:
https://modoboa.readthedocs.io/en/latest/installation.html

OpenSSH Server on Windows 10

Install OpenSSH via Powershell Admin:
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

Name : OpenSSH.Server~~~~0.0.1.0
State : NotPresent
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Install OpenSSH on older Windows 10 prior version 10.1809:
Download https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v7.9.0.0p1-Beta
Unpack to c:\Program Files\OpenSSH
Run Powershell as an Administrator:
Set-Location "C:\Program Files\OpenSSH"
.\install-sshd.ps1

Install SSH key:

type .\.ssh\id_ecdsa.pub
ssh target@win10pc
copy con \ProgramData\ssh\administrators_authorized_keys
icacls.exe \ProgramData\ssh\administrators_authorized_keys /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"

Sources:
– https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement
– https://docs.plm.automation.siemens.com/content/polarion/19.3/help/en_US/polarion_linux_installation/configure_ole_object_support_and_attachment_preview_generator/install_openssh.html

Enable VNC on Raspberry Pi via SSH

sudo vncpasswd -service
# use -weakpwd for simple passwords
sudo echo ‘Authentication=VncAuth’ > /etc/vnc/config.d/common.custom
sudo service vncserver-x11-serviced stop
sudo service vncserver-x11-serviced start

How to uninstall Glance for Realme

It’s pretty easy to do if you have a pc.

1. Install “Minimal ADB and Fastboot” on your pc.
2. Turn on USB debugging on your phone.
3. Now open “Minimal ADB and Fastboot” on your pc and connect your phone to pc.
4. Now type in “adb devices” and click enter.
5. Now your phone will get a popup for granting authorisation. Tap “OK”.
6. Now type in “adb shell” and click enter.
7. Now type in “pm uninstall -k –user 0 com.glance.internet” and click enter.
8. Done.

Other bloated apps:
Baca Plus: com.jakarta.baca.lite
Realme Community: com.realmecomm.app
J&T: com.msd.JTClient
ORoaming: com.redteamobile.roaming
HeyFun: com.heytap.quickgame
Realme Store: com.realmestore.app
App Market: com.heytap.market [cant uninstall Failure [DELETE_FAILED_INTERNAL_ERROR]]
Browser: com.heytap.browser

https://dl.google.com/android/repository/platform-tools-latest-windows.zip
https://c.realme.com/in/post-details/1469153311427981312

Ender-3 Start End G-Code

; Ender 3 Custom Start G-code
G92 E0 ; Reset Extruder
G28 ; Home all axes
M140 S{material_bed_temperature_layer_0} ; set bed temperature
M104 S{material_print_temperature_layer_0} ; set hot end temperature
M190 S{material_bed_temperature_layer_0} ; wait for bed temperature to reach
M109 S{material_print_temperature_layer_0} ; wait for hot end temperature to reach
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish

; Ender 3 Custom End G-code
G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positioning

G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed

M84 X Y E ;Disable all steppers but Z

Raspberry Pi Kiosk without Desktop Environment

Here is how to make chromium kiosk without Desktop Environment (to save loading time and resources)

In my case chromium-browser not loaded in fullscreen by default, its position 65 pixel from top, so i need to add parameter “–window-size” and “–window-position” to make it right. In case its still not right, uncomment xdotool lines

save the text below in file ~/.xsession

#!/usr/bin/env bash

xset s off -dpms &

#exec matchbox-window-manager &
while true; do
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/Default/Preferences
sed -i 's/"exit_type": "Crashed"/"exit_type": "Normal"/' ~/.config/chromium/Default/Preferences
#in case chromium window size not fullscreen
#/usr/bin/xdotool sleep 60 getwindowfocus windowsize 800 480&
#/usr/bin/xdotool sleep 60 getwindowfocus windowmove 0 0&
/usr/bin/chromium-browser --no-default-browser-check --noerrdialogs --window-position=0,0 --window-size=800,480 --kiosk http://the-web-you-want-to-load
done

Raspberry Pi 1: Add bluetooth dongle and connect BT speaker

dmesg
[ 18.549303] Bluetooth: Core ver 2.22
[ 18.549496] Bluetooth: HCI device and connection manager initialized
[ 18.549542] Bluetooth: HCI socket layer initialized
[ 18.549571] Bluetooth: L2CAP socket layer initialized
[ 18.549625] Bluetooth: SCO socket layer initialized
[ 29.964223] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 29.964248] Bluetooth: BNEP filters: protocol multicast
[ 29.964289] Bluetooth: BNEP socket layer initialized

lsusb
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

hcitool dev
Devices:
hci0 00:1A:7D:XX:XX:XX

bluetoothctl list
Controller 00:1A:7D:XX:XX:XX raspberrypi [default]

* Error: sap-server: Operation not permitted
SAP stands for SIM Access Profile, so you have to disable it:
# Open /etc/systemd/system/bluetooth.target.wants/bluetooth.service
# Change:
ExecStart=/usr/lib/bluetooth/bluetoothd
To
ExecStart=/usr/lib/bluetooth/bluetoothd –noplugin=sap

# Reload the systemd:
sudo systemctl daemon-reload

# Restart the bluetooth:
sudo service bluetooth restart

# Get the bluetooth status:
sudo service bluetooth status

service bluetooth status
* bluetooth.service – Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-11-21 14:03:58 WIB; 4min 48s ago
Docs: man:bluetoothd(8)
Main PID: 627 (bluetoothd)
Status: “Running”
CGroup: /system.slice/bluetooth.service
└─627 /usr/lib/bluetooth/bluetoothd –noplugin=sap

# Create a “bluetooth” group which will be granted with on bluez’s d-bus config
sudo groupadd bluetooth

# Open the config in /etc/dbus-1/system.d/bluetooth.conf with your favorite text editor
sudo nano /etc/dbus-1/system.d/bluetooth.conf

# Add/append the following lines below in /etc/dbus-1/system.d/bluetooth.conf

# Add your login user to “bluetooth” group
sudo usermod -a -G bluetooth

# Reboot the system.
# Then try to use “bluetoothctl” without sudo
bluetoothctl show

sudo apt install pulseaudio pulseaudio-module-bluetooth

pulseaudio –start

bluetoothctl scan on

bluetoothctl pair 30:21:9D:57:AA:3B

bluetoothctl trust 30:21:9D:57:AA:3B

bluetoothctl info 30:21:9D:57:AA:3B

bluetoothctl connect 30:21:9D:57:AA:3B

pulseaudio –kill

pacmd info | grep Default

test:
omxplayer -o alsa test.mp3

https://stackoverflow.com/questions/48279646/bluetoothctl-no-default-controller-available/53738121#53738121
https://raspberrypi.stackexchange.com/a/46660
https://gist.github.com/actuino/9548329d1bba6663a63886067af5e4cb