Skip to content

Instantly share code, notes, and snippets.

@reachlin
reachlin / prometheus.yml
Created April 19, 2017 07:06
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@Samgarr
Samgarr / prom_updates.cron
Created October 27, 2016 18:51
Monitoring debian security updates with Prometheus Textfile collector. Don't forget run node_exporter with appropriate parameters!
# based on https://www.robustperception.io/monitoring-directory-sizes-with-the-textfile-collector/
33 * * * * unattended-upgrade --dry-run -d 2> /dev/null | grep 'Checking' | wc -l | sed -ne 's/^\([0-9]\+\).*$/security_updates_count \1/p' > /var/lib/node_exporter/textfile_collector/security_updates_count.prom.$$ && mv /var/lib/node_exporter/textfile_collector/security_updates_count.prom.$$ /var/lib/node_exporter/textfile_collector/security_updates_count.prom
@tonysneed
tonysneed / Mac OS X: Open in Visual Studio Code
Last active June 14, 2024 04:16
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"