Trying to loop every file, do some cutting, extract the first 4 characters of the MD5. Here’s what I got so far: Problem is, I don’t see any more output at this point. How can I send output to md5sum and continue sending the result? Answer md5sum reads everything from stdin till end of file (eof) …
Is it possible to pass regex strings as args to a Python CLI tool using argparse?
I’m writing a script to search a logfile for a given python regex pattern. Setting aside the fact that this would be much easier to do using a simple Bash script, can it be done in Python? Here’s what I’ve run into: Assumptions: I’m trying to analyze the file /var/log/auth.log (for the…
Doesn’t show the needed info from auth.log file when using grep
I want to get all info about user from auth.log file, but when I use grep user /var/log/auth.log but instead of giving me all the information with user mentioned, it just writes to me Binary file /var/log/auth.log matches. It used to pick up the sentences with mentioned user, but now it doesn’t. Answer …
Docker $(pwd) and bash aliases
I’m running Docker CE in Ubuntu 16.04. I’ve created a Docker image for the polymer-cli. The idea is to be able to run polymer commands from inside disposable docker containers using bash aliases that mount the current directory, run the command and then destroy the container, like this: This works…
Measuring execution time – in program code or in shell?
I have a program and I want to measure its execution (wallclock) time for different input sizes. In some other similar questions I read that using clock_gettime in the source code wouldn’t be reliable because of the CPUs branch predictor, register renaming, speculative execution, out-of-order execution …
How to use sed to delete lines not containing pattern
I have a file as below: I need to delete all lines except the first line, which means that lines should not be deleted if it contains Thumb[any characters except /].jpg. I try to use sed to do this but I don’t know how to write the regex. I’ve tried like this: sed -i -e ‘.*Thumb^(/).jpg!d…
where is file descriptor stored in process memory?
When a function A is called from a point of execution, internally it is a JMP statement to the address pointing to function A. So the current point of execution is saved onto the stack, the PC loads the address of the called function A and continues. To get back to the point of execution after the function ca…
Queued Jobs are still processed even without Supervisor running
This seems weird. I killed all existing processes related to supervisord on my linux server (aws ec2) but the queued jobs are still being processed/worked on. I checked the processes through ps -fe and I don’t find any process of supervisord running. Anyone who can tell me what’s going on? Thanks …
Starting supervisorctl gives ERROR (spawn error) on laravel queue worker process
So i have installed supervisor and it appears to be running. I have placed my config file for the queue worker in /etc/supervisor/conf.d/laravel-worker.conf And it looks like this And my supervisord.conf looks like this I am getting the error – ERROR (spawn error) when i attempt to start the processes. …
How to create high frequency logging (tracing) in Linux userspace?
I am starting a new user-space application and i want to create some common utilities for logging and tracing i distinguish between the 2 utilities. in my prespective logging should be something that is always on and used for high level information and debug. Where as tracing is much more detailed and more fr…