顯示具有 ubuntu 標籤的文章。 顯示所有文章
顯示具有 ubuntu 標籤的文章。 顯示所有文章

2025年9月24日 星期三

 ubuntu kernel 5.4 pop noise (躁音)

// 用 這條命令 可 暫時 關閉音效 省電模式, 但 重開機, 問題 仍在.

$ sudo echo 0 > /sys/module/snd_hda_intel/parameters/power_save

// 若要 永久關閉 音效的 省電模式,
在 /etc/modprobe.d/ 目錄中,新增加以下文件, 和其 內容

disable_snd_hda_intel_power_save.conf  

## audio_disable_powersave.conf
options snd_hda_intel power_save=0
## options snd_usb_audio power_save=0 , if you are usb audio

2024年10月1日 星期二

[ ] ubuntu 18.04  讓 vi 能看 gbk big5 編碼

執行 sudo vi /etc/vim/vimrc 
加入 以下 配置參數

let &termencoding=&encoding
set fileencodings=utf-8,gb18030,gbk,gb2312,big5

;;; 在 edit 時 ,  可以 指定 file 存檔時 的 編碼格式 .

:set fileencoding=utf8

;;; 在 edit 時 , 可以 以 以下 命令,得知 目前 的 fileencoding

: set fileencoding

;;; 在 edit 時, 可以 設定 行距  linespace , 不打 =xx ,可得 目前 設定值

:set linespace=15

2022年11月24日 星期四

解決 snap store 的 notepad++ Icon/menubar 太小的問題

How to make notepad++ Icon/menu bar more large.
### 先備份一次原始的 user.reg, 而且只要備份一次 .
#### Method 1: 方法一
$ cp ~/snap/notepad-plus-plus/common/.wine/user.reg \
~/snap/notepad-plus-plus/common/.wine/user.reg_org
$ winecfg     ### to graphics tab , adjust a desired dpi, <apply>, <ok>
$ cp ~/.wine/user.reg  ~/snap/notepad-plus-plus/common/.wine/



#### Method 2: 方法二
# edit  your  ~/snap/notepad-plus-plus/common/.wine/user.reg
# 在該兩個 section  有找到 LogPixels 則直接改值,沒找到,則需添加.
# 若值 0A8 表示168 dpi, 090 表示  144dpi, 060 表示 96 dpi

[Control Panel\\Desktop] 1662713654
"LogPixels"=dword:00000090

[Software\\Wine\\Fonts] 1669332241
"LogPixels"=dword:00000090





ubuntu 18.04,22.04 設置 hinet pppoe 連線的 script file

設置 hinet pppoe 連線的 script file

以下 紅色 Hinet 為連線名稱,使用者名,及密碼,請修正.
兩條虛線間,存成 hinet_pppoe.sh
然後 $ chmod +x hinet_pppoe.sh
$ ./hinet_pppoe.sh
-------
LINK_NAME="Hinet"

echo Build a internet pppoe to ${LINK_NAME}

nmcli connection delete ${LINK_NAME}

echo nmcli con edit type pppoe con-name ${LINK_NAME}
echo -e \
"set pppoe.username 1234567@hinet.net\n"\
"set pppoe.password xxxxxxx\n"\
"print pppoe\n"\
"save\n"\
"yes\n"\
"quit\n" | nmcli con edit type pppoe con-name ${LINK_NAME}

nmcli connection show
nmcli dev status

echo You can delete by command: $ nmcli connection delete ${LINK_NAME}

---------

2022年11月15日 星期二

lazarus freePascal install and cross compile, on Host 64bit linux ,and cross to build win32 program

 *** My host is  linux ubuntu 18.04 64bit, 
*** target is to build linux 64bit  , and cross build win32 program
* download and install 3 packages : fpc-src, fpc-laz and lazarus-project


fpc-src_3.2.2-210709_amd64.deb
fpc-laz_3.2.2-210709_amd64.deb
lazarus-project_2.2.4-0_amd64.deb


