Skip to content

Instantly share code, notes, and snippets.

View yomaron's full-sized avatar

Amorn Yomtes yomaron

View GitHub Profile
@yomaron
yomaron / sed cheatsheet
Created January 31, 2021 10:03 — forked from maprangzth/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@yomaron
yomaron / ssl-cert-info.sh
Created July 26, 2018 09:52
Shell script to check SSL certificate info like expiration date and subject. Taken from http://giantdorks.org/alain/shell-script-to-check-ssl-certificate-info-like-expiration-date-and-subject/
#!/bin/bash
usage()
{
cat <<EOF
Usage: $(basename $0) [options]
This shell script is a simple wrapper around the openssl binary. It uses
s_client to get certificate information from remote hosts, or x509 for local
certificate files. It can parse out some of the openssl output or just dump all
@yomaron
yomaron / nginx.conf
Created May 22, 2018 12:18 — forked from kmjones1979/nginx.conf
Example NGINX configuration to do service routing based on headers
events { worker_connections 2014; }
http {
include /etc/nginx/conf.d/*.conf;
default_type text/plain;
error_log /var/log/nginx/example_debug_error.log debug;
access_log /var/log/nginx/example_access.log;