2019-11-28

關於export DISPLAY=:0.0

DISPLAY環境變量格式如下host:NumA.NumB,host指Xserver所在的主機主機名或者ip地址,圖形將顯示在這一機器上,可以是啟動了圖形界面的Linux/Unix機器,也可以是安裝了Exceed 、X-Deep/32等Windows平台運行的Xserver的Windows機器。

如果Host為空白,則表示Xserver運行於本機,並且圖形程序(Xclient)使用unix socket方式連接到Xserver,而不是TCP方式。使用unix socket方式連接時則表示連接的unix socket的路徑,如果為0,則表示連接到/tmp/.X11-unix/X0

如果Host非為空白, 使用TCP方式連接時,NumA為連接的端口減去6000的值,如果NumA為0,則表示連接到6000端口;
       NumA + 6000 = tcp port #

NumB則幾乎總是0。

---------------------------- 進階 ------------------------------------------------------------------------
如果使用su username或者su - username切換到別的用戶,並且使用命令
    export DISPLAY=:0.0
    設置DISPLAY環境變量,運行圖形程序(如xclock)時會收到如下錯誤:
    Xlib: connection to ":0.0"refused by server
    Xlib: No protocol specified
    Error: Can't open display: :0.0
    這是因為Xserver默認情況下不允許別的用戶的圖形程序的圖形顯示在當前屏幕上.如果需要別的用戶的圖形顯示在當前屏幕上,則應以當前登陸的用戶,也就是切換身份前的用戶執行如下命令
    xhost +
    這個命令將允許別的用戶啟動的圖形程序將圖形顯示在當前屏幕上.
 
    在2台Linux機器之間,如果設置服務器端配置文件/etc/ssh/sshd_config中包含:
    X11Forwarding no
    客戶端配置文件/etc/ssh/ssh_config包含:
    ForwardX11 yes
    則從客戶端ssh到服務器端后會自動設置DISPLAY環境變量,允許在服務器端執行的圖形程序將圖形顯示在客戶端上.在服務器上查看環境變量顯示如下(這個結果不同的時候並不相同)
    DISPLAY=localhost:10.0
    在客戶機上用netstat -lnp可以看到有程序監聽了6010端口
    tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 4827/1
    如果希望允許遠程機器上的圖形程序將圖形顯示在本地機器的Xserver上,除了要設置遠端機器的DISPLAY環境變量以外,還需要設置本地機器的Xserver監聽相應的TCP端口.而現在的Linux系統出於安全的考慮,默認情況下不再監聽TCP端口.可通過修改/etc/X11/xinit/xserverrc文件,將
    exec /usr/bin/X11/X -dpi 100 -nolistentcp
    修改為
    exec /usr/bin/ X11/X -dpi 100
    允許在直接使用startx啟動圖形時啟動對TCP端口的監聽.
    修改/etc/kde3/kdm/kdmrc,將
    ServerArgsLocal=-nolisten tcp
    修改為
    ServerArgsLocal=
    允許kdm作為顯示管理器時,啟動會話時監聽相應的TCP端口.
    修改/etc/gdm/gdm.conf,在[Security]一節增加
    DisallowTCP=false
    或者在登陸窗口選擇"Options" -> "Configure Login Manager..."的Security頁面,取消"DenyTCP connections to Xserver",允許gdm作為顯示管理器時,啟動會話時監聽相應的TCP端口.
--------------------------------------------------------------------------------------------------------
xhost

 xhost是用來控制X server訪問權限的。
  
    通常當你從hostA登陸到hostB上運行hostB上的應用程序時,
  
    做為應用程序來說,hostA是client,但是作為圖形來說,
  
    是在hostA上顯示的,需要使用hostA的Xserver,所以hostA是
  
    server.因此在登陸到hostB前,需要在hostA上運行xhost +
  
    來使其它用戶能夠訪問hostA的Xserver.
  
    xhost +是使所有用戶都能訪問Xserver.
  
    xhost + ip使ip上的用戶能夠訪問Xserver.
  
    xhost + nis:user@domain使domain上的nis用戶user能夠訪問
  
    xhost + inet:user@domain使domain上的inet用戶能夠訪

youtube 教學 : Open GUI apps on Windows Subsystem for Linux (and on Raspberry Pi)

2019-11-27

Debian Buster --- net-tools will be deprecated in favor of iproute2

Here is a summary of the net-tools commands, together with their iproute2 equivalent:
legacy net-tools commandsiproute2 replacement commands
arpip n (ip neighbor)
ifconfigip a (ip addr), ip link, ip -s (ip -stats)
iptunnelip tunnel
nameifip link
netstatss, ip route (for netstat -r), ip -s link (for netstat -i), ip maddr (for netstat -g)
routeip r (ip route)
from debian stretch (9 release note)

2019-11-20

LENOVO T410 with Debian Buster and XFCE

