Skip to content

Instantly share code, notes, and snippets.

下載「未開放下載的 Microsoft Stream 影片」的方法

大多數公司上傳至 Microsoft Stream 的影片會因隱私權政策緣故,除了管理員外禁止下載以防止外流。若僅個人使用或純粹備存用途,可參考下述流程以進行影片備份。

  1. 先使用「管理者權限」開啟 PowerShell,安裝 Chocolatey 後,再透過 Chocolatey 快速安裝必要相依套件。

Chocolatey 官網:https://community.chocolatey.org/

  • 安裝 Chocolatey
@oneleo
oneleo / client.cmd
Last active January 5, 2021 02:03
One-click to Install File Server with disk for Windows
:: Run as administrator through CMD.exe
@echo off
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
netsh advfirewall firewall add rule name="Port 5222" dir=in action=allow protocol=TCP localport=5222 > NUL
netsh advfirewall firewall add rule name="Port 443" dir=in action=allow protocol=TCP localport=443 > NUL
choco install -y googlechrome chrome-remote-desktop-host google-drive-file-stream dontsleep.install > NUL
::"%ProgramFiles%\Google\Chrome\Application\chrome.exe" --new-window --incognito --app="https://remotedesktop.google.com/access"
"%ProgramFiles%\Google\Chrome\Application\chrome.exe" "https://remotedesktop.google.com/access"
"%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe" "https://remotedesktop.google.com/acce
@oneleo
oneleo / installgo_part1.cmd
Last active January 5, 2021 02:05
透過 Chocolatey 安裝 Go 環境
:: Run as administrator through CMD.exe
@echo off
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install -y git.install --params "/NoShellIntegration"
choco install -y vscode golang vscode-go googlechrome chrome-remote-desktop-host dontsleep.install winrar notepadplusplus.install
echo RAR registration data> "C:\Program Files\WinRAR\rarreg.key"
echo yaokai.org>> "C:\Program Files\WinRAR\rarreg.key"
echo Unlimited Company License>> "C:\Program Files\WinRAR\rarreg.key"
echo UID=75ced9c73b51fdd111d1>> "C:\Program Files\WinRAR\rarreg.key"
echo 641221225011d14d1c98ba62a152232016b11806608201f0e0460d>> "C:\Program Files\WinRAR\rarreg.key"
@oneleo
oneleo / golang_new.md
Last active September 25, 2020 09:08
Go 語言基礎課程修訂草稿

Go 語言入門班

課程說明

  • Go 語言(又稱 Golang)是 Google 推出新一代的強大語言,2019 年 3 月 Google 公佈了去年底統計的問卷結果,發現 65% 用 Go 來寫網站,39% 用來開發系統程式,41% 用來做 DevOps(多重選擇),可想而知 Go 語言可以拿來從底層寫到上層。高效能的 Goroutine(併發)表現優於 Parallelism(並行),語法上簡潔又簡單,這也就是為什麼我們要來嘗試 Go 語言。

  • 註:因學院學員的電腦不用被切換畫面,原來的 Homework 的時間可以改成:直接讓學員手把手跟著老師一起操作。

  • 原因:學員常在自由的 Homework 的時間跑去做別的事,使得前段上課凝聚的集中力較容易散掉

@oneleo
oneleo / InstallTensorflowKerasInUbuntu18.04.md
Last active March 13, 2019 10:52
Install Tensorflow/Keras in Ubuntu 18.04

在 Ubuntu 18 安裝 Tensorflow/Keras 開發環境

安裝 nVidia 顯示卡驅動程式

$ sudo apt-key adv --fetch-keys  http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
$ sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
$ sudo apt-get -y install nvidia-driver-415 htop git
@oneleo
oneleo / InstallTensorflowKerasInUbuntu18.04
Last active March 5, 2019 10:10
Install Tensorflow/Keras in Ubuntu 18.04
# 在 Ubuntu 18 安裝 Tensorflow/Keras 開發環境
## 安裝 nVidia 顯示卡驅動程式
```
$ sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
$ sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
$ sudo apt-get -y install nvidia-driver-415 htop git

橢圓曲線加密演算法 ECDSA 與 RFC6979 改進提案

橢圓曲線加密演算法(Elliptic Curve Digital Signature Algorithm,ECDSA)是比特幣、以太坊區塊鏈所使用的非對稱式金鑰加密技術,

可輕易讓貨幣持有者透過私鑰 Private Key(變數:d_A)對資訊進行簽章(Digital Signature),讓所有人使用 Public Key(變數:d, e, p, n, G, Q_A)來進行驗證(或是反向進行秘密傳遞)。

然而,早期的 ECDSA 演算法中,有一個僅產生一次性使用的臨時簽名變數 k(Ephemeral Key)

因不夠隨機,又或是忽略了其重要性(如每次收發訊息都使用相同的 k 值),導致駭客可透過反推方式求得 k 值,

詳解 HD Wallet、BIP-0032、BIP-0039、BIP-0043 及 BIP-0044

加密貨幣錢包(Cryptocurrency Wallet)

  1. 在加密貨幣的世界中,錢包並非儲存加密貨幣的地方。

  2. 反倒是錢包的主要功能是一個儲存私鑰(Private Key)的工具,私鑰是一串很長的英文字母、數字組成的字串(通常是 64 個 16 進制位元 = 256 Bits = 32 Bytes 所組成),而這條很長的字串讓您有權力把自己的加密貨幣傳送給別人。

  3. 錢包可在使用者產生交易(Transaction)時使用私鑰將交易簽章(Digital Signature),而簽章的目的除了確認使用者為貨幣擁有者外,還可確保在交易完成後不可否認(Non-Repudiation)此交易;而儲存加密貨幣的地方則是負責維護區塊鏈(Blockchain)的礦工節點內。

  4. 加密貨幣錢包形式多樣,分為離線的冷錢包(Cold Wallet)、在線的熱錢包(Hot Wallet)、印在紙上的紙錢包(Paper Wallet)… 等。無論何種形式的錢包,錢包的開發商均需要有一個共同遵循的規範(例如:私鑰為多少位元、如何依據一個亂數產生私鑰等)。

@oneleo
oneleo / Address.sol
Created December 19, 2018 03:29
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=true&gist=
pragma solidity >=0.4.24;
/**
* Utility library of inline functions on addresses
*/
library Address {
/**
* Returns whether the target address is a contract
* 回傳目標地址是否為合約
* @dev This function will return false if invoked during the constructor of a contract,
@oneleo
oneleo / Address.sol
Created December 16, 2018 15:58
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=true&gist=
pragma solidity >=0.4.24;
/**
* Utility library of inline functions on addresses
*/
library Address {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.