How to fix ERR_SSL_VERSION_OR_CIPHER_MISMATCH
I was setting up SSL for a domain using cloudflare along with nginx-acme and nginx-proxy but I got error ERR_SSL_VERSION_OR_CIPHER_MISMATCH when testing. Checking the container logs, everything looks alright. By using SSL Labs toolkit, it shows error “Failed to communicate with the secure server”:Looking it up, I found https://community.cloudflare.com/t/failed-to-communicate-with-the-secure-server/186871 which links to https://developers.cloudflare.com/ssl/troubleshooting/version-cipher-misma...
How to spin up your own PoA EVM chain?
We will set up 1 bootnode and 2 geth nodes in 3 different servers. They will form the network for the EVM chain. All the nodes will run in containers.My setupI created 3 droplets on digitalocean (CentOS; shared CPU; 1GB 1Core)install and start docker (with the compose plugin) in all dropletsStep 1: set up bootnode (droplet A)first create boot.keymkdir /root/devnet/ && docker run -d --rm -v /root:/root ethereum/client-go:alltools-latest bootnode --genkey=/root/devnet/boot.key then cr...
Filecoin/FVM: Study Notes
Study Stepsread https://docs.filecoin.io/about/basics/introduction/read The Filecoin Virtual Machine: Everything You Need to Knowread https://docs.filecoin.io/about/basics/filecoin-faq/read How Filecoin storage and retrieval workswatch Space Warp Summit 🛸 Understanding the FVM - Raul Kripalaniwatch Space Warp Summit 🛸 Programming on the FEVM - Zak AyeshHigh-levelFilecoin is built on top of the same software powering IPFS protocol but they are different networksFilecoin is different from IPF...
twitter: @0xb2p github: @bap2pecs
Recently, I heard many people saying how they used chatGPT to help them write code. So I decided to try it myself.
I decided to ask chatGPT to write a small helper function that has specific requirements.
A perfect example immediately came up to my mind. This is a util function I needed in the ETHSF hackathon. I assigned it to one of my teammates and it took a few back-and-forths commits to get it right. The time between the first and last commit is 4 hours.
So let’s assign the same task to chatGPT. My initial message to it:
/*
arr is an array of strings. examples:
[
'--syncmode=full',
'--datadir=<datadir>',
'--nodekey=<nodekey>',
'--port=<port>',
'--http',
'--http.addr=0.0.0.0',
'--http.port=<httpport>',
'--networkid=<networkid>',
'--mine',
'--miner.threads=1',
'--miner.gasprice=1',
'--unlock=<unlock>',
'--password=<password>',
'--allow-insecure-unlock'
]
[ '<httpport>:<httpport>', '<port>:<port>' ]
[ '<datadir>:<datadir>' ]
pairs is an object to specify how to do the replacement. example:
{
'<datadir>': '/path/to/datadir',
'<nodekey>': '/path/to/nodekey/file',
}
example return:
[ '<datadir>:<datadir>' ] => ['/path/to/datadir:/path/to/datadir']
should return a new array of strings that applies the replacements
*/
export function replaceStringArray(arr, pairs) {
}
please implement the `replaceStringArray` function based on the requirement above it
Then I got the response:

It also gave some test input and output to help me verify the correctness:

However, there is a bug and I pointed out:

chatGPT tried to fix it:

Unfortunately, chatGPT misunderstood the requirement. It’s worth noting that it’s my mistake that I didn’t specify clearly that it should “replace all” in the requirements. So I clarified it and this time it gave the right solution:

However, I noticed that it differs from my solution where replaceAll is used. But it uses regular expression. So I asked it:

chatGPT nicely explained its choice and helped me learn this new knowledge.
Then I asked it to optimize the code:

And chatGPT gave a few suggestions:

