basic regex: [set], c* 0 or more c, cc* 1 or more c extended regex: c+ 1 or more c $ grep '^[a-fA-F][a-fA-F]*$' /usr/share/dict/words | wc -l 469 $ egrep '^[a-fA-F]+$' /usr/share/dict/words | wc -l 469 $ egrep '^[a-fA-F]+$' /usr/share/dict/words | grep def def deface defaced defade $ --- sed 's/OLDregex/NEW/g' sed 's;OLDregex;NEW;g' sed 's/\//\\/g' # replace / with \ sed 's;/;\\;g' sed -e 's/onething/x/' -e 's/twothing/y/' .... # bit flip: $ echo 1010111110000 | sed -e 's/0/1/g' -e 's/1/0/g' # wrong 0000000000000 $ echo 1010111110000 | sed -e 's/0/Z/g' -e 's/1/0/g' -e 's/Z/1/g' # correct 0101000001111 $ x="abcabcabc" y=$(echo "$x" | sed 's/a/Z/g') # replace all a's with Z's --- $ ln -s /usr/share/dict/words . $ grep ZZZZZ words $ sed 's/^/ZZZZZ/' words > patterns $ time grep -f patterns words real 0m5.020s user 0m3.240s sys 0m1.077s $ time fgrep -f patterns words real 0m3.384s user 0m3.190s sys 0m0.167s $ time cat patterns patterns | grep -f - words # double number of patterns, double time real 0m10.077s user 0m6.525s sys 0m1.643s $ time cat patterns patterns | fgrep -f - words # double number of patterns, ~same time real 0m3.960s user 0m3.762s sys 0m0.185s $ --- three times: last modified, changed (properties), used (accessed) $ echo hi > j $ cat j hi $ ls -l j -rw-r--r-- 1 perry perry 3 Nov 8 05:11 j # one minute later: $ chmod 444 j # one minute later: $ cat j hi $ ls -l j -r--r--r-- 1 perry perry 3 Nov 8 05:11 j $ ls -lc j -r--r--r-- 1 perry perry 3 Nov 8 05:12 j $ ls -lu j -r--r--r-- 1 perry perry 3 Nov 8 05:13 j $ ----- $ find httpd-2.4.54 -name '*.ORIG' -print httpd-2.4.54/include/ap_release.h.ORIG httpd-2.4.54/modules/aaa/mod_authnz_ldap.c.ORIG $ diff -c httpd-2.4.54/include/ap_release.h.ORIG httpd-2.4.54/include/ap_release.h *** httpd-2.4.54/include/ap_release.h.ORIG 2022-06-06 10:20:09.000000000 -0400 --- httpd-2.4.54/include/ap_release.h 2022-11-02 09:57:33.013452448 -0400 *************** *** 39,45 **** */ #define AP_SERVER_BASEVENDOR "Apache Software Foundation" #define AP_SERVER_BASEPROJECT "Apache HTTP Server" ! #define AP_SERVER_BASEPRODUCT "Apache" #define AP_SERVER_MAJORVERSION_NUMBER 2 #define AP_SERVER_MINORVERSION_NUMBER 4 --- 39,45 ---- */ #define AP_SERVER_BASEVENDOR "Apache Software Foundation" #define AP_SERVER_BASEPROJECT "Apache HTTP Server" ! #define AP_SERVER_BASEPRODUCT "Chaos" #define AP_SERVER_MAJORVERSION_NUMBER 2 #define AP_SERVER_MINORVERSION_NUMBER 4 $ diff -c httpd-2.4.54/modules/aaa/mod_authnz_ldap.c.ORIG httpd-2.4.54/modules/aaa/mod_authnz_ldap.c *** httpd-2.4.54/modules/aaa/mod_authnz_ldap.c.ORIG 2021-03-02 02:43:35.000000000 -0500 --- httpd-2.4.54/modules/aaa/mod_authnz_ldap.c 2022-11-02 09:59:20.318489194 -0400 *************** *** 470,475 **** --- 470,488 ---- static authn_status authn_ldap_check_password(request_rec *r, const char *user, const char *password) { + // + // RP, 2020-01-20, remove @villanova.edu + // + if( user) { + char *p = strchr( user, '@'); + if( p) { + char *q = apr_pstrdup(r->pool, user); + q[p-user] = 0; + user = q; + r->user = q; + } + } + char filtbuf[FILTER_LENGTH]; authn_ldap_config_t *sec = (authn_ldap_config_t *)ap_get_module_config(r->per_dir_config, &authnz_ldap_module); $ nc -C www.ece.villanova.edu 80 HEAD / HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 08 Nov 2022 10:19:01 GMT Server: Chaos Last-Modified: Fri, 16 Jul 2021 10:34:13 GMT ETag: "118-5c73b20f74082" Accept-Ranges: bytes Content-Length: 280 Connection: close Content-Type: text/html; charset=UTF-8 ^C $ nc -C fog.misty.com 80 HEAD / HTTP/1.0 HTTP/1.1 200 OK Date: Tue, 08 Nov 2022 10:19:18 GMT Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16 Last-Modified: Sun, 21 Nov 2021 12:07:53 GMT ETag: "1456-5d14b5ba33d6e" Accept-Ranges: bytes Content-Length: 5206 Connection: close Content-Type: text/html; charset=UTF-8 ^C $