Unable to bind any endpoint for RPC server

I recently updated my bitcoin docker image to bitcoing v0.18.0 version and can’t allow external rpc connections to it now. It binds to localhost if I set rpcallowip=X.X.X.X, then I tried to used rpcbind parameter also, but couldn’t set my docker container to allow external rpc connetions.

This is what I get:

bitcoin_1       | 2019-05-23T13:39:34Z Bitcoin Core version v0.18.0 (release build) bitcoin_1       | 2019-05-23T13:39:34Z Assuming ancestors of block 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee have valid signatures. bitcoin_1       | 2019-05-23T13:39:34Z Setting nMinimumChainWork=0000000000000000000000000000000000000000051dc8b82f450202ecb3d471 bitcoin_1       | 2019-05-23T13:39:34Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation bitcoin_1       | 2019-05-23T13:39:34Z Using RdSeed as additional entropy source bitcoin_1       | 2019-05-23T13:39:34Z Using RdRand as an additional entropy source bitcoin_1       | 2019-05-23T13:39:34Z Default data directory /root/.bitcoin bitcoin_1       | 2019-05-23T13:39:34Z Using data directory /home/BTC bitcoin_1       | 2019-05-23T13:39:34Z Config file: /home/BTC/bitcoin.conf bitcoin_1       | 2019-05-23T13:39:34Z Using at most 125 automatic connections (1048576 file descriptors available) bitcoin_1       | 2019-05-23T13:39:34Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements bitcoin_1       | 2019-05-23T13:39:34Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements bitcoin_1       | 2019-05-23T13:39:34Z Using 0 threads for script verification bitcoin_1       | 2019-05-23T13:39:34Z Binding RPC on address X.X.X.X port XXXX failed. bitcoin_1       | 2019-05-23T13:39:34Z Unable to bind any endpoint for RPC server bitcoin_1       | 2019-05-23T13:39:34Z Error: Unable to start HTTP server. See debug log for details. bitcoin_1       | Error: Unable to start HTTP server. See debug log for details. bitcoin_1       | 2019-05-23T13:39:34Z Shutdown: In progress... bitcoin_1       | 2019-05-23T13:39:34Z scheduler thread start bitcoin_1       | 2019-05-23T13:39:34Z scheduler thread interrupt bitcoin_1       | 2019-05-23T13:39:34Z Shutdown: done 

My bitcoin.conf file looks like this:

server=1 rpcbind=X.X.X.X rpcallowip=0.0.0.0/0 rpcport=XXXX port=XXXX rpcuser=user rpcpassword=password 

SQL (ODBC) bind to C++ classes

I created it to map buffers returned by ODBC driver to my objects. It works quite nice but, I have some questions marked (A), (B), (C), (D).

You can ignore parts related to ODBC

