Skip to content

Instantly share code, notes, and snippets.

@devinnasar
devinnasar / mySrcDiff.diff
Created June 21, 2017 01:50
can I get diff to not place the timestamp in these files?
diff -ur '--exclude=3502_03' 2017-05-23/3301_03/workstation_patch_status 2017-06-02/3301_03/workstation_patch_status
--- 2017-05-23/3301_03/workstation_patch_status 2017-05-23 00:07:57.000000000 -0400 <-- this last part
+++ 2017-06-02/3301_03/workstation_patch_status 2017-06-02 11:55:10.000000000 -0400
@@ -23,7 +23,7 @@
...
# Gets the most recent directory under an s3 path
aws s3 ls "${_s3socpath}/tc-east-10/" | # list contents of s3 path
grep "PRE" | # filter for PRE (prefix) entries
awk '{printf $2"\n"}' | # print the second column of output (remove the PRE column)
sed 's/\/$//' | # cut the trailing slash off of paths
sort -r -n -t"-" -k1 -k2 -k3 | # sort the output: reverse, with a delimiter of hyphen ('-'), by the year, then month, then date
sed -n 1p # return the first line of output only
@devinnasar
devinnasar / freshclam comment
Created February 27, 2018 21:37
This fails when the string actually isn't in the file
freshclam_confirm_sysconfig_exists:
file.exists:
- name: {{ freshclam.sysconfig_path }}/freshclam
freshclam_enable_cron_script:
file.comment:
- name: {{ freshclam.sysconfig_path }}/freshclam
- regex: 'FRESHCLAM_DELAY=disabled-warn'
- char: '#'
- require: