Tuesday, March 22, 2022

Use MKVToolNix to edit audio track

 My son loves watching Naruto Shippuden. However, Netflix only has the first 10 seasons, while Hulu only accepts US IP (and payment). The resouce on the website are mostly Japanese audio or Chinese audio (with Chinese subtitle). The target is to get the English audio (with or without English subtitle).

1. Download and MKVToolNix install https://mkvtoolnix.download/downloads.html#macosx

2. Download Naruto Shippuden mp4 (with English audio) from

https://animedao.to/anime/naruto-shippuden-dubbed/

3. Extract mka audio file from the mp4 (using MKVToolNix)

4. Add the English Audio into the Japanese MKV (see the screenshot)

MKVToolNix conversion is pretty fast, however, it's hard to batch download Naruto Shippuden mp4 as it has some protection. The online play is annoying as it has inappropriate ads, also the video quality is not as good as the MKV (89M vs 200M)



Sunday, March 6, 2022

Windows 11 time issue

 I installed Windows 11 VM from Parallel Desktop, everything is OK but sometimes the time is not accurate, and it causes the scheduled tasks can't run at the specified time. My Mac is on Toronto timezone while the VM has to be on Beijing Timezone.

Parallel Desktop technically support suggests to disable time sync from PD (Time: Do not sync), but I still see the issue.

The workaround:

Update HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config

MinPollInterval and MinPollInterval.

I updated both to 8, (2 power of 8 = 256 seconds), and run "w32tm /config /update" to update.

(Windows Time service needs to auto start)

Now I can see the time is sync at 12:14:07,12:18:23,12:22:39...

NtpClient SpecialPollInterval setting doesn't work for me, maybe need some other flag settings to make it work.

https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/specialpollinterval-polling-interval-time-service-not-correct

https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/w32time-sync-specialpollinterval-ignored



Tuesday, February 22, 2022

JBoss EAP7.3 udemy note

 1. The linux command

netstat -an|more: list the active internet connections

nslookup ip/dn: convert ip to dn or dn to ip

2. JBoss server log:





Compile and Run C++ program on mac (m1)

 Compile and Run C++ program on mac (m1):

#include <iostream>

using namespace std;

int main() {
    cout << "Hello, World!" << endl;
    return 0;
}

g++ -o hello hello.cpp

./hello

Thursday, February 17, 2022

algorithms

 1. Find the common number between different int array.

2. Find the same String between different String array. How about if the arrays are super fast, say the duplicate name between US and Canada? two big files

3. Query a LOL player's statistics

4. Display photos

    Display photos with username/password

    Display photos with username/password (no hack/partly)


boolean/int

+-*/ ++ --

== != > < >= <=

&& ||

if/else

swtich(expression){

case c1:

..break;

default:

}

array

For loop

recursion

constructor

static

Math.sqrt(x*x+y*y)

calculate what day after 100 days

read file/write file

Swing


Monday, February 7, 2022

Enterprise OAuth2 and Open ID Connect note (Udemy)

 Enterprise OAuth2 and Open ID Connect

1. Federated user

a single user identity used by all the applications

2. SAML flow


3. What is OAuth2


4. Opaque token
     need verify access token with authorization server every time


5. JWT token
   
   The resource server can verify the signed JWT token by itself, with the public signer



6. Grant type - auth code

Auth code is on the front channal but it expires a few mins, access token is on the back channel

7. Grant type - Implicit

Return the access token from the front channel directly - could be stolen, deprecated

8. Grant type - Client credentials

    Pretty simple, no resource owner/browser agent.

9. Grant Type - ROPC

    Resource Owner Password Credential - deprecated, need the client application and the resource server are the same organization (client application is third party) as the password is exposed to the client application. For example, shutterfly cannot use this grant type.


10. OpenID