2020/8/9

ubuntumate : 變更 login 畫面背景圖片

結果一堆都是直接到 wallpapaper foler 改 link..
如果要用 gui 的話,要另外安裝:
$ sudo apt install lightdm-gtk-greeter-settings
裝完開啟 LightDM GTK+ greeter: Setting

可以看到 default login background picture 是:/usr/share/backgrounds/? ...糟糕被改了。
去設成自己的就可以。

便得很醜。發現在 /etc/lightdm/ 下多了一個 lightdm-gtk-greeter.conf:
[greeter]
background = /home/charles-chang/Pictures/LenovoWallPaper.jpg

2020/8/8

chromebook : flutter dev

在 ubunutu 上安裝 flutter 時,看到 chromeos 選項。
所以 flutter 也可以在 chromebook 上開發 了。
或許說,chromebook 可以 run android studio 了。

看了一下,是在 chromebook 的Linux(Beta) 裡安裝的。

從 chromebook 開機得時候,第一次啟動 linux(beta) 時,可以看到 , linux(beta) 好像是 run 在 vm (還是 container) 裡..
chromebook 能做得事越來月多,難怪有人說 chromebook 銷售大爆發..

問題:android run 起來 loading 很重,hardware 都是輕量的 chromebook 可以 run 得起來嗎?

2020/8/4

phone NN benchmarking

竟然有這種網站:AI-Benchmark, Phone
benchmarking 論文是:
然後這一篇說,pixel 2 雖然是 snapdragon 835,但是不支援 SNPE GPU 加速?
因為 google 沒有把 qualcomm bsp 的 dsp, opencl library 包進去?!

MEMS motion sensor : IIS2DLPC. linux driver 和 使用

ST 提供兩種 driver type: iio 好像是新的..這裡只看 input (其實是因為只有 port input)

input device return 都是一個 input_event 的 structure:
struct input_event {
	struct timeval time;
	unsigned short type;
	unsigned short code;
	unsigned int value;
};
type 就定義在 linux/input.h
所以 driver 只能借用用input.h 的值:
#define INPUT_EVENT_TYPE    EV_MSC
#define INPUT_EVENT_X       MSC_SERIAL
#define INPUT_EVENT_Y       MSC_PULSELED
#define INPUT_EVENT_Z       MSC_GESTURE
#define INPUT_EVENT_TIME_MSB    MSC_SCAN
#define INPUT_EVENT_TIME_LSB    MSC_MAX
g sensor 中,report data 的 function:
static void lis2dw12_report_3axes_event(struct lis2dw12_sensor_data *sdata,
                      s32 *xyz, s64 timestamp)
{
    struct input_dev *input = sdata->input_dev;

    if (!sdata->enabled)
        return;

    input_event(input, INPUT_EVENT_TYPE, INPUT_EVENT_X, xyz[0]);
    input_event(input, INPUT_EVENT_TYPE, INPUT_EVENT_Y, xyz[1]);
    input_event(input, INPUT_EVENT_TYPE, INPUT_EVENT_Z, xyz[2]);
    input_event(input, INPUT_EVENT_TYPE, INPUT_EVENT_TIME_MSB,
            timestamp >> 32);
    input_event(input, INPUT_EVENT_TYPE, INPUT_EVENT_TIME_LSB,
            timestamp & 0xffffffff);
    input_sync(input);
}
所以 read( ) 讀進來的...就是...
ev.type = INPUT_EVENT_TYPE
ev.code = INPUT_EVENT_X
ev.value = x acceleration value
所以參考前面的reading input device 的程式,修改一下..
 const char *dev="/dev/input/event0";
  ..
  ..
       if(ev.type == INPUT_EVENT_TYPE) {
            switch(ev.code) {
                case INPUT_EVENT_X:
                    printf("X: %d\n",ev.value);
                    break;
                case INPUT_EVENT_Y:
                    printf("Y: %d\n",ev.value);
                    break;
                case INPUT_EVENT_Z:
                    printf("Z: %d\n",ev.value);
                    break;
                default:
                    printf("NOT VALID code: %d\n",ev.code);
            }
        }else{
            printf("NOT VALID TYPE: %d\n",ev.type);
        }
driver 的控制界面在sysfs 裡...enale it..
# ls /sys/class/input/event0/device/accel
enable        polling_rate  resolution    scale         scale_avail
# echo 1 > /sys/class/input/event0/device/accel/enable
執行..
# ./gmonitor 
X: -25376
Y: -14640
Z: 973072
NOT VALID code: 4
NOT VALID code: 7
NOT VALID TYPE: 0
X: -22448
Y: -18544
Z: 967216
NOT VALID code: 4
NOT VALID code: 7
NOT VALID TYPE: 0
X: -26352
Y: -17568
Z: 968192
NOT VALID code: 4
NOT VALID code: 7
NOT VALID TYPE: 0
查一下 code 4,7 和 type 0..
uapi/linux/input-event-code.h:
/*
 * Event types
 */

#define EV_SYN          0x00
...
/*
 * Misc events
 */

#define MSC_SERIAL      0x00
#define MSC_PULSELED    0x01
#define MSC_GESTURE     0x02
#define MSC_RAW         0x03
#define MSC_SCAN        0x04
#define MSC_TIMESTAMP   0x05
#define MSC_MAX         0x07
#define MSC_CNT         (MSC_MAX+1)
所以 type 是 EV_SYN,
code 是 INPUT_EVENT_TIME_MSB/LSB
type 是 __s64

對照上面的 driver function : lis2dw12_report_3axes_event
* fixed -- gsensormonitor

2020/8/3

systemd-resolved 手動設定 dns server

現在都用這個了,加上nat 的主機,使用 dnsmasq,跟這個衝突,所以一堆 nat 後面的機器,dns 都指向nat,然後 nat 的 dns 又fail..
所以常常要手動設定。

寫一下systemd-resolved 怎麼手動設 dns server 好了。

ref: 使用 systemd-resolved 之後,原來的 /etc/resolv.conf 指向自己了..
而且是由 systemd-resolved 產生,所以改/etc/resolv.conf 沒用。

要改 systemd-resolved 的 config 檔: /etc/systemd/resolv.conf

安裝完的 /etc/systemd/resolv.conf ,內容是都 comment 掉的,
所以要修改就要把 comment 拿掉,加入自己的選項。
例如:用 1.1.1.1 做 dns:
[Resolved]
DNS=1.1.1.1

改完之後,重新啟動 systemd-resolved:
$ sudo service systemd-resolved restart

要看看現在的 dns server ip
systemd-resolve --status
ref: 這一篇有清處的說明。
就是要區分 interface。dnsmasq 的 dns 服務限制在 enp0xxx。
然後給 dnsmasq 獨立的 resolv.conf ,他會依照這個 resolv.conf 的內容(mirror) dns 服務給剛剛設定的interface。
原來的 systemd-resolved 就用原來的 127.0.0.53
這樣就不衝突。

2020/8/1

upgrade to win10 and the win10 donwload link

既然有,就試試看吧。
只是位址好像換了。
下載 Windows 10

MediaCreationTool2004

竟然成功了…



就是那台被一姊救回來的舊nb.
竟然可以upgrade 到 win10..
真的太感謝了

另外,聽老闆的話換ssd真的換對了。


安裝很快,不用半小時。
但是win10好像真的負載比較重,原來win7都用得好好的,win10卻風扇狂轉。

測試一下,鍵盤貼紙

家樂福買的79塊貼紙,還蠻不錯的,只有貼有注音的部分。
很奇怪,雖然貼了以後打字也沒看,但是沒貼的時後,打字都有一種不安全感...