1. modify /etc/apt/sources.list : add contrib and non-free
2. install intel wifi driver : firmware-iwlwifi
3. Install nvidia driver : install/run nvidia-detect, install nvidia-legacy-340xx-driver
4. Whenever I lock my screen, it goes full black and does not respond either to moving the cursor or pressing keys from the keyboard.
After searching for a while, I found the solution in the Arch Wiki.
The solution is pretty simple. Just create a text file named 20-intel.conf in the /etc/X11/xorg.conf.d/ directory path (you may have to create directory xorg.conf.d if it does not exist) and paste the following in it:
Section "Device"
        Identifier "Nvidia Card"
        Driver "nvidia"
        VendorName "NVIDIA Corporation"
        BoardName "NVS 3100M"
EndSection
Now save the file and reboot your Debian Xfce system.
Screen black problem after locking the screen in Xfce should be solved by now.
5. How to enable my keyboard's volume keys in XFCE?

  1. Right click a panel -> Panel submenu -> Add New Items...
  2. Add an instance of PulseAudio Plugin
  3. Right click the icon that just appeared in your panel and click "Properties". Make sure "Enable keyboard shortcuts for volume control" is enabled.

You may have to install the PulseAudio Plugin first. In Debian and Debian-based distributions, the package is called xfce4-pulseaudio-plugin.

2019-10-31

LENOVO T410

After installing my Lenovo T410 to Windows 10, Windows 10 can not find the driver for the PCI Serial Port.
VEN_8086&DEV_3B67&SUBSYS_216217AA&REV_06\3&b1bfb68&0&B3

It need "Intel Management Engine Interface 6.2 and Serial Over LAN (SOL) Driver".

2019-10-07

如何啟動 "Acronis TrueImage PE and ISO" in UEFI mode with grub2

source from : [分享] Acronis TrueImage 2019, 2018, 2017, 2016 PE and ISO; Acronis Backup 11.7 PE

I was make new version Acronis True Image 2018, 2017, 2016 PE and ISO
You can boot in UEFI mode with grub2. Use this code in menu

menuentry "Acronis True Image Home 2018 ISO" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/ati18cn.iso"
search --set -f $isofile
loopback loop $isofile
linux (loop,msdos1)/dat10.dat lang=zh_CN quiet force_modules=usbhid
initrd (loop,msdos1)/dat11.dat (loop,msdos1)/dat12.dat
boot
}
menuentry "Acronis True Image Home 2018 ISO ElTorito" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/ati18cn.iso"
search --set -f $isofile
loopback loop $isofile
echo mount the El Torito floppy image
loopback ElTorito (loop)232+224000
#ls (ElTorito)/
linux (ElTorito)/dat10.dat lang=zh_CN quiet force_modules=usbhid
initrd (ElTorito)/dat11.dat (ElTorito)/dat12.dat
boot
}

menuentry "Acronis True Image Home 2017 ISO" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/ati17cn.iso"
search --set -f $isofile
loopback loop $isofile
linux (loop,msdos1)/dat10.dat lang=zh_CN quiet force_modules=usbhid
initrd (loop,msdos1)/dat11.dat (loop,msdos1)/dat12.dat
boot
}
menuentry "Acronis True Image Home 2017 ISO ElTorito" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/ati17cn.iso"
search --set -f $isofile
loopback loop $isofile
echo mount the El Torito floppy image
loopback ElTorito (loop)232+208000
#ls (ElTorito)/
linux (ElTorito)/dat10.dat lang=zh_CN quiet force_modules=usbhid
initrd (ElTorito)/dat11.dat (ElTorito)/dat12.dat
boot
}

menuentry "Acronis True Image Home 2016 ISO ElTorito" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/ati16.iso"
search --set -f $isofile
loopback loop $isofile
echo mount the El Torito floppy image
loopback ElTorito (loop)232+184000
#ls (ElTorito)/
linux (ElTorito)/dat10.dat lang=13 quiet force_modules=usbhid
initrd (ElTorito)/dat11.dat (ElTorito)/dat12.dat
boot
}

menuentry "Acronis True Image Home 2016 ISO" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/ati16.iso"
search --set -f $isofile
loopback loop $isofile
linux (loop,msdos1)/dat10.dat lang=13 quiet force_modules=usbhid
initrd (loop,msdos1)/dat11.dat (loop,msdos1)/dat12.dat
boot
}

menuentry "Acronis True Image Home 2016 - Extract ISO" {
linux /acronis/dat10.dat lang=13 vga=791 mbrcrcs=on quiet force_modules=usbhid
initrd /acronis/dat11.dat /acronis/dat12.dat
boot
}

menuentry "Acronis Disk Director Home 12 ISO ElTorito" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/add12.iso"
search --set -f $isofile
loopback loop $isofile
echo mount the El Torito floppy image
loopback ElTorito (loop)220+161792
#ls (ElTorito)/
linux (ElTorito)/dat5.dat quiet
initrd (ElTorito)/dat4.dat
boot
}

menuentry "Acronis Backup Advanced 11.7" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/abr11cn.iso"
search --set -f $isofile
loopback loop $isofile
loopback ElTorito (loop)228+368000
#ls (ElTorito)/
linux (ElTorito)/abr64ker.dat product=bootagent media_for_windows quiet
initrd (ElTorito)/abr64ram.dat (ElTorito)/dat8.dat
boot
}