using namespace std; // for SO // for variant visitor template<class... Ts> struct Visitor : Ts... { using Ts::operator()...; }; template<class... Ts> Visitor(Ts...)->Visitor<Ts...>;  //----- template <typename T, typename V> class COdbcBinder { private:     using pll = tuple<long T::*, SQLLEN T::*, long V::*>;                   //sizeof(pll); // 12     using pcs = tuple<void* T::*, SQLLEN T::*, string V::*, size_t>;        //sizeof(pcs); // 16     using pts = tuple<SQL_TIMESTAMP_STRUCT T::*, SQLLEN T::*, string V::*>; //sizeof(pts); // 12     using mapvar = variant<pll, pcs, pts>; //sizeof(mapvar); // 20 ???  // (A) it should 16 (MSVC v141)      static constexpr char ROW_ARRAY_SIZE = 100;     SQLUSMALLINT N = 0;     HSTMT stmt = SQL_NULL_HSTMT;     TechnicalServices::Db::COdbc* m_odbc;      // (E) smart pointer as class member. Should I manually reset it in destructor?     unique_ptr<array<T, ROW_ARRAY_SIZE>> in;      vector<mapvar> mappings;  public:     COdbcBinder(TechnicalServices::Db::COdbc* odbc) : m_odbc(odbc)     {         SQLRETURN rc = SQLAllocHandle(SQL_HANDLE_STMT, m_odbc->GetHdbc(), &stmt); assert(rc == 0);          in = make_unique<array<T, ROW_ARRAY_SIZE>>();     }     ~COdbcBinder()     {         if (stmt != SQL_NULL_HSTMT)         {             SQLRETURN rc = SQL_ERROR;              rc = SQLCloseCursor(stmt); assert(rc == 0);             rc = SQLFreeHandle(SQL_HANDLE_STMT, stmt); assert(rc == 0);         }     }      template <typename CharArr>     inline void BindCol(CharArr T::* ptrin, SQLLEN T::* ptrinLen, string V::* ptrout)     {         static_assert(sizeof(void*) == sizeof(char(T::*)[20]), "Pointer to data member T must be sizeof(void*)");          // (B) is there any way to store pointer to array member of  different size in one vector without this?         mappings.emplace_back(mapvar(make_tuple(reinterpret_cast<void* T::*>(ptrin), ptrinLen, ptrout, extent<CharArr>::value)));          SQLRETURN rc = SQLBindCol(stmt, ++N, SQL_C_CHAR, &((*in)[0].*ptrin), sizeof((*in)[0].*ptrin), &((*in)[0].*ptrinLen));         assert(rc == 0);     }     template<>     inline void BindCol(SQL_TIMESTAMP_STRUCT T::* ptrin, SQLLEN T::* ptrinLen, string V::* ptrout)     {         mappings.emplace_back(mapvar(make_tuple(ptrin, ptrinLen, ptrout)));          SQLRETURN rc = SQLBindCol(stmt, ++N, SQL_C_TIMESTAMP, &((*in)[0].*ptrin), sizeof((*in)[0].*ptrin), &((*in)[0].*ptrinLen));         assert(rc == 0);     }     inline void BindCol(long T::* ptrin, SQLLEN T::* ptrinLen, long V::* ptrout)     {         mappings.emplace_back(mapvar(make_tuple(ptrin, ptrinLen, ptrout)));          SQLRETURN rc = SQLBindCol(stmt, ++N, SQL_C_LONG, &((*in)[0].*ptrin), sizeof((*in)[0].*ptrin), &((*in)[0].*ptrinLen));         assert(rc == 0);     }      vector<V> GetResult(const char* sql)     {         SQLUINTEGER numRowsFetched;         SQLUSMALLINT rowStatusArray[ROW_ARRAY_SIZE];         SQLRETURN rc = SQL_ERROR;          rc = SQLSetStmtAttr(stmt, SQL_ROWSET_SIZE, (SQLPOINTER)ROW_ARRAY_SIZE, 0); assert(rc == 0);         rc = SQLSetStmtAttr(stmt, SQL_BIND_TYPE, (SQLPOINTER)sizeof(T), 0); assert(rc == 0);          rc = SQLExecDirect(stmt, (SQLCHAR*)sql, SQL_NTS); assert(rc == 0);         m_odbc->LogLastError(stmt);          vector<V> results;          while ((rc = SQLExtendedFetch(stmt, SQL_FETCH_NEXT, 0, &numRowsFetched, rowStatusArray)) != SQL_NO_DATA)         {             assert(rc == 0);             m_odbc->LogLastError(stmt);              for (SQLUINTEGER i = 0; i < numRowsFetched; ++i)             {                 if (rowStatusArray[i] == SQL_ROW_SUCCESS || rowStatusArray[i] == SQL_ROW_SUCCESS_WITH_INFO)                 {                     V value;                     const T& info = (*in)[i];                     // (C) visitor recreated for each row.                     const auto visitor = Visitor{                         [&](const pll& tup)                         {                             const auto [ptrin, ptrinLen, ptrout] = tup;                             value.*ptrout = info.*ptrin;                         },                         [&](const pcs& tup)                         {                             const auto [ptrin, ptrinLen, ptrout, size] = tup;                             // (D) why this cast errors in (B)                             auto p = reinterpret_cast<char(T::*)[]>(ptrin);                             value.*ptrout = BinderHelpers::EmptyIfNull(info.*p, size, info.*ptrinLen);                         },                         [&](const pts& tup)                         {                             const auto [ptrin, ptrinLen, ptrout] = tup;                             value.*ptrout = BinderHelpers::TimestampToString(info.*ptrin, info.*ptrinLen);                         }                     };                      for (const auto& v : mappings)                     {                         std::visit(visitor, v);                     }                      results.push_back(std::move(value));                 }             }         }          return results;     }     private:         COdbcBinder(const COdbcBinder&) = delete; // copy ctr         COdbcBinder(COdbcBinder&&) noexcept = delete; // move ctr         COdbcBinder& operator=(const COdbcBinder&) = delete; // copy asign         COdbcBinder& operator=(COdbcBinder&&) noexcept = delete; // move asign }; 