chatGPT is an effective tool for quickly finding solutions to coding problems, saving developers valuable time and effort.
However, if you don’t specify the requirements clearly, it might misunderstand and give solutions that have bugs in it.This also implies that you should know how to solve the coding question yourself and verify the solution carefully. It’s dangerous to blindly trust the solution given by it.
It’s also worth noting that if you find the bug and described it clearly to chatGPT, it can fix it.
It’s also interesting that if you have a different solution in mind, you can ask chatGPT why it’s not chosen. You might be surprised and learn something new.
You can also ask chatGPT to optimize the code. You can even repeat that for a few times until you feel the code is too hard to maintain.
Recently, I heard many people saying how they used chatGPT to help them write code. So I decided to try it myself.
I decided to ask chatGPT to write a small helper function that has specific requirements.
A perfect example immediately came up to my mind. This is a util function I needed in the ETHSF hackathon. I assigned it to one of my teammates and it took a few back-and-forths commits to get it right. The time between the first and last commit is 4 hours.
So let’s assign the same task to chatGPT. My initial message to it:
/*
arr is an array of strings. examples:
[
'--syncmode=full',
'--datadir=<datadir>',
'--nodekey=<nodekey>',
'--port=<port>',
'--http',
'--http.addr=0.0.0.0',
'--http.port=<httpport>',
'--networkid=<networkid>',
'--mine',
'--miner.threads=1',
'--miner.gasprice=1',
'--unlock=<unlock>',
'--password=<password>',
'--allow-insecure-unlock'
]
[ '<httpport>:<httpport>', '<port>:<port>' ]
[ '<datadir>:<datadir>' ]
pairs is an object to specify how to do the replacement. example:
{
'<datadir>': '/path/to/datadir',
'<nodekey>': '/path/to/nodekey/file',
}
example return:
[ '<datadir>:<datadir>' ] => ['/path/to/datadir:/path/to/datadir']
should return a new array of strings that applies the replacements
*/
export function replaceStringArray(arr, pairs) {
}
please implement the `replaceStringArray` function based on the requirement above it
Then I got the response:

It also gave some test input and output to help me verify the correctness:

However, there is a bug and I pointed out:

chatGPT tried to fix it:

Unfortunately, chatGPT misunderstood the requirement. It’s worth noting that it’s my mistake that I didn’t specify clearly that it should “replace all” in the requirements. So I clarified it and this time it gave the right solution:

However, I noticed that it differs from my solution where replaceAll is used. But it uses regular expression. So I asked it:

chatGPT nicely explained its choice and helped me learn this new knowledge.
Then I asked it to optimize the code:

And chatGPT gave a few suggestions:

chatGPT is an effective tool for quickly finding solutions to coding problems, saving developers valuable time and effort.
However, if you don’t specify the requirements clearly, it might misunderstand and give solutions that have bugs in it.This also implies that you should know how to solve the coding question yourself and verify the solution carefully. It’s dangerous to blindly trust the solution given by it.
It’s also worth noting that if you find the bug and described it clearly to chatGPT, it can fix it.
It’s also interesting that if you have a different solution in mind, you can ask chatGPT why it’s not chosen. You might be surprised and learn something new.
You can also ask chatGPT to optimize the code. You can even repeat that for a few times until you feel the code is too hard to maintain.
How to fix ERR_SSL_VERSION_OR_CIPHER_MISMATCH
I was setting up SSL for a domain using cloudflare along with nginx-acme and nginx-proxy but I got error ERR_SSL_VERSION_OR_CIPHER_MISMATCH when testing. Checking the container logs, everything looks alright. By using SSL Labs toolkit, it shows error “Failed to communicate with the secure server”:Looking it up, I found https://community.cloudflare.com/t/failed-to-communicate-with-the-secure-server/186871 which links to https://developers.cloudflare.com/ssl/troubleshooting/version-cipher-misma...
How to spin up your own PoA EVM chain?
We will set up 1 bootnode and 2 geth nodes in 3 different servers. They will form the network for the EVM chain. All the nodes will run in containers.My setupI created 3 droplets on digitalocean (CentOS; shared CPU; 1GB 1Core)install and start docker (with the compose plugin) in all dropletsStep 1: set up bootnode (droplet A)first create boot.keymkdir /root/devnet/ && docker run -d --rm -v /root:/root ethereum/client-go:alltools-latest bootnode --genkey=/root/devnet/boot.key then cr...
Filecoin/FVM: Study Notes
Study Stepsread https://docs.filecoin.io/about/basics/introduction/read The Filecoin Virtual Machine: Everything You Need to Knowread https://docs.filecoin.io/about/basics/filecoin-faq/read How Filecoin storage and retrieval workswatch Space Warp Summit 🛸 Understanding the FVM - Raul Kripalaniwatch Space Warp Summit 🛸 Programming on the FEVM - Zak AyeshHigh-levelFilecoin is built on top of the same software powering IPFS protocol but they are different networksFilecoin is different from IPF...
Share Dialog
Share Dialog
twitter: @0xb2p github: @bap2pecs

Subscribe to bap2pecs

Subscribe to bap2pecs
<100 subscribers
<100 subscribers
No activity yet