Search This Blog

Tuesday, April 21, 2020

VScode and GIT setup

git config --global user.email "email@example.com"
git config --global user.name "name"

#Password prompt issue fix

git config --global credential.helper cache

git config --global credential.helper 'cache --timeout=360000'     // 100 hours 

Saturday, April 18, 2020

Debug bash in VScode and pass variables in launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "${file}",
"terminalKind": "external",
"args":"start"
}
]
}

Sunday, April 5, 2020

Run jupyter on ubuntu 18

dont do apt install jupyter

go with pip3 install jupyter 

pip3 install pandas if require pandas on jupyter notebook

Friday, February 7, 2020

Encrypt decrypt via public key

Generate keys
openssl genrsa -out key.pem
openssl rsa -in key.pem -out key.pub -pubout

# Encrypt and Decrypt a file (using public key to encrypt)
echo --pass-- > pass.txt
openssl rsautl -in pass.txt -out pass.enc -pubin -inkey key.pub -encrypt
openssl rsautl -in pass.enc -out pass.dec -inkey key.pem -decrypt
cat pass.dec

# Compress, Encrypt, Decyrpt, Uncompress a file (using password in pass.txt)
echo content > file.txt
gzip file.txt
openssl bf -in file.txt.gz -out file.enc -pass file:pass.txt -e
openssl bf -in file.enc -out file.dec.gz -pass file:pass.dec -d
gzip -d file.dec.gz
cat file.dec