Usage:

struct INCIDENT_INFO {     long id;     long idLength;     char comments[1024];     long commentsLength;     /* ... */     SQL_TIMESTAMP_STRUCT timeSendToService;     long timeSendToServiceLength; };  class Incident {     long id;     string comments;     /* ... */     string timeSendToService; };  int main() {     /* initialize connection into m_odbc */     COdbcBinder<INCIDENT_INFO, Incident> binder(m_odbc);      binder.BindCol(&INCIDENT_INFO::id, &INCIDENT_INFO::idLength, &Incident::id); // ID - 0     binder.BindCol(&INCIDENT_INFO::comments, &INCIDENT_INFO::commentsLength, &Incident::comments); // COMMENTS - 1     /* .... */     binder.BindCol(&INCIDENT_INFO::timeSendToService, &INCIDENT_INFO::timeSendToServiceLength, &Incident::timeSendToService); // TIME_SEND_TO_SERVICE - 31      vector<Incident> v = binder.GetResult("select ID, COMMENTS, " /* .... */ "TIME_SEND_TO_SERVICE from INCIDENTS"); } 

debian stretch + bind 9

trying to setup a secondary authoritative name server, no recursions. I get the following when running named-checkconf.

  /etc/default# named-checkconf /etc/bind/named.conf 

/etc/bind/named.conf.default-zones:2: unknown option ‘zone’ /etc/bind/named.conf.default-zones:10: unknown option ‘zone’ /etc/bind/named.conf.default-zones:15: unknown option ‘zone’ /etc/bind/named.conf.default-zones:20: unknown option ‘zone’ /etc/bind/named.conf.default-zones:25: unknown option ‘zone’

it is the default named.conf.default-zones files from the installation. I wonder if I even need that ‘include’ as there isn’t any recursion and just an authoritative name server .

Is there generally enough time to Planar Bind a creature conjured by a spell regardless of that spell’s duration?

While answering this question about Planar Binding (PHB 265) my first intuition was to answer the question with the last sentence clause as Ben Sutton did in their answer, but I thought that the wording is unclear and that Jeremy Crawford’s tweet says how he would rule it as DM; it doesn’t show whether this position is supported by any rules or by design intent.

Giant Insect (PHB 245) merely transmutes creatures for a duration of 10 minutes. The transmuted creatures are also not of the correct type which is a celestial, an elemental, a fey, or a fiend.

All spells that summon creatures have a Duration (PHB 203) of up to an hour:

  • Conjure Animals (PHB 225): / 1 action / 1 hour.

    Conjure Celestial (PHB 225): 1 minute / 1 hour.

    Conjure Elemental (PHB 225): 1 minute / 1 hour.

