2020年7月3日 星期五

Xpra + Apache2 proxy (Debian 10.4)

1.安裝 XPRA
echo "deb https://xpra.org/ buster main" >/etc/apt/sources.list.d/xpra.list

apt-get install apt-transport-https
wget -q https://xpra.org/gpg.asc -O- | sudo apt-key add -
apt-get update
apt-get install xpra

2.Apache2 載入模組
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_html
a2enmod proxy_wstunnel

3.修改 Apache2 設定檔,加入
<Location "/xpra">
  RewriteEngine on
  RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
  RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
  RewriteRule .* ws://localhost:14500/%{REQUEST_URI} [P]

  ProxyPass ws://localhost:14500
  ProxyPassReverse ws://localhost:14500

  ProxyPass http://localhost:14500
  ProxyPassReverse http://localhost:14500
</Location>

4.xpra 執行方式
xpra start :100 --start-child=xterm --bind-tcp=0.0.0.0:14500

2020年7月1日 星期三

Debian 10 安裝 Shell in a box

安裝
apt install -y shellinabox

允許 root 登入
修改 /etc/default/shellinabox
SHELLINABOX_ARGS=--no-beep
加入 --service=/:SSH

2020年6月29日 星期一

apache2.service: Failed to set up mount namespacing: Permission denied

1.編輯  /etc/systemd/system/multi-user.target.wants/apache2.service
修改 PrivateTmp=true 為
PrivateTmp=false
NoNewPrivileges=yes

2.執行
systemctl daemon-reload

2020年6月10日 星期三

Linux 列出伺服器廠商、型號及 SN

dmidecode -s system-manufacturer
dmidecode -s system-product-name
dmidecode -s system-serial-number

ipmitool fru list

2020年6月7日 星期日

Raspberry pi Waveshare 3.5 RPi LCD XPT2046 A 設定

git clone https://github.com/waveshare/LCD-show.git
cd LCD-show/
sudo ./LCD35-show

編輯 /boot/config
dtoverlay=waveshare35a:rotate=270
hdmi_force_hotplug=1
#max_usb_current=1
hdmi_group=0
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 640 480 60 6 0 0 0
hdmi_drive=2
#display_rotate=1
#lcd_rotate=2

參考資料
https://t.codebug.vip/questions-171571.htm
https://www.raspberrypi.org/documentation/configuration/config-txt/video.md


2020年6月3日 星期三

Raspberry pi 3 Under-voltage detected! (0x00050005)

編輯 /boot/config.txt 加入

# Disable under-voltage warning
avoid_warnings=1

2020年6月2日 星期二

Linux CPU NUMA 資訊

numactl --hardware
lscpu
cat /sys/devices/system/node/online