menuentry "Acronis Snap Deploy 5 Standalone Utility" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/asd5s.iso"
search --set -f $isofile
loopback loop $isofile
echo mount the El Torito floppy image
loopback ElTorito (loop)208+154000
#ls (ElTorito)/
linux (ElTorito)/dat4.dat quiet
initrd (ElTorito)/dat5.dat
boot
}

menuentry "Acronis Snap Deploy 5 Master Image Creator" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/asd5m.iso"
search --set -f $isofile
loopback loop $isofile
echo mount the El Torito floppy image
loopback ElTorito (loop)208+146000
#ls (ElTorito)/
linux (ElTorito)/dat8.dat quiet
initrd (ElTorito)/dat9.dat
boot
}

menuentry "Acronis Snap Deploy 5 Agent" {
set quiet=1
set gfxpayload=1024x768x32,1024x768
set mbrcrcs=on
set isofile="/iso/asd5a.iso"
search --set -f $isofile
loopback loop $isofile
echo mount the El Torito floppy image
loopback ElTorito (loop)208+148000
#ls (ElTorito)/
linux (ElTorito)/dat16.dat quiet
initrd (ElTorito)/dat17.dat
boot
}

=======================================================================
Multi Language code (for version 2017)
- PE : Change value language=en to region code (zh_CN only need zh...)

- ISO: Use region code (can found when change region from acronis website)
Edit file BOOTIA32.XML, BOOTX64.XML;
Arguments=" lang=zh_CN; quiet"

BOOTWIZ.CFG
KERNEL dat10.dat lang=zh_CN force_modules=usbhid quiet

=======================================================================
Multi Language code (for version 2016) (thanks waterchu for ideas)
- PE
REG.exe Add HKLM\Software\Acronis /f /v "language" /T REG_DWORD /D "13"
...............DWORD.............
1-ENGLISH; 11-BRAZIL; 13-CHINESE; 14-CHINESET; 8-CZECH; 6-DUTCH; 27-ESPANA; 2-GERMAN; 25-INDIAN; 15-ITALIAN; 9-JAPAN; 3-KOREAN; 5-POLISH; 19-PORTUGUESE; 0-RUSSIAN; 12-SPANISH; 17-FRENCH

- ISO: Edit file BOOTIA32.XML, BOOTX64.XML;
Arguments=" lang=13; quiet"

BOOTWIZ.CFG
KERNEL dat10.dat lang=13 force_modules=usbhid quiet

If Extract ISO and boot with Grub4dos

title Acronis True Image 2016
find --set-root --ignore-floppies --ignore-cd /acronis/dat10.dat
kernel /acronis/dat10.dat lang=13 vga=791 mbrcrcs=on force_modules=usbhid quiet
initrd /acronis/dat11.dat /acronis/dat12.dat

If try with Recovery Manager (F11), only need extract folder Recovery Manager from original ISO
..........Grub2 (Boot with grub2 can use Recovery Manager)
menuentry "Acronis True Image Home 2016 - F11" {
linux /Recovery\ Manager/kernel64.dat lang=13 vga=791 mbrcrcs=on force_modules=usbhid quiet
initrd /Recovery\ Manager/ramdisk_merged64.dat /Recovery\ Manager/DAT12.DAT
boot
}
....................Grub4dos............
title Acronis True Image Home 2016 - F11
find --set-root --ignore-floppies --ignore-cd /Recovery\ Manager/kernel.dat
kernel /Recovery\ Manager/kernel64.dat lang=13 vga=791 mbrcrcs=on force_modules=usbhid quiet
initrd /Recovery\ Manager/ramdisk_merged64.dat /Recovery\ Manager/DAT12.DAT

========================== ?????????????????????? ==========================
For old acronis version, need replace new driver (Snapapi64.dll only for Acronis True Image 2015, Disk Director 2012x64 - delete old snapapi.dll, copy and rename snapapi64.dll to snapapi.dll)
http://pan.baidu.com/s/1kTD8Jnp

If you try use on real system, try to uninstall driver first. If 64bit, use Fltsrv64. Right Click on snapman_uninstall.inf, fltsrv_uninstall.inf and select Install. Also you can update snapman & Flisrv driver.
http://pan.baidu.com/s/1i3m80rN

First, Right Click on \Uninstall\fltsrv64\fltsrv_update.inf, update snapman & Flisrv driver.
Then, run CMD as administrator, run \ATIH2016_x64\acronis.cmd to install.

Finally, run \ATIH2016_x64\TrueImage.exe successfully.

感覺, 將 Acronis TrueImage 安裝在 Real System 會拖累系統效能, 而且麻煩. 似乎沒有破解的必要
我比較懶, 直接下載 Bootable iso 放到USB 救援工具, 再以 grub2/grub4dos 啟動
至於 bootable iso/PE 檔案產生的方法 : 使用網路上已經安裝並破解成功之後的 Acronis TrueImage, 執行 acronis->TrueImageHome->MediaBuilder.exe 便可取得

2019-10-04

