Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 6 years ago. Improve this ques…
How to view the internal data of a smart pointer inside gdb?
I’ve got test program like below: Debug it: It only prints out the pointer type information of si, but how to get the value stored in it (in this case 5)? How can I check the internal content of si during debugging? Answer Try the following: Now, this assumes that you’re using libstdc++.so, given …
Best Practice for Running Programmatic Postgres DB Migrations on Linux
On many varieties of Linux PostgreSQL runs under a separate user account, so you have to do: to get any work done. That’s all well and good if you just want to type SQL in manually, but what if you have a migration written in a programming language (in my case, Node/Knex)? Is the common practice to some…
How to solve librustdoc.so missing when using rustbook tool?
I’ve used to install rustbook successfully, but when I run rustbook I get an error: But I can find out this .so file. How can I let rustbook know the path to librustdoc-c0dcaea09a16c7ec.so? rustc 1.16.0-nightly (4ecc85beb 2016-12-28) rustdoc 1.16.0-nightly (4ecc85beb 2016-12-28) rustup show: Answer This…
Debugging a linux daemon process written in C
On occasion a daemon I wrote in C gets these error messages: My question is how can I examine that address in libc-2.19.so to see which function is being called when the error occurs? I tried using gdb but I get : Answer With the data you provide there’s very little that can be done here to make a diagn…
gcc creates mime type application/x-sharedlib instead of application/x-application
Given the following C++ code ‘mini.cpp’: and the compiler command: the result of is How do I get ‘application/x-application’ as a mime type? I’m using gcc 6.2.0 on Kubuntu. Answer gcc doesn’t set the mime type. mimetype guesses the appropriate mime type based on the content…
Using linux’ at command – scheduling daily / weekly possible?
I recently came across the at command on the command line, but I am wondering whether I can write a bash script that somehow enables me to tell the at command to run at 8 pm every day, or every monday, every week etc. basically at regular intervals. How is this possible? Answer at is the wrong tool for this
Bash replacing text in file
I want to automate changes in a File. For example ;max_input_vars = to max_input_vars = 10000 in /etc/php5/cli/php.ini with a script. How can I do that? I know command sed will do something like that. Answer Try this command:
Spawn process and redirect current bash script’s output to it
How can I spawn a new background process from a bash script and redirect the current script’s stdout/stderr to that process’s stdin using fd redirection? I know of a few ways to accomplish the same effect, such as using a named pipe or a temporary file, using coprocs, or running the whole script i…
what’s wrong with my shell script? when use loop in a function,always have some exception
this is my script: here is errormessage My linux version is centos 7.0,and when i use loop only in script not in function,there will not be erros when process Answer There are a number of sources of confusion here. First, whenever you use anything like echo somethingorother in backquotes, you’re doing s…