Categories
Mastering Development

Unable to import SimpleHTTPServer and BaseHTTPServer

I am trying to run a secure host. According to the information that I have found, SimpleHTTPConnection does not provide one, and I am trying to run a script to ensure this property: shhttps.py #!/usr/bin/env python import SimpleHTTPServer import BaseHTTPServer import ssl ## Variables you can modify bind_to_address = ‘localhost’ server_port = 8080 ssl_key_file = […]

Categories
Mastering Development

How to manage different config environments in nestjs

I’d like to have a few environments, let’s say development, production, test. These environments should be independent and use their own set of config parameters, e.g. for DB, SERVER_PORT, USER etc. They should not be in the code base, so I think they should be different .env files. That’s to say, I should be able […]

Categories
Mastering Development

How to exit a blocking call of recv() on a thread from a different thread?

I have a code which runs two threads, The first thread waits on the sender for data using recv() and then forwards the data to the receiver using send. The second thread waits on the receiver for data using recv() and then forwards the data to the sender using send. It is important that both […]

Categories
Bitcoin Cryptocurrency Mastering Development

Bitcoin core Rpc EOF?

I using regtest to test bitcoin core rpc in golang. package main import ( “fmt” “github.com/toorop/go-bitcoind” ) const ( SERVER_HOST = “127.0.0.1” SERVER_PORT = 18444 USER = “test” PASSWD = “1234” USESSL = false ) func main() { bc, err := bitcoind.New(SERVER_HOST, SERVER_PORT, USER, PASSWD, USESSL) if err != nil { fmt.Println(err) } result, err […]

Categories
Development

linker complaining about maybe uninitialized variable (fully optimized build options)

I was compiling some code that did previously compile (with the same options), and after some unrelated changes, the linker started finding a variable that may be uninitialized (I suspect those unrelated changes may interfere with gcc’s optimization algorithm and may trigger the bug). System: debian 11 (testing) linux 5.4.0-4-amd64 gcc 9.2.1 (Debian 9.2.1-29) as […]