HDD LOW LEVEL FORMAT TOOL 4.40 REPACK (& PORTABLE) BY ELCHUPACABRA

官方網站所提供的免費 LLF Tool, 有執行速度的限制 
==> Free for personal/home use (speed is capped at 180 GB per hour which is 50 MB/s)


1. download HDD LOW LEVEL FORMAT TOOL 4.40 REPACK (and PORTABLE) BY ELCHUPACABRA

2. cd "HDD LOW LEVEL FORMAT TOOL 4.40 REPACK (and PORTABLE) BY ELCHUPACABRA"

3. You will see the following files:
    "HDD Low Level Format Tool 4.40.exe" and 3 *.cmd batch files (can be ignored)

4. double click "HDD Low Level Format Tool 4.40.exe"
5. follow the steps shown below to generate "HDDLLFTool" directory and programs







6. "HDDLLFTool" contain the following files

Run "cmd" as administrator
tree HDDLLFTOOL /A /F

|   HDDLowLevelFormatPortable.exe <--- b="">用此檔案啟動 LLF
|
+---App
|   +---AppInfo
|   |   |   appicon.ico
|   |   |   appicon_128.png
|   |   |   appicon_16.png
|   |   |   appicon_32.png
|   |   |   appicon_75.png
|   |   |   appinfo.ini
|   |   |   EULA.txt
|   |   |
|   |   \---Launcher
|   |           Custom.nsh
|   |           HDDLowLevelFormatPortable.ini ( 名稱必須與 HDDLowLevelFormatPortable.exe 一致)
|   |
|   \---HDDLLF
|           HDDLLF.EXE
|
\---Data
    +---HDDLLF
    |       llftool.4.40.agreement
    |       llftool.license
    |
    \---settings
            HDDLowLevelFormatPortableSettings.ini

2019-10-02

winpe修改制作

