banditelol / public-notes

public notes as issue thread, inspired by simonwilson/public-notes
1 stars 0 forks source link

[Notes] Today I Learn #5

Open banditelol opened 1 year ago

banditelol commented 1 year ago

Docker

Published Port

I was actually confused when there are EXPOSE term in a Dockerfile and then I need to run docker run -p <PORT> because it seems redundant, I also found similar situation inside docker-compose.yaml and .devcontainer files. Then I actually read the docs on EXPOSE. And found this part:

image

Yup, it's just a contract or an annotation if you will. :)

banditelol commented 1 year ago

Jupyter

Google Colab Keep Running 2022

This is the script to make sure that colab run is not interrupted, but still will be limited based on my own colab tier limit.

function ConnectButton(){
    console.log("Connect pushed"); 
    document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click() 
}
const colab_keepup = setInterval(ConnectButton,60000);
banditelol commented 1 year ago

DBeaver

Extract Connection Details

As you may know, dbeaver store the password in the json file with encryption. And we can't get back the password from the GUI. But there's a way to get it back by using openssl. For example in OSX you can do this:

openssl aes-128-cbc -d \
  -K babb4a9f774ab853c96c2d653dfe544a \
  -iv 00000000000000000000000000000000 \
  -in credentials-config.json | \
  dd bs=1 skip=16 2>/dev/null

In case you're wondering, the key (-K) came from dbeaver codebase. For a more general solution (for updating the key) you can refer to Tatsh/dbeaver-creds