網頁

2021年2月18日 星期四

透過Adguard 阻擋Youtube APP廣告

Adguard 若僅透過瀏覽器使用 Youtube 觀看影片,它的阻擋廣告效果很好但在手機上直接透過 Youtube APP 觀看影片的效果有限。

現在 Adguard 有提供一個方式可有效阻擋廣告,在操作上也僅需要幾個步驟即可。

Android 或 iOS 使用 Youtube APP 操作上僅有兩個步驟:

  1. Open YouTube app and start the video you want to watch. (在 youtube APP 打開要看的影片)
  2. Tap on the Share button and select AdGuard for Android from the list of apps. (在分享按鈕那點一下分享給Adguard 即可) 

相關參考:


2021年2月6日 星期六

Apache SSL Cipher Suite

加密演算法也是資安的評量點。

設定的參考可以使用 moz://a SSL Configuration Generator 所建議的 Cipher Suite 設定。

設定值:

SSLProtocol -all +TLSv1.2 +TLSv1.3 //刪除所有的 protocol 並加入 TLSv1.2 , TLSv1.3

也可以這樣子寫

SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 // 使用所有的 protocol 不使用SSLv3 ,TLSv1,TLSv1.1

SSLProxyProtocol  (與 SSLCipherSuite 的設定相同)

SSLCipherSuite       ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 

SSLProxyCipherSuite       (與 SSLCipherSuite 的設定相同)

SSLUseStapling On    //加快 SSL certificate 驗証

其它設定

    # HTTP Strict Transport Security (mod_headers is required) (63072000 seconds)
    Header always set Strict-Transport-Security "max-age=63072000"

 

檢測 SSL Cipher 檢測工具

  • nmap : e.g. nmap --script ssl-enum-ciphers -p 443 Server_IP -P0 | find "EXP"
  • sslscan windows

 

參考資料:


2020年11月20日 星期五

youtube-dl

基本上也是因為新聞才注意到此工具。基本上類似這類的工具不少,透過一些線上平台的服務使用就有相同的功能,使用上只要在平台頁面內貼上要下載的網址就可以下載。有些安裝在電腦內的付費版本軟體則有額外再提供轉檔等功能 (如,MP4 轉 MP3)。但這些功能 youtube-dl 也都有提供,且它也不僅只有支援 youtube 平台,它所支援的影音平台眾多。

簡單的註記使用方式:

下載: 

youtube-dl webiste , windows UI Portable

 外掛(有轉檔需求才需要):

ffmpeg, ffmpeg windows (ffmpeg-N-99931-ge3081d6f4f-win64-gpl-shared-vulkan 39.2MB ,不是很明白不同版本的差異,我是找容量最小的版本使用)

設定方式(@ windows): 

將下載的檔案放到指定的位址。設定作業系統內的環境變數,Path 路徑指定到程式放的位置。

軟體更新:

youtube-dl -U

使用範例:

youtube-dl <url> (自動會取最佳畫質)
youtube-dl <url> -F (看看有那些格式可以下載)
youtube-dl <url> -f 22+140 (指定要的格式與聲音下載 ; 數字由 -F 所呈現的資訊決定)
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' <url> (直接讓程式決定自動下載最佳所指定的影片+聲音 ; Download best mp4 format available or any other best if no mp4 available)
youtube-dl -x --audio-format mp3 <url> (直接抓取 mp3)
youtube-dl -x --audio-format mp3 --embed-thumbnail --add-metadata <url> (轉檔成mp3並加入縮圖與影片資訊)
youtube-dl -f mp4 <playlist-url>  (下載整份影片清單)
youtube-dl <url1> <url2> <url3> (下載多個指定的影片)
youtube-dl -f best -a list.txt (按檔案內的清單下載)
youtube-dl -f best <url>
youtube-dl -f 'bestvideo+bestaudio/bestvideo+bestaudio' --merge-output-format mp4 <url>
youtube-dl -f 'bestvideo[ext=webm]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 <url>
youtube-dl -f 'bestvideo+bestaudio[ext=m4a]' --merge-output-format mp4 <url>

下載 facebook 不開放社團內影片 youtube-dl --username=your account email --password=yourpassword https://www.facebook.com/video_URL

111.02.18 不知為什麼採上以上方式會出現 This video is only avaliable for registered user. 但確認登入的帳密是有效的。後來改用 cookie 的方式來抓取

cookie 的方式:

1. export cookie txt files (e.g. firefox export cookie puglin),保留 facebook cookie 即可。

2. youtube-dl --cookies C:\Temp\cookie.txt <facebook video url>