指令及重要設定檔 (以 USBOX 4.0/Hiren's BootCD PE x64 為例)
以 7z.exe 打開 64pe.wim & tools.7z

- /boot/pe/64pe.wim/windows/system32/PECMD.exe
- /boot/pe/64pe.wim/windows/system32/PECMD.ini
- /tools/tools.7z/REGDOC.CMD
- /tools/tools.7z/TOOLS.ini
- .../windows/system32/startnet.cmd
- .../windows/system32/winpeshl.ini
- .../windows/system32/wpeinit.exe
- .../windows/system32/Win10PE.cfg ( for Hiren's BootCD PE x64 )

PECMD命令詳解 : part1, part2

2019-09-15

GImageX --- 修改 windows PE 檔 xxx.wim

感覺蠻好用的

Youtube 教學

官網

使用案例

wimlib:一個開源的類似imagex的處理wim神器,(由於imagex最新版識別不了wimboot和esd鏡像,早已經被微軟拋棄)沒有Dism的各種限制支持ESD直接導出為wimboot鏡像或常規壓縮的鏡像。

類似的軟件, 還有 wimtool, 但還是推薦使用 GImageX

2019-09-03

Windows OS 啟動程序

XP : MBR->PBR->ntldr->boot.ini->(ntoskrnl)

Vista/W7/W10 : MBR->PBR->bootmgr->/boot/BCD->winload.exe->(ntoskrnl)
Vista/W7/W10 : UEFI->PBR->bootmgfw.efi->/EFI/microsoft/boot/BCD->winload.efi->(ntoskrnl)

BCD 可透過 bcdedit.exe/EasyBCD/Bootice (建議)/WMI/Visual BCD Editor 修改設定


2019-08-01

關於“sfc /scanow命令無法修復”的問題

建議您使用以下命令嘗試對您的系統執行修復操作,然後查看效果。

按“Windows徽標鍵+X”,啟動“Windows PowerShell(管理員)”,依次輸入以下命令:

Dism /Online /Cleanup-Image /ScanHealth 

Dism /Online /Cleanup-Image /CheckHealth 

DISM /Online /Cleanup-image /RestoreHealth 

sfc /SCANNOW 


如何檢視「系統檔案檢查程式」程序的詳細資料

如需檢視 CBS.Log 檔案所含的詳細資料,您可使用 Findstr 命令將資訊複製至 Sfcdetails.txt 檔案,然後檢視 Sfcdetails.txt 中的詳細資料。 若要執行這項操作,請依照下列步驟執行:
  1. 如先前步驟 1 所述,請開啟提升權限的命令提示字元。
  2. 在命令提示字元輸入下列命令,然後按下 ENTER:
    findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt" 
    注意:Sfcdetails.txt 檔案包含每次「系統檔案檢查程式」工具在電腦上執行時的詳細資料。 該檔案包含「系統檔案檢查程式」工具未修復的檔案相關資訊。 確認日期與時間項目,以判斷上次執行「系統檔案檢查程式」工具時找到的問題檔案。
  3. 從您的桌面開啟 Sfcdetails.txt 檔案。
  4. Sfcdetails.txt 檔案會使用以下格式:
    Date/Time SFC detail
    下列範例記錄檔包含無法修復檔案的項目:
    2007-01-12 12:10:42, Info                  CSI    00000008 [SR] Cannot 
    repair member file [l:34{17}]"Accessibility.dll" of Accessibility, Version = 
    6.0.6000.16386, pA = PROCESSOR_ARCHITECTURE_MSIL (8), Culture neutral, 
    VersionScope neutral, PublicKeyToken = {l:8 b:b03f5f7f11d50a3a}, Type 
    neutral, TypeName neutral, PublicKey neutral in the store, file is missing
     


如何以手動方式用已知的良好檔案複本取代損毀的系統檔案

透過 Sfcdetails.txt 檔案的詳細資訊判斷損毀且無法修復的系統檔案後,請先找出損毀檔案的所在位置,接著以手動方式用已知的良好檔案複本取代損毀的系統檔案。 若要執行這項操作,請依照下列步驟執行:

注意:您可以從另一台執行相同 Windows 版本的電腦取得已知的良好檔案複本。 您可以在該電腦執行「系統檔案檢查程式」程序,以確定您想要複製的系統檔案為良好檔案。
  1. 取得損毀系統檔案的系統管理所有權。 若要執行這項操作,請在提升權限的命令提示字元中,複製並貼上 (或輸入) 下列命令,然後按下 ENTER:
    takeown /f Path_And_File_Name
    注意Path_And_File_Name 預留位置代表損毀檔案的路徑與檔案名稱。 例如,輸入 takeown /f C:\windows\system32\jscript.dll。 
    命令提示字元下,系統管理員權限的命令已成功
     
  2. 授予管理員損毀系統檔案的完整存取權。 若要執行這項操作,請複製並貼上 (或輸入) 下列命令,然後按下 ENTER:
    icacls Path_And_File_Name /GRANT ADMINISTRATORS:F
    注意Path_And_File_Name 預留位置代表損毀檔案的路徑與檔案名稱。 例如,輸入 icacls C:\windows\system32\jscript.dll /grant administrators:F
    以系統管理員權限的命令提示字元
     
  3. 用已知的良好檔案複本取代損毀的系統檔案。 若要執行這項操作,請複製並貼上 (或輸入) 下列命令,然後按下 ENTER:
    複製 Source_File Destination
    注意Source_File 預留位置代表您電腦上已知良好檔案的路徑及檔案名稱,而 Destination 預留位置代表損毀檔案的路徑及檔案名稱。 例如,輸入 copy E:\temp\jscript.dll C:\windows\system32\jscript.dll

2019-07-19

After Debian 10 Installation


Debian 10 Setup Instructions (post install)
By: Matthew_Moore
_____________________________________________________________________________
How to get grub2 to remember last choice?

Put the following in /etc/default/grub (command line: gedit admin:///etc/default/grub):

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

_____________________________________________________________________________
Enable Sudo

Enter root using SU command

apt-get install sudo

Navigate to sudoers file /etc/sudoers and add user to list

EXAMPLE:

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
matt    ALL=(ALL:ALL) ALL

______________________________________________________________________________

Enable 32bit Architecture:
(required for installing 32 bit packages such as Steam )

sudo dpkg --add-architecture i386

Refresh package index:

sudo apt-get update
______________________________________________________________________________

Find fastest mirrors. ( Optional )

install netselect-apt

sudo apt-get install netselect-apt

Run command:

netselect-apt

A list of mirrors ranked by speed will be places in your home directory
Copy this list to  /etc/apt/sources.list

Refresh package index:

sudo apt-get update
______________________________________________________________________________

Enable Contrib and Non-Free packages.

Open Synaptic Package manager, Select settings / repositories

select each item and at the bottom of the Window under "Sections"
Add contrib non-free. EXAMPLE:

| main contrib non-free |

Repeat for each item. When finished press OK and then refresh
the package index by pressing the Reload button in the top left
of synaptic package manager.
______________________________________________________________________________

Adding Backports Repository.

add the following to your /etc/apt/sources.list file.

deb http://ftp.us.debian.org/debian/ buster-backports main contrib non-free

run sudo apt-get udpate to refresh package index.

To install an application from the backport repository specify the repo using the following command.

sudo apt-get -t buster-backports install
_____________________________________________________________________________

Install non-free codecs and other media components. ( Optional )

NOTE: These must be installed seperatly to avoid errors / conflicts.

sudo apt-get install ffmpeg

sudo apt-get install ffmpeg:i386

sudo apt-get install ttf-mscorefonts-installer

sudo apt-get install libdvdcss2

sudo apt-get install libdvd-pkg

sudo dpkg-reconfigure libdvd-pkg

sudo apt-get install ffmpegthumbnailer

sudo apt-get install gstreamer1.0-plugins-bad

sudo apt-get install gstreamer1.0-plugins-ugly

sudo apt-get install gstreamer1.0-libav

sudo apt-get install tumbler-plugins-extra
______________________________________________________________________________

Install Linux Firmware and base packages:

sudo apt-get install gdebi firmware-linux firmware-linux-nonfree
______________________________________________________________________________

Install Microcode for Intel Proscessors. ( Optional )

sudo apt-get install intel-microcode
______________________________________________________________________________

Utility Applications:

sudo apt-get install file-roller rar unrar
______________________________________________________________________________

Fix QT Themeing on GTK based Desktops.

sudo apt-get install qt4-qtconfig

sudo apt-get install qt5-style-plugins

Open the QT 4 settings application, Under the Appearance tab
change the GUI Style to GTK +. You will be prompted to save
changes upon closing the application.

For QT 5 based applications run the following command to set the
environment variable.

Enter Root Environment using SU.

sudo echo "QT_QPA_PLATFORMTHEME=gtk2" >> /etc/environment

NOTE: Due to a bug involving a segmentation fault, this dose not work with QT 5.7.0, Upgrade to 5.7.1 or wait for the update to come from upstream.

Log out and back in, or reboot your machine for changes to take effect.
___________________________________________________________________________

Install Nvidia Drivers

sudo apt-get install nvidia-detect

Run command:

nvidia-detect

Install the recommended driver shown

Example:

sudo apt-get install linux-headers-$(uname -r) nvidia-legacy-340xx-driver

Create an Xorg configuration for your gpu

mkdir /etc/X11/xorg.conf.d

nano /etc/X11/xorg.conf.d/20-nvidia.conf

Now add below contents to the file and save

Section "Device"
Identifier "My GPU"
Driver "nvidia"
EndSection


Reboot...

__________________________________________________________________________

Install and enable "ALL" Wifi Functions for Broadcom WiFi.

The default non-free firmware only gives you basic functionality. To get the most out of your Brodcom WiFi chip, install the following firmware packages.

Install broadcom packages.

sudo apt-get install broadcom-sta-dkms broadcom-sta-common firmware-brcm80211

Reboot system for changes to take effect.
__________________________________________________________________________

Install Bluetooth packages for XFCE.

sudo apt-get install bluetooth blueman bluez bluez-firmware bluez-cups bluez-tools

Reboot system for changes to take effect.
__________________________________________________________________________

Enable Notifications for XFCE Mail-Watcher Extention. ( XCFE Only )

Run on click: thunderbird
Run on New Messages: notify-send "New mail" "You have new messages in your inbox" -i xfce-newmail
__________________________________________________________________________

To give yourself permissions so virtualbox can access Shared folders and USB devices  use this command,

sudo gpasswd -a $USER vboxusers
__________________________________________________________________________

Improve font rendering in Debian.

Show hidden files in file manager.

Create file /home/user/.fonts.conf
 
Copy and paste the following text into file





 
   rgb
 


 
   true
 


 
   hintslight
 


 
   true
 

 
   
      lcddefault
   
 


Reboot system for changes to take effect.
__________________________________________________________________________

Hide Partitions on Boot:  ( Optional )

Create a new file /etc/udev/rules.d/99-hide-partitions.rules and add one line per partition you want to hide like so:
( change "sda*" to match the partition you wish to hide )

KERNEL=="sda1",ENV{UDISKS_IGNORE}="1"
KERNEL=="sda2",ENV{UDISKS_IGNORE}="1"

You should be able to dynamically activate it as root:

  # udevadm trigger --verbose
_____________________________________________________________________________
_____________________________________________________________________________

Backup / Restore installed APT packages

# Backup your packages list to your home directory
# Get a packages list
dpkg --get-selections > ~/Package.list

# Copy list of repositories to your home directory
sudo cp /etc/apt/sources.list ~/sources.list

# Export repo keys to your home directory
sudo apt-key exportall > ~/Repo.keys

# Restore packages from your home directory
sudo apt-key add ~/Repo.keys
sudo cp ~/sources.list /etc/apt/sources.list
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install dselect
sudo apt-get install $(cat ~/Package.list | awk '{print $1}')

#NOTE: if SUDO is not configured, Simply use root terminal or SU.

#CRITICAL: Any packages installed using a .DEB file or other source not
included in your repositories/sources.list, must be removed from Package.list before restoring to avoid errors. These packages will need to be reinstalled manually.



2019-07-02

Arduino IDE 安裝後, 第一件事

修改某些設定檔參數, 讓介面看起來舒服一點

c:\Program Files\Arduino\lib\theme\theme.txt
console.error.color = #FFFF00 ( default : #EC3400 )
linestatus.font = SanSerif,plain,12 (default : 10)
linestatus.height = 24 (default : 24)

c:\Users\cliff\AppData\Arduino15\preference.txt
editor.font = consolas,plain,16 (default : Monspaced,plain,11)

2019-06-30

購買 0.96吋OLED顯示屏 白色/黃藍雙色 12864液晶屏模塊SPI/IIC接口

driver IC : SSD1306

產品可接受3線SPI, 4線SPI 以及IIC介面
默認為4線SPI, 可經由調整背面電阻來設定為其它介面.


接口說明

1.GND (電源地)
2.VCC (電源正 3.3V~5V
3.D0 (SPI接口時為SPI時鐘線, IIC接口時為IIC時鐘線)
4.D1 (SPI接口時為SPI數據線, IIC接口時為IIC數據線)
5.RES (OLED復位, 屏幕上電後, 需要做一次復位)
6.DC (SPI數據/命令選擇腳, IIC接口時用來設置為IIC地址)
7.CS (SPI片選,低電平有效, 如不想用必需接地)

重要提示:
OLED顯示屏為自發光, 沒有背光, 上電沒有程序, 是不會有任何反應,
要有正確的程序才會有顥示


2019-06-26

購買 2吋 SPI LCD 176*220 驅動=iLi9225 全彩65K +SPI(TF型 SD卡)+SPI FLASH

目前的認知:
1. 此版的 VCC 工作電壓為 3.3V, 不可施加 5V 電源, 否則有燒毀之虞
2. MCU (Arduino/nano) 3.3V 驅動能力通常不足, 需要額外單獨供應 3.3V 電源
3. 除 VCC 外的接腳是否可接受 Arduino (nano) 5V 位準, 尚未測試. 但應可與 Raspberry Pi (3.3V) 直接連接使用
有很多兼容 3.3V/5V 的類似產品可供選擇 (此次買錯了?...但賣家服務真的很好) ===============================================
Wiring (TFT with Raspberry Pi2)
TFTRpi/Opi
CS--Pin#24(SPI CE0)
RST--Pin#5(*)
DC--Pin#3(*)
SDA--Pin#19(SPI MOSI)
CLK--Pin#23(SPI SCLK)
GND--GND
LED--3.3V
Vcc--3.3V

還有 NC 腳旁邊的 LED 腳 要接 3.3V VCC =全亮
LED腳 空接= 無背光
LED腳 可接 PWM 控制 背光亮度
===============================================
PCB上的 SD(TF卡)(支援格式:FAT32 最大容量16GB ???)
此螢幕適用於 電壓=3.3V 的MCU 來驅動      2.5V 或 5V 都不適合 螢幕驅動IC是使用  ILI9225 驅動
若遇到5V的MCU, 例如: NANO開發板, 其3.3V驅動能力不足, 需額外供應 3.3V 電源

實驗記錄:
實際使用 : NANO開發板 上的 3.3V 驅動能力不足電壓會低於 3.1V
實際使用 :下載器 CP2102 模組內建 的3.3V 可以提供 足夠的驅動能力(100mA) OK電壓能維持 3.29V
實際使用 :WIFI模組 ESP32 內建1117-3.3 的3.3V 可以提供 足夠的驅動能力(100mA) OK電壓能維持 3.20V
另外:
用DCDC 供應 3.3V 外掛電源的時後 若  NANO開發板 要與 PC 聯接 (其傳輸線是MINI USB ) 插入後 5V腳位的電壓 會拉高到 3.65V 左右 (這個電壓 LCD 還能工作 電流消耗=250mA) 若過 4.5V LCD 就無法顯示 (螢幕會全白) 不過 通常這裡電壓會小於 4.5V (因為MINI USB傳輸線內阻很大 壓降很大)(實測約 3.6V左右)
(若有影響NANO與PC之間資料傳輸   可於資料下載時  先將LCD的外掛電源DCDC 輸出電壓=3.3V 與 NANO分開)
外掛DCDC=3.3V當總電源  將LCD與NANO的VCC  都用3.3V

=============================================================
右邊腳位:
1=VCC:電源3.3V輸入連到(MCU)(STM32)Arduino板的+5VDC或+3.3VDC引腳上 並將原本MCU+5V改成3.3V 系統
2~3=GND:接地連到(MCU)(STM32)Arduino板的GND引腳。
4~5=NC:空腳
6=LED:LED背光控制HI=ON  LOW=OFF 通過內部2K歐姆電阻 來控制 Q2 進行PWM控制
(耗電流PWM10%=25mA  PWM100%=80mA)
7=CLK :(SCK或SCLK或SCL)=(串行時脈)是同步主機產生的數據傳輸的時鐘脈衝 是SPI時脈輸入引腳
8=SDA :(DIN或MOSI)(主機輸出從機輸入)是SPI主機輸出從機輸入引腳用於將數據從MCU發送到TFT
9=A0 :(D/C或DC或RS) 是TFT SPI數據或命令的選腳
10=RST :(或RESET或RES) 是TFT重置腳LOW= 重置
11=CS :TFT_CS 是TFT 選擇腳

============================================================
左邊腳位: (單獨使用 左邊SPI時 需供應3.3V 電源  電源來自  右邊腳的 1=VCC :3.3V 系統  2~3=GND :GND引腳)
1=SD_CS :是選TF 記憶體
2=MOSI  :(DIN或SDA)(主出從入)是SPI主機輸出從機輸入引腳,用於將數據從MCU發送到SD卡
3=MISO :(DO或SDO)(主入從出)是SPI主機輸入從機輸出引腳,用於將數據從SD卡發送到MCU
4=SCL :(SCK或SCLK或CLK)=(串行時脈)是SPI時脈輸入引腳
5=F_CS :(SPI_FLASH的選擇或 FLASH_CS)是選擇 FLASH記憶體
實驗記事:
若 MCU 資源夠  或有2個 SPI 介面以上 (或是 有2顆 MCU 分別使用 不同的 SPI介面) 時  可以將 左 右的 信號 分開使用(此PCB 左邊跟右邊的 SPI信號線 是獨立拉出來應用的) 您買 這塊SPI 模組 可以 說是 物超所值 買到賺到 
若 MCU 資源不夠  只1個 SPI  介面的時候  時 可以將
左邊的 : 2=MOSI 跟  右邊的: 8=SDA 相並聯  
(是SPI主機輸出從機輸入引腳  用於  將數據從MCU發送到指定的 從機)
左邊的 : 4=SCL 跟  右邊的: 7=CLK   相並聯  
(是SPI同步主機產生的數據傳輸的時鐘脈衝  是SPI時脈輸入引腳)
可以省下  MCU 2隻SPI的  IO 腳 (也就是 1顆MCU控制 3個 SPI介面模組)

=============================================================
原本預留 SPI FLASH : 使用者 可以自行購買 記憶體來 擴充(IC 自己焊)
目前出貨 都會幫您焊好 16MB的S PI FLASH (空記憶體) (可以當字庫也可以 自行應用)

1=CS :(LOW有效)(強制上拉10K歐姆到VCC)
2=MOSI :(數據資料IO)(強制上拉10K歐姆到VCC)
3=WP :(防寫保護) (LOW有效) (已拉到VCC = 強制可以寫)
4=GND :(共地)
5=MISO :(數據資料IO)(強制上拉10K歐姆到VCC)
6=SCL :(CLK SPI 串列時脈)(跟SD TF卡 共用時脈   2者之間 串聯電阻500歐姆)
7=HOLD :(鎖定) (LOW有效) (已拉到VCC = 強制不鎖定)
8=VCC :(共用VCC=3.3V)

2019-02-12

Difference between NetBIOS and SMB

source : Difference between NetBIOS and SMB

1. Are both services necessary? If not, are there any benefits over running a single service?
Depending on your operating system and environmentboth services are not necessary.

SMB (Server Message Block)

Server Message Block, the modern dialect of which is known as Common Internet File System, operates as an application-layer network protocol mainly used for providing shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network. ...
The Server Message Block protocol can run on top of the Session (and lower) network layers in several ways:
  • directly over TCP, port 445
  • via the NetBIOS API, which in turn can run on several transports:
    • on UDP ports 137, 138 & TCP ports 137, 139 – see NetBIOS over TCP/IP
    • on several legacy protocols such as NBF (incorrectly referred to as NetBEUI).
On Windows, SMB can run directly over TCP/IP without the need for NetBIOS over TCP/IP. This will use, as you point out, port 445.
Generally speaking, on other systems, you'll find services and applications using port 139. This, basically speaking, means that SMB is running with NetBIOS over TCP/IP, where, stack-wise, SMB is on top of NetBIOS if you are to imagine it with the OSI model.
Here's a visualization from Richard Sharpe, from samba.org.
OSI model showing SMB and NetBIOS
Here's a slightly tweaked version to illustrate how you can imagine this on a Windows-based system.
OSI model with amazing drawing indicating the skip-over of NetBIOS

1.a If they are both necessary, are there any benefits?

The only "benefit" -- it's not really a benefit, as much as a requirement -- is that with SMB over NBT (NetBIOS over TCP/IP), you'll actually be able to communicate with a greater deal of implementations of SMB.

2. What information/service does netbios-ssn and microsoft-dsprovide?

*My quick guess is that while netbios-ssn simply provides the NetBIOS API, including NBT (NetBIOS over TCP/IP) via port 139. On the other hand, microsoft-ds provides the direct hostingof SMB via port 445.*
With Windows 2000 Microsoft felt that this can be improved. They added the port 445 for the same service. On port 445 SMB runs directly over TCP. The only difference is that the client skips the NetBIOS session (saves one round trip) then negotiates, authenticates, mounts etc.
Check the properties of your network card. Somewhere in the Advanced IP Settings is a checkbox "Enable NetBIOS over TCP". Activate it and your computer uses port 139. Deactivate the option and the system wants to use 445.
...
  • Port 139: SMB -> NetBIOS -> TCP
  • Port 445: SMB -> .... -> TCP

3. What is the relationship between SMB and NetBIOS; are they seperate, does one rely upon the other?

SMB does rely on NetBIOS for communication with devices that do not support direct hosting of SMB over TCP/IP.
NetBIOS is completely independent from SMB. It is an API that SMB, and other technologies can use, so NetBIOS has no dependency to SMB.

NetBIOS (Network Basic System)

... It provides services related to the session layer of the OSI model allowing applications on separate computers to communicate over a local area network. As strictly an API, NetBIOS is not a networking protocol. ...
... In modern networks, NetBIOS normally runs over TCP/IP via the NetBIOS over TCP/IP (NBT) protocol. This results in each computer in the network having both an IP address and a NetBIOS name corresponding to a (possibly different) host name. ...
As you can see, the relationship would be Application -> SMB -> NetBIOS -> (TCP/IP, others).