You can use the following xdpyinfo command
xdpyinfo | grep dim
dimensions: 3840x3673 pixels (1016x971 millimeters)
You can use the following xdpyinfo command
xdpyinfo | grep dim
dimensions: 3840x3673 pixels (1016x971 millimeters)
You have an LDAP entry with an attribute that consists of json entries, and you would like to use ldapsearch to filter on a json item condition.
So having the attribute
mobileIDAuthenticator: {“creationDateTime”:”2023-08-28T14:53:29.061Z”,”state”:”ENABLED”,”mobileNumber”:”+411111111″,”mobileSerialNumber”:”AAAAAAAAAAAAA”}
you would like to filter on the state item.
you can use the following syntax:
ldapsearch -LLL -H "ldaps://domain.com:1636" -D "cn=Directory Manager" -w $LDP -o ldif_wrap=no -c -vvvv -b "ou=persons,dc=domain,dc=com" -s sub "(mobileIdAuthenticator=state eq 'ENABLED')" uid mobileIDAuthenticator
You have an attribute in LDAP that might be a long line (ie a json array that contains many records like logins for example)
loginHistory: [{"lastLoginDate":"20250107094531.782Z","loginModule":"1"},{"lastLoginDate":"20241202075005.298Z","loginModule":"1"},{"lastLoginDate":"20241129143412.785Z","loginModule":"1"},{"lastLoginDate":"20241129103347.029Z","loginModule":"1"},{"lastLoginDate":"20240920105718.171Z","loginModule":"2"}]
But you want to return it in one line for further processing (ie counting the number of times in a year).
You can use the -o ldif_wrap=no option in your ldapsearch like
ldapsearch -LLL -H "ldaps://ldap.com:1636" -o ldif_wrap=no -D "cn=User" -w $LDP -b "ou=people,dc=domain,dc=com" -s sub "(mail=usernname@domain.com)" uid loginHistory
To return all attributes from LDAP using ldapsearch you can use both “*” for user and “+” for operational attributes
ldapsearch -LLL -H "ldaps://url:1636" -D "cn=Directory Manager" -w $LDP -b "ou=entity,dc=domain,dc=com" -s sub "(&(attr_filter1=SOMETHING)(attr_filter2=ELSE))" "*" "+"
You are trying to do PITR recovery for a specific time, but the restore fails with something similar to the following message
FATAL: recovery ended before configured recovery target was reached
This seems to be caused by a feature/bug that causes this error when there are no transactions between the backups, as explained in more detail here
To be able to see the job runner IP address in a gitlab job, you can add a script (or add it to an existing one) that uses hostname -I
script:
- hostname -I && your_other_script
You have two files (A.txt, B.txt) that contain records (one line each), and you want to find out the common lines between the two.
For example you have the following two files.
A.txt
one
two
three
and B.txt
two
six
seven
and you want to find or produce a new file (C.txt) that contains only the common record (two) from the two files.
You can use grep with the -Fx options like
grep -Fxf A.txt B.txt > C.txt
that will produce file C.txt that contains the common line (two) from the two files.
The options for grep have the following meaning:
-F
: Interpret the pattern as a list of fixed strings (instead of regular expressions).-x
: Only match whole lines.-f fileA.txt
: Read the patterns from fileA.txt
.It seems that the default email client in Fedora 40 is s-nail instead of mailx in Fedora 39, and trying to send an email from the command line does not work anymore.
The two changes required in order for the command to work with s-nail are:
s-nail: -a is an invalid alias name
So the full command can be like the following:
echo $body | mail -s "Reports for $yesterday" -a $report_path_a -a $report_path_b -c $cc_recipients $recipients
To convert an xlsx file to csv in command line, you can use the following if you have libreoffice installed
libreoffice --headless --convert-to csv file.xlsx
You want to print a summary of commits in git that contain a certain pattern (‘number’) ordered by date and with the total number of commits per day
You can use the following for the patter ‘number’
git log --pretty=format:'%h %ad | %s%d [%an]' --date=short | grep 'number' | awk '{print $2}' | sort -r | uniq -c | awk '{ print $2,$1}'
The last awk command is to swap the date with the total number
The output should be something like the following
2024-06-18 2
2024-06-17 3
2024-06-14 1
2024-06-13 1
2024-06-12 1
2024-06-11 4
2024-06-10 3