Uppercasing First Letter of Words Using SED
This line should do it: sed -e “s/\b\(.\)/\u\1/g”
This line should do it: sed -e “s/\b\(.\)/\u\1/g”
You can use the command line tool dos2unix dos2unix input Or use the tr command: tr -d ‘\r’ <input >output Actually, you can do the file-format switching in vim: Method A: :e ++ff=dos :w ++ff=unix :e! Method B: :e ++ff=dos :set ff=unix :w EDIT If you want to delete the \r\n sequences in the file, … Read more
Programs to monitor if a process on a system is running. Script is stored in crontab and runs once every minute. This works with if process is not running or process is running multiple times: #! /bin/bash case “$(pidof amadeus.x86 | wc -w)” in 0) echo “Restarting Amadeus: $(date)” >> /var/log/amadeus.txt /etc/amadeus/amadeus.x86 & ;; 1) … Read more
With non-blocking sockets, SSL_WANT_READ means “wait for the socket to be readable, then call this function again.”; conversely, SSL_WANT_WRITE means “wait for the socket to be writeable, then call this function again.”. You can get either SSL_WANT_WRITE or SSL_WANT_READ from both an SSL_read() or SSL_write() call.
There are lots of different ways that you could achieve this. I’m going to list one of several possible solutions. I would propose using several different layers of protection to prevent users from running the commands that they shouldn’t be allowed to access. All of the directions here assume that users have their own /home/[username] … Read more
This does indeed depend on the implementation – so since you have asked about Linux specifically, my comments are refer to the current NPTL implementation of pthreads, which is used in modern glibc. There are two related, but separate, issues here. Firstly, there is this situation: There are read locks currently held, and writers waiting. … Read more
Use the timeout command: timeout 15s command Note: on some systems you need to install coreutils, on others it’s missing or has different command line arguments. See an alternate solution posted by @ArjunShankar . Based on it you can encapsulate that boiler-plate code and create your own portable timeout script or small C app that … Read more
The “no version information available” means that the library version number is lower on the shared object. For example, if your major.minor.patch number is 7.15.5 on the machine where you build the binary, and the major.minor.patch number is 7.12.1 on the installation machine, ld will print the warning. You can fix this by compiling with … Read more
For the record, here are a couple of commands that will show the rpath header. objdump -x binary-or-library |grep RPATH Maybe an even better way to do it is the following: readelf -d binary-or-library |head -20 The second command also lists the direct dependencies on other libraries followed by rpath.