2022年5月28日 星期六

刪除 youtube 稍後觀看清單

youtube 的稍後清單沒有一鍵刪除的選項,累積到了一定的時間看到清單上堆積的影片數量根本沒動力。

目前寫了一個腳本,但也沒辦法達到一鍵刪除,只是寫成自動化逐一去執行刪除,必須放置一段時間


1. 首先,開啟你的待播清單 (https://www.youtube.com/playlist?list=WL)

2. F12 開啟開發者模式

3. 在 Console 貼入以下 Code


const tasks = Array.from(Array(1000).keys());
const sleep = (task) =>
  new Promise((resolve) =>
    setTimeout(() => {
      resolve(task);
    }, 1000)
  );
const runAllTasks = async () => {
  for (task of tasks) {
    console.log(`Run ${task}`);
    await sleep(task);
    document.querySelectorAll("yt-icon-button .ytd-menu-renderer")[1].click();
    await sleep(task);
    document
      .querySelectorAll(".style-scope.ytd-menu-service-item-renderer")[8]
      .click();
  }
  console.log("Done");
};
runAllTasks();

2021年3月25日 星期四

[其他] 虛擬機異常

 


每次送修回來模擬器相關的工具就無法使用了

例如genymotion、virtualbox或android studio內建模擬器會出現error


查詢到大致上是 vt vt-x這項功能被關閉,這項功能有些機種可以透過新增移除程式那邊的功能進行開關,我遇到的狀況是需要透過BIOS UEFI去設定(我用的是聯想Y720)


Y720進入BIOS UEFI的方法:

https://support.lenovo.com/be/zh/solutions/ht500216

開機時狂點F2


Advanced分頁下的CPU Configuration

使用鍵盤移動到Intel Virtualization Technology 將其設定為Enabled


Exit & Save

大功告成


[windows] 快速訪問路徑

 %appdata%

[其他] 夏令時間

 夏令

台北時間 晚上9:30~3:30


冬令

台北時間 晚上10:30~5:00

美國東部時間 早上9:30~下午4:00

股價延遲20分鐘



2020年5月24日 星期日

[Docker] docker compose nginx template


自己常使用的 nginx 建構方式的筆記



version: "3.5"
services:
  web:
    image: nginx
    volumes:
      - ./ca:/ca
      - ./default.conf:/etc/nginx/conf.d/default.conf
    ports:
      - "80:80"
      - "443:443"
    networks:
      - default
networks:
  default:
    name: custom





[VPS] Oracle Cloud 設定開放的 Port

去年的十一月底,我在 Godaddy 買了一個 Domain 一直放到至今才想起有這件事情,也剛好近期有想架設的一些服務,才產生實作的動力。


原先的打算是,使用舊電腦灌成 ubuntu (其實去年 11 月底灌了...只是後來忙別的事情就放在角落生灰塵了),再搭配中華申請的固定 IP。

但近期看到 Oracle 提供了免費的 VPS ,抱著好奇的心態申請了帳號使用,整體的設定感覺比 Amazon 簡單許多。

Oracle Cloud ( https://www.oracle.com/tw/cloud/free/ )

申請的過程就不詳述了。

架好網站後,必須要去後台調整開放的 Port,否則預設外面是連不到的。

1. 開啟容器



[SSL] ZeroSSL 申請免費 Certificate 並設置 Nginx


ZeroSSL (https://zerossl.com/) 主要也是透過 let's encrypt (https://letsencrypt.org/) 去申請,因此也僅有90天的效期,會感覺特地用這個平台有點多餘,但整體介面較美觀,並且也比官方的流程好申請。