    Conjure Fey (PHB 226): 1 minute / 1 hour.

    Conjure Minor Elemental (PHB 226): 1 minute / 1 hour.

    Conjure Woodland Beings (PHB 226): 1 action / 1 hour.

    Infernal Calling (XGtE 158): 1 minute / 1 hour.

    Summon Greater Demon (XGtE 166): 1 action / 1 hour.

    Summon Lesser Demons (XGtE 167): 1 action / 1 hour.

This duration of up to an hour seems to be by design, and Planar Binding works regardless of the last sentence due to the durations rules as explained here.

But what if I allowed a homebrew spell such as SeriousBri’s Magnificent Summoning: 1 action / 1 minute.

This spell has a duration of 1 minute that is far less than an hour, would Planar Binding count the “another spell” in this case as SeriousBri’s Magnificent Summoning, thus extending its duration to match the duration of Planar Binding?

At the completion of the casting, the target must make a Charisma saving throw. On a failed save, it is bound to serve you for the duration. If the creature was summoned or created by another spell, that spell’s duration is extended to match the duration of this spell.

So is there generally enough time to Planar Bind a creature conjured by a spell regardless of that spell’s duration?

Is there enough time to Planar Bind a creature conjured by a one hour duration spell?

Many planar entity conjuration spells, such as Conjure Woodland Beings, last up to exactly an hour, at which point the creature vanishes :

A summoned creature disappear when it drops to 0 hit points or when the spell ends.

The Planar Binding spell normally takes exactly an hour to cast, but lasts a long time (24 hours by default, more if you upcast it) :

With this spell, you attempt to bind a celestial, an elemental, a fey, or a fiend to your service. The creature must be within range for the entire casting of the spell. At the completion of the casting, the target must make a Charisma saving throw. On a failed save, it is bound to serve you for the duration. If the creature was summoned or created by another spell, that spell’s duration is extended to match the duration of this spell.

Imagine the following scenario : Bob the Druid Readies a Conjure Woodland Beings for when Dylan the Wizard says “go”. Dylan the Wizard says “go”, and so, one or more DM-determined fey creatures appear as a result of the released Conjure Woodland Beings (let’s say two quicklings), and right after saying “go”, Dylan starts casting Planar Binding on one of the feys (here, a quickling). Both spells were cast at almost the same time (same turn), and both last an hour. What I wonder here is whether Dylan will have enough time to Bind the creature before it vanishes, or whether he’ll be “one second short”.

Is there enough time to Planar Bind a creature conjured by a one hour duration spell ? (discarding techniques to reduce Planar Binding’s casting time, such as Wishing it, and techniques to extend the base duration of the Conjuration spell, such as the Extended Metamagic option)

mount –bind /dev sometimes “kills” tty until unmounted

I have a script that uses sudo mount --bind /dev other/dev and then later uses sudo umount other/dev to unmount. After some random number of runs, we can somehow enter an odd state where the main tty stops existing, and the whole desktop environment starts malfunctioning (new applications won’t start, or they crash, and firefox can’t redraw pages and they freeze, etc…) and tty in my terminal says not a tty, and the terminal fails to open new instances. I’m not using ssh or any other remote functions, so the loss of the tty for my local terminal is absurd.

The only way to fix it is to reboot or to enter a different tty with CTRL+ALT+F1 or similar, log in, and force other/dev to unmount (normal asking says it is busy). After this the tty is magically revived and everything works again. I’m only actually mounting dev to get another /dev/null, so an easier workaround probably exists for me, but this is still very strange!

Is there some explanation for this odd behavior? I’m on 18.04.2 LTS.

Bind App on integrated Graphics so I dont need to restart it if disconnecting eGPU

I use a MBPro 13inch (Mojave) 2018 with an AMD RX 580. If you want to disconnect from it, MacOS needs to restart certain Apps, some of them dont benefit from additional GPU-Power (Intellij, IRC-Client), and on some it is just annoying to restart them every time I unplug the GPU (Firefox).

I am not familar with the GPU-Stack on MacOS, but is it somehow possible to bind Apps to the integrated GPU only, so they “survive” unplugging?

Problem with ~\.bashrc – Have to run `bind -x ‘”\C-l”: clear’` each time I start Terminal

I recently made some edits to my ~\.bashrc file in my Ubuntu 18.03 VM. Apparently I messed them up somehow because now whenever I start Terminal pressing Control + L to clear the screen does not work. I found a workaround by using this command: bind -x '"\C-l": clear'

However, obviously I’d like to fix the underlying cause of the issue instead of just issuing a command as a symptomatic fix every time. How could I do that? For security reasons I cannot post the full output of my ~\.bashrc file but I will post any specific parts requested.

Alternatively I can simply restore my .bak version of ~.\bashrc, but for my own edification I would really like to know where I went wrong with this.

Running into an java.net.BindException: Address already in use (Bind failed) on server- client socket app

I am a very beginner Java dev (dev wannabe to be precise) and, I am trying to learn about Java sockets using a Youtube tutorial as a reference. My code seems to match everything in the video (except variables names) but, when trying to run the server and then the client sockets, I get a :

Exception in thread "main" java.net.BindException: Address already in use (Bind failed) 

I have tried even printing out the local port just to make sure I connect to the right available port but, nothing works. Is there any documentation I can look into to solve this problem? or any guidance?

This is my code this far:

Server.java

public class serverSocket {  public static void main(String args[]) throws IOException{    String message, serverResponse;    ServerSocket serverSocket =  new ServerSocket(56789);   System.out.print(serverSocket.getLocalPort());   Socket acceptClientRequestSocket = serverSocket.accept();   Scanner serverScanner = new Scanner(acceptClientRequestSocket.getInputStream());   message = serverScanner.next();    System.out.println(message);   serverResponse = message.toUpperCase();    PrintStream newMessage = new PrintStream(acceptClientRequestSocket.getOutputStream());   newMessage.println(serverResponse);       } } 

Client.java

public class clientSocket {

public static void main(String args[]) throws UnknownHostException, IOException {      String message,outputMessage;     Scanner clientInput =  new Scanner(System.in);     Socket clientSocket = new Socket("localhost",56789);     Scanner incomingStream = new Scanner(clientSocket.getInputStream());     System.out.println("Enter a message");     message = clientInput.next();     PrintStream printClientStream=  new PrintStream(clientSocket.getOutputStream());     printClientStream.println(message);     outputMessage = incomingStream.next();     System.out.println(outputMessage);  } } 

Thanks a lot!

How to bind product image to email in Magento2.2.5?

I have created custom module in which I need to bind product image to email template in Magento2.2.5?

My code:

$  requestData["imgUrl"] = $  data["shareProdImg"];               $  postObject = new \Magento\Framework\DataObject();             $  postObject->setData($  requestData);              $  transport = $  this->transportBuilder                 ->setTemplateIdentifier('custom_pdp_email_template')                 ->setTemplateOptions(['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID])                 ->setTemplateVars(['data' => $  postObject])                 ->setFrom(['name' => $  data["userName"],'email' => $  data["userMail"]])                 ->addTo($  data["shareMail"])                 ->getTransport();             $  transport->sendMessage();  

My template file:

<li style="font-weight:300;color:black !important;font-family: lato;font-size:16px;margin-left:0;">                     {{depend data.imgUrl}}                     {{trans "%imgUrl" imgUrl=$  data.imgUrl}}<br/>                     {{/depend}}                 </li>                  <li style="font-weight:300;color:black !important;font-family: lato;font-size:16px;margin-left:0;">                      <img alt="" data-bind="attr: { src: getImagepaypal() }" alt="Custom image" width="60" height="60">                 </li> 

Any help would be appreciated.