I’m developping a script to search for patterns within scripts executed from CRON on a bunch of remote servers through SSH. For now I can’t get the correct output. Script on client machine This only gives me the paths of scripts from crontab, not the matched lines and line number plus the first line is prefixed with “grep:” keyword (example
Tag: linux
What is the internal format of .Xauthority file?
Well, the subject. I have searched a lot, but unfortunately, found nothing. Is there some document describing this format? Or the structure need to be extracted out from the xauth source files? Answer Probably not exactly what you are looking for but putting in an answer just for the formatting. The .Xauthority is an array of structures: You would probably
Connection to SQL Server from Julia on Ubuntu Linux using ODBC.jl won’t connect
I have tried every permutation I can find on the web but still no luck. I know the connection is possible because it works easily from R, dbeaver, and command line sqlcmd, but I can not get it to work from Julia using ODBC.jl However in Julia 1.7.0 I just get this error: I think it might have something to
Sudo gets separate PID when starting a command
I do not understand why sudo gets a separate PID (e.g. 1620) while starting dockerd (e.g. 1628) with sudo? To which PID should I send SIGTERM to stop the dockerd? ps aux | grep dockerd pstree -ps Answer I do not understand why sudo gets a separate PID (e.g. 1620) while starting dockerd (e.g. 1628) with sudo? It is just
How to make a strict match with awk
I am querying one file with the other file and have them as following: File1: File2: This command: returns lines that overlap, BUT doesn’t have a strict match. Having a strict match, only Helen Stanley should have been returned. How do you restrict awk on a strict overlap? Answer With your shown samples please try following. You were on right
How can I save in a variable a portion of my cURL GET command?
I’m currently trying to setup an automated server on DigitalOcean API, and I need to extract the ID of my server to use it later in a command. My bash command is the following : The answer for the cURL command is this : I only need to save as a variable the first ID the cURL command gives me,
Understanding the output of gettimeofday
I am trying to understand the precision of the gettimeofday() system call. Here’s my program: The output if I run this program (./a.out 10) is, The seconds column seems to reconcile with the sleep of 1 secs. Can someone please explain what’s going on with the values in micro seconds column? It looks like the jumps from sleep to sleep
What does the z component of ncurses mouse events represent?
From ncurses.h What does the z coordinate represent? Answer From the curs_mouse man page: The z member in the event structure is not presently used. It is intended for use with touch screens (which may be pressure- sensitive) or with 3D-mice/trackballs/power gloves. Also, if you search lib_mouse.c in the ncurses source code for ->z and .z, you will find that
understand sysstat sar memory output
I’m preparing for more traffic in the days to come, and I want to be sure server can handle it. Running sar -q, the load of “3.5” doesn’t seem much on 32 CPU architecture: However, I’m not sure about the memory. Running sar -r shows 98.5% for the %memused and only 13.60 for %commit: running htop seems OK too: 14.9G/126G.
Find and copy specific files by date
I’ve been trying to get a script working to backup some files from one machine to another but have been running into an issue. Basically what I want to do is copy two files, one .log and one (or more) .dmp. Their format is always as follows: something_2022_01_24.log something_2022_01_24.dmp I want to do three things with these files: find the