ffmpeg 影片切割
ffmpeg -ss 00:00:30.0 -i input.mp4 -c copy -to 00:01:30.0 output.mp4 (起訖時間;訖的時間由起開始計算)

教學參考:

  1. How to Install Youtube-DL on Windows
  2. youtube-dl Format Selection 
  3. 用 youtube-dl 優雅下載 YouTube 影片 
  4. Youtube-dl濃縮教學筆記 
  5. shell - youtube-dl DASH視頻和音頻,無需人工干預即可獲得最高質量  
  6. 影音剪輯 / 使用 ffmpeg 分割影片 (指定開始及結束時間或固定時間長度分割)
  7. FFmpeg无损快速切割视频方法 
  8. 懶人剪影片法(使用終端機指令)

注意事項: 

  1. 下載Youtube音樂或影片合法嗎?
  2. MP3音樂檔案下載是否違法?
  3. [法律授權] 我可以在自己的網站上使用那支影片嗎? Youtube、Vimeo、Vine,Instgram
  4. 你以為的 YouTube 無版權音樂竟然侵權?讓創作者苦惱的著作權問題
  5. 鏈結youTube影片不構成侵害著作權 ?
  6. 盜版線上看,不下載不犯法? 
  7. 【法律白話文運動】線上的盜版影片違反著作權法,那我線上追劇有沒有違法? 


2020年10月11日 星期日

調整相片 exif 日期

Example:

exiftool "-DateTimeOriginal+=9:9:7 02:42:0" "D:\pics_1091009\1091009"
exiftool "-DateTimeOriginal+=9:9:7 02:42:0" "D:\pics_1091009\1091010"

說明:針對目錄 1091009 內的檔案,時間加上 9:9:7 (9 年 9 個月 7 天)以及 02:42:0 (2 個小時 42 分 0 秒)

軟體下載:

https://exiftool.org/

相關參考:

https://exiftool.org/#shift

https://jerome.anyday.com.tw/archives/143


2020年8月14日 星期五

Lotus Notes 快速設定

 將 C:\Users\account\AppData\Local\IBM\Notes\Data\* 內的檔案全數複製到新的主機內即可。

2020年7月17日 星期五

MySQL 多版本並存 @ Windows

同主機內多版本 MySQL並存安裝方式:

下載 MySQL instraller ,點選並執行它。安裝過程參考附圖。過程中要注意的事項如下:
  1. 由於是要同主機多版本並存使用,所以 installer 的第一個頁面要選擇 Cancel後,再點選 Add 按鈕 (圖二)。
  2. port 衝突的問題,記得預設 port 號要更改。
  3.  Authentication Method 更動,主要是考量到版本相容性而已。
附圖參考:



















相關參考:

2020年5月20日 星期三

LDAP 相關資料



LDAP Code example

https://www.exchangecore.com/blog/using-ldap-active-directory-authentication-php

https://github.com/anthony-b/simple-php-LDAP-Authentication/blob/master/ldap.php

https://www.php.net/manual/en/ref.ldap.php

https://icodding.blogspot.com/2015/10/php-php-ad-server.html?m=0

https://www.php.net/manual/en/function.ldap-get-option.php

PHP 7.1 added support for configuring the LDAP CA/Cert environment directly

ldap_set_option(NULL, LDAP_OPT_X_TLS_CERTFILE, "/path/file.crt");

ldap_set_option(NULL, LDAP_OPT_X_TLS_KEYFILE, "/path/file.key");

https://bojack.pixnet.net/blog/post/23832296-%E3%80%90%E7%A8%8B%E5%BC%8F%E3%80%91%E5%88%A9%E7%94%A8-php-%E6%90%9C%E5%B0%8B-ldap---ad-%E8%B3%87%E8%A8%8A

https://ithelp.ithome.com.tw/questions/10167400

https://shuohsuanli-bear.blogspot.com/2016/11/phpactive-directory.html


LDAP Intro.

https://segmentfault.com/a/1190000014683418

https://blog.tomy168.com/2019/07/centos76-openldap.html

https://blog.xuite.net/tolarku/blog/151029105-LDAP+%E5%9F%BA%E7%A4%8E%E8%AA%AA%E6%98%8E

https://itman.pixnet.net/blog/post/26817279

https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/77626/


LDAP Online Test Server

https://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/

https://www.youtube.com/watch?v=AEjGhzZpGlg


LDAP Tools

Apache Directory Studio.

phpLDAPadmin

LDAP Admin

More
The Difference Between Active Directory and LDAP