unix-socket

What is the result of mounting `/var/run/docker.sock` in a Docker in Docker scenario?

我只是一个虾纸丫 提交于 2021-02-08 19:22:32
问题 I've read Can anyone explain docker.sock to understand what /var/run/docker.sock does, but its use in GitLab CI's Use Docker socket binding has me confused. Here is their example command for the gitlab-runner registration: sudo gitlab-runner register -n \ --url https://gitlab.com/ \ --registration-token REGISTRATION_TOKEN \ --executor docker \ --description "My Docker Runner" \ --docker-image "docker:19.03.12" \ --docker-volumes /var/run/docker.sock:/var/run/docker.sock I see two places that

Docker API NodeJS

坚强是说给别人听的谎言 提交于 2021-01-29 04:01:14
问题 I'm using the nodeJS request library to call a unix domain socket, specifically the Docker API. This works fine and returns a list of containers. curl --unix-socket /var/run/docker.sock http:/v1.24/containers/json However, this returns a 400400 Bad Request and I'm not sure why var request = require('request'); request('http://unix:/var/run/docker.sock:http:/v1.24/containers/json', headers="Content-Type': 'application/json" , function (error, response, body) { if (!error && response.statusCode

How to listen for incoming transactions not yet mined for a single address?

丶灬走出姿态 提交于 2021-01-28 00:04:34
问题 Using OpenEthereum, which is the json rpc call allowing to do it? I found the parity_pubsub module but I ve no idea of the parameter for getting not yet confirmed transactions. I also found https://web3js.readthedocs.io/en/v1.2.11/web3-eth-subscribe.html#subscribe-pendingtransactions in the web3 module but it doesn t allows to filter transactions and the documentation doesn t explains how to use the full web3 api along OpenEthereum. The purpose The aim is to frontrun transactions for

Linux Kernel Module unix domain sockets

感情迁移 提交于 2020-05-29 11:08:32
问题 I'm trying to share data between kernel and user space. The ultimate goal is to port it to Android, so I'm using unix domain sockets. (I don't know if this is the best option). I have a kernel module acting as socket client and a c program acting as socket server. And vice-versa, a kernel module acting as socket server and a c program acting as socket client. Programs are very simple. Servers just send a string to clients and they print it. I run server_user.c and then I try to insert client

How to communicate a Rust and a Ruby process using a Unix socket pair

二次信任 提交于 2020-04-16 05:49:31
问题 I am trying to communicate a Rust process with a child Ruby process using a Unix socket pair. I have tried the same using only Ruby and it works, but I can't seem to get it to work with Rust. I have tried passing the "rust_socket" file descriptor to the Ruby script, passing the "ruby_socket" file descriptor to Ruby and different combinations of reading / writing to the socket. I feel like I should be passing the "ruby_socket" file descriptor, but when I do that I get a bad file descriptor

Set Kestrel Unix socket file permissions in ASP.NET Core?

女生的网名这么多〃 提交于 2020-03-04 20:31:43
问题 Kestrel can be configured to use a Unix socket to communicate with a reverse proxy (i.e. nginx) for a slight performance advantage. However, the socket file is deleted and recreated each time the kestrel server stops/starts, resetting the socket's permissions and depending on system configuration, blocking nginx from accessing the socket. What is a simple and reliable method to ensure Kestrel's Unix socket permissions are opened up on creation? 回答1: The following sample Program.Main

Error : “Transport endpoint is already connected”

大城市里の小女人 提交于 2020-01-24 18:46:30
问题 I am trying to develop a small chat server with C. For a simple chat server, ( Transport endpoint ) === ( socket ) ? Do i have to use one socket per client, or can I reuse a socket for multiple clients ? If so, how ? Is there a standard way of doing this ? Any good references available ? Can i get to see some sample implementations ? I have to use gcc compiler and c language for this assignment. 回答1: You need one socket/client and no, you cannot reuse sockets. If you have to handle multiple

Error : “Transport endpoint is already connected”

泄露秘密 提交于 2020-01-24 18:46:25
问题 I am trying to develop a small chat server with C. For a simple chat server, ( Transport endpoint ) === ( socket ) ? Do i have to use one socket per client, or can I reuse a socket for multiple clients ? If so, how ? Is there a standard way of doing this ? Any good references available ? Can i get to see some sample implementations ? I have to use gcc compiler and c language for this assignment. 回答1: You need one socket/client and no, you cannot reuse sockets. If you have to handle multiple

Connection between Node.JS and PHP via UNIX Socket - EPIPE write error

℡╲_俬逩灬. 提交于 2020-01-24 15:29:05
问题 I'm trying to create a bridge between my application created in PHP and Node.JS. Node.JS creates socket and listening to it, my code: var net = require('net'), fs = require('fs'); var path = '/tmp/echo.sock'; fs.unlink(path, function () { var server = net.createServer(function(c) { console.log('server connected'); c.on('close', function() { console.log('server disconnected'); }); c.write('hello\r\n'); c.on('data', function(data) { console.log('Response: "' + data + '"'); c.write('You said "'

Connect to a database over a unix socket using SQLAlchemy

浪子不回头ぞ 提交于 2020-01-21 12:57:21
问题 I'm trying to connect to my Cloud SQL DB using SQLAlchemy from my cloud function but I can't seem to work out the correct connection string. DATABASE_URL=postgres://$DB_USER:$_DB_PWD@/$DB_NAME?unix_socket=/cloudsql/$DB_INSTANCE Which gives me the error: pyscopg2.ProgrammingError: invalid dns: invalid connection option "unix_socket" What is the correct way to connect to a Postgresql 9.6 DB over a unix socket using pyscopg2 ? 回答1: The special keyword needed here is host : DATABASE_URL=postgres: