Skip to content

Tag: ruby

run multiple commands in docker after container start

how can I run /bin/ and /bin/ after the container startup! also, if you can tell me how can I send the logs of /bin/ and /bin/ to container logs!! Docker file Answer You can change ENTRYPOINT [“”] to ENTRYPOINT [“”, “”, “”] which will run your custom bash scripts you also need to create the log.txt

Ruby: how to access group info from /var/db/group.db

RHEL/CentOS 8.x, Ruby 2.5.5, irb 0.9.6 We have a specialized set up that keeps user and group information in /usr/local/etc/[user|group] and a custom Makefile to add that information to /var/db/[group|passwd].db accordingly. I am trying to get the list of groups a user belongs to, in Ruby, after login. I’m relatively new to the language, and have just read the documentation

How to do dynamic port forwarding using Ruby

How do I do SSH dynamic port forwarding on Ruby? I tried to use gems such as “net/ssh/socks” and “net/ssh/gateway”, but it looks like they are already outdated because I can’t even require them. All I need to do is run this shell command and receive the PID of this process. I also tried to use Kernel#system and Kernel#spawn. For

rails s command issue

The rails s command is showing this issue bellow; I have no idea what it is? this project use to run fine; I haven’t change much either. My env: The weird thing is that I execute the same command in another project and it run just fine. I am missing something? If I try the command along it work but

Ruby, ffi, and a custom C library

I’m trying to create a custom C library I can call from Ruby using FFI. My library will wrap certain libtiff functions with my own code, and the resulting higher-level functions will be called from within Ruby via the FFI interface. I’ve got test code working in C, that compiles successfully to a .so file. I’ve got that same code

Stream data for users

I want to build a server that could stream data from multiple endpoints simultaneously for analytics purposes. Scenario: users registered on our platform will provide credentials of their IoT device. E.g & Our responsibility is to monitor the device log and status in order to generate reports. Questions: Since each stream will keep a HTTP connection open, how

sleep 0 has special meaning?

I’m seeing a lot of usages of sleep 0 in my one of my client project. The code look something like this. Reading through some of the answer of SO like this it seems that sleep 0 has some significance. What I want to known now is that does scheduling for other thread to run (if they are waiting to