* install 
$ sudo dpkg -i fpc-src_3.2.2-210709_amd64.deb
$ sudo dpkg -i fpc-laz_3.2.2-210709_amd64.deb
$ sudo apt install ./lazarus-project_2.2.4-0_amd64.deb
* check if successful
$ apt-cache policy fpc-src fpc-laz lazarus-project
** not need if you want remove 
** $ apt remove fpc-src fpc-laz lazarus-project


* How to build win32 exe file from  linux 64bit host
[00.] copy /usr/share/fpcsrc/3.2.2 to your ~/fpcsrc/3.2.2
[01.] cd ~/fpcsrc/3.2.2
[02.] make clean all OS_TARGET=win32 CPU_TARGET=i386
[03.] sudo make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=/usr
[04.] sudo ln -sf /usr/lib/fpc/3.2.2/ppcross386 /usr/bin/ppcross386
[05.] launch lazarus ,open a hello project,
     project options -- compiler options -- config and target
Target OS(-T) Win32
Target Cpu(-P) i386
Target processor 386/486(-cp80386)
[06.] Run -- clean up and build 



*** below is for 64bit host , to gen linux 32bit code

---- gedit i386-linux-ld ---
#!/bin/bash
# name this file /usr/bin/i386-linux-ld
ld -A elf32-i386 $@
----^^ and save to disk

----make file i386-linux-as ---
#!/bin/bash
# name this file /usr/bin/i386-linux-as
as --32 $@
----^^

* copy above 2 bash file to /usr/bin/ , and let it as exe file
$ chmod +x i386-linux-as
$ chmod +x i386-linux-ld

01. cd ~/fpcsrc/3.2.2
02. make clean all OS_TARGET=linux CPU_TARGET=i386
03. sudo make crossinstall OS_TARGET=linux CPU_TARGET=i386 INSTALL_PREFIX=/usr

2021年10月31日 星期日

ibus 倉頡五 /拼音 候選字 翻頁問題.

平台: linux ubuntu 18.04
輸入法 : Ibus cangjie5
如果 在 候選區 找不到該字 ,不是 輸入法 的問題,
記得按 PageUp PageDown 翻頁 即可找到了.
 
不滿意 預設 候選字,可以用 alt-1 把它後移。

2021年5月20日 星期四

Ubuntu 18.04 : How to connect Hinet pppoe ADSL

$ nmcli  con edit  type pppoe  con-name my_hinet_adsl
## it will open  an interactive prompt .
  set pppoe.username  xxx@hinet.net
  set pppoe.password  password
  save 
  quit

2021年5月3日 星期一

Install newer version(PPA) geany & plugin for unbuntu 18.04LTS

### Install  newer version(PPA) geany & plugin  for  unbuntu 18.04LTS ###
sudo add-apt-repository ppa:geany-dev/ppa
sudo apt-get update
sudo apt-cache policy geany
sudo apt-get install geany
sudo apt-get install geany-plugins
apt-cache search geany

Installing Python 3.8 on Ubuntu 18.04 from Source

### Installing Python 3.8 on Ubuntu 18.04 from Source ###
$ sudo apt update
$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev

$ wget https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz
$ tar -xf Python-3.8.10.tgz
$ cd Python-3.8.10
$ ./configure --enable-optimizations
$ make -j cpu-core_number  ### use what your cpu core#
$ sudo make altinstall
$ python3.8 --version

2021年5月1日 星期六

ubuntu 如何用最新版本的 git

$git --version
$sudo  add-apt-repository ppa:git-core/ppa
$sudo  apt-get update
$sudo  apt-cache policy git
$sudo  apt-get install git
$sudo  apt-cache policy git
$git --version

車 和 東 , 兩個 不喜歡的 簡體字 寫法

  车 是 草書 形變, 很難 和 小孩 解釋 為什麼 長這樣(反正你就背), 反而 車 就 很形象. 东 是 草書 形變, 很難 和 小孩 解釋 為什麼 長這樣( 反正你就背), (古人觀察到 日出東方, 東 是 木頭 加 日 , 那個方向 是 東.