2020年3月4日 星期三

JavaScript 重點筆記

Tag 與位置


<html>
  <head>
    <script type="text/javascript">  // 放在 head 會比放在 body 先執行

    </script>
  </head>

  <body>
  </body>
</html>  


<html>
  <head>
  </head>
  <body>
    <script type="text/javascript">// 要取得 body 中元素,就放在 body 中

    </script>
  </body>

</html>

外部 JavaScript


HTML 檔:
<html>
  <head>
    <script src="demo.js" type="text/javascript">  // 副檔名是 .js

    </script>
  </head>

  <body>
  </body>
</html>

demo.js 檔:
alert ( " This is an alert box ! " )  // 不用寫 script Tag

輸出


document.write ( " Hello World ! " )
document.write ( " <h1> Hello World ! </h1>" )

註解

單行:// This is a comment.
多行:/*This is a comment. */


2020年2月19日 星期三

Grub 開機選單的操作

 將 Grub 開機選單安裝在指定設備上

在終端機鍵入
sudo update-grub
sudo grub-install /dev/sdx(sdx 代表 sda, sdb, ......)
完成

更改開機選單預設開機順序

開機選單看起來像這個樣子:

注意順序從0開始,由上往下編號,所以 Windows 7 編號是 4
在終端機鍵入
sudo gedit /etc/default/grub
更改下列這一行程式最後的數字,成為你要的編號
GRUB DEFAULT=0

最後在終端機鍵入
sudo update-grub
完成

不讓電腦上其他作業系統加入開機選單

sudo cp /etc/default/grub /etc/default/grub.bak
sudo sed -i '$a GRUB_DISABLE_OS_PROBER=true' /etc/default/grub
sudo update-grub

開機選單上中文亂碼

編輯 /boot/grub/grub.cfg,尋找 font,將 font 指向檔案 unicode.pf2
 編輯 /etc/default/grub.d/60_mint-theme.cfg,尋找 font,將 font 指向檔案 unicode.pf2

2020年2月15日 星期六

支援 P2P BitTorrent 協定的傳輸軟體 Transmission

設定

編輯/ 偏好設定

上傳速度限制,建議 40

 儲存位置、最大運作下載數

黑名單 http://list.iblocklist.com/?list=bt_level1

加快下載速度

找對資源

增加 trackers https://github.com/ngosang/trackerslist,使用 trackers_all.txt

2020年1月31日 星期五

boot-repair grub 修復工具

安裝 boot-repair

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

 
 

2020年1月5日 星期日

在 Ubuntu 環境中玩 Windows --- Wine 的安裝

1. 先為 64 位元電腦啟動 32 位元架構:
  • $ sudo dpkg --add-architecture i386
2. 添加 Wine 源碼庫:
  • $ wget -nc https://dl.winehq.org/wine-builds/winehq.key
  • $ sudo apt-key add winehq.key
  • Ubuntu 18.04 或 Linux Mint 19.x
    $ sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
    Ubunu 19.04
    $ sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ disco main'
  • $ sudo apt-get update
3.安裝穩定版或開發版
  • 穩定版
    $ sudo apt-get install --install-recommends winehq-stable
  • 開發版
    $ sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
    $ sudo apt-get install --install-recommends winehq-devel

2019年12月29日 星期日

Ubuntu 18.04 以上連結 Android 手機

Android 手機安裝 KDE Connect

Ubuntu 透過 gnome-shell-extention 或 Ubuntu 軟體安裝 GSConnect

手機和 Ubuntu 必須在同一個網段

2019年12月8日 星期日

rename 批次改檔名

  • sudo apt install rename
  • cd 到要批次改檔名的目錄
  • rename ' s / 要更改的字串 / 要改成什麼字串 / ' 要符合什麼規則
    如:rename 's/a/xxx' *a.jpg
  • 如果出現 bash: 未預期的字組「)」附近有語法錯誤,則加 \:
    rename  ' s / \ ) / _ / '  ???\)*