Last active
May 27, 2020 22:19
-
-
Save HelioCampos/68e84d0d057c9df437af5565a872989e to your computer and use it in GitHub Desktop.
One liner commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Oneliners | |
## SSL | |
### Retrieve ssl cert from command line. Seems to be getting only one of the certs. | |
DNS='mydomain.com' | |
SERVER_NAME=$DNS # Forcing to return only the certificate for the current DNS. | |
PORT=443 | |
echo | openssl s_client -showcerts -servername $SERVER_NAME -connect $DNS:$PORT 2>/dev/null | openssl x509 -inform pem -noout -text | |
## VIM | |
### Execure modifications on a file without staying on it | |
vim -c "1,$ s/^/insert\t\r/g" -c ':wq' all-dev3.yml | |
### The same with a loop | |
for idd in $(seq 1, 9); do vim -c "1,$ s/^/insert ${idd}\t\r/g" -c ':wq' all-dev${idd}.yml; done | |
### Strings substitute | |
perl -p -e 's/\x0/\n/g' FILE_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment