For Perl one-liners, when using the -p or -n flags is it possible to make the END {} block execute once per file, instead of only once for the entire program? In other words, when I write: I’d like to execute the END block once for each file, instead of just once globally at the end of the program’…
Python – how to get the import pjsua? giving no module named pjsua
How to get python pjsua? EDIT: p2p | registration | call Answer setup.py is trying to create shared library build/lib.linux-x86_64-2.7/_pjsua.so by dynamically linking pjsip’s libraries, but, those doesn’t provide a global offsets table(GOT) (check the link to see why this is needed). The problem …
Why does bash behave differently, when it is called as sh?
I have an ubuntu machine with default shell set to bash and both ways to the binary in $PATH: But when I try to call a script that uses the inline file descriptor (that only bash can handle, but not sh) both calls behave differently: The example-script I am referring to looks like that the real one is a littl…
How to move all files including hidden files into parent directory via *
Its must be a popular question but I could not find an answer. How to move all files via * including hidden files as well to parent directory like this: This will move all files to parent directory like expected but will not move hidden files. How to do that? Answer You can find a comprehensive set of solutio…
gdb backtrace with no user input?
I’m wondering if it’s possible to launch an application via GDB, on a SegFault write the backtrace to a file (to look at later), and then exit GDB all without any user input. I’m running an application from a shell script in an infinite loop (so if it crashes it reloads) on OS boot from a no…
How to make rsync read SRC from STDIN?
I want to dump my MySQL database and make daily backups with rsync. First approach I came up with is something like mysqldump -ufoo -pbar baz > /var/tmp/baz.sql && rsync /var/tmp/baz.sql /backup/ && rm /var/tmp/baz.sql. Then I started to wonder if it is possible not to use the temporary fil…
How to know the given shared library is built with debug symbols or not?
I have some compiled libraries i.e. shared library (*.so) on x86 Linux and I want to quickly determine whether they were compiled with debugging symbols (i.e with -g/debug option) or not. How to check it? Answer You can use the file command to see if a file is stripped. Basically, this means that the debuggin…
a light solution to convert text to pdf in Linux [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and …
Search for a String inside all files inside a war
Where I work someone had Java project and used Eclipse to export that project into a .war package. Now I need to search for a string inside all the files that make that .war package. I know that a .war package is just a .zip file, and I have extracted its contents, however, now I have bunch of of .class
Minimizing copies when writing large data to a socket
I am writing an application server that processes images (large data). I am trying to minimize copies when sending image data back to clients. The processed images I need to send to clients are in buffers obtained from jemalloc. The ways I have thought of sending the data back to the client is: 1) Simple writ…