Skip to content

Instantly share code, notes, and snippets.

View rrrix's full-sized avatar
📃
reading man pages

Rick Bowen rrrix

📃
reading man pages
  • Palo Alto Networks
  • Saratoga, CA
  • 09:41 (UTC -08:00)
  • LinkedIn in/0xRB
View GitHub Profile
@rrrix
rrrix / amazon-cloudwatch-agent_config.json
Last active May 6, 2019 23:42
Standard Cloudwatch Log Agent Configuration /opt/aws/amazon-cloudwatch-agent/bin/config.json
{
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
"log_group_name": "amazon-cloudwatch-agent.log",
"log_stream_name": "{hostname}_{ip_address}_{instance_id}"
},

Quick n' Dirty GnuPG

Asymmetric Encryption for confidential, trusted data exchange over any transport

Prerequisite - install GnuPG if not installed

Check if GnuPG (gpg) is installed. In a Terminal:

# Check if gpg installed
$ which gpg [0]
# Correctly formatted script content from:
# https://adamtheautomator.com/powershell-logging-2/#Enable_Script_Block_Logging_Using_Windows_Registry
function Enable-PSScriptBlockLogging
{
# Registry key
$basePath = 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging'
# Create the key if it does not exist
if(-not (Test-Path $basePath))
{
@rrrix
rrrix / synthetic.conf.5
Last active September 13, 2022 00:44
Man: synthetic.conf(5) - synthetic symbolic link and directory manifest
SYNTHETIC.CONF(5) File Formats Manual SYNTHETIC.CONF(5)
NAME
synthetic.conf – synthetic symbolic link and directory manifest
DESCRIPTION
synthetic.conf describes virtual symbolic links and empty directories to be
created at the root mount point. Because the root mount point is read-only
as of macOS 10.15, physical files may not be created at this location. All
writeable paths must reside on the data volume, which is mounted at
goos: darwin
goarch: arm64
pkg: github.com/rrrix/go-play/reflect-type-bench
BenchmarkStringType-10       27413637        42.87 ns/op      16 B/op       1 allocs/op
BenchmarkReflectTypeOf-10    205474878        5.824 ns/op      0 B/op       0 allocs/op
BenchmarkSwitchType-10       1000000000       0.8087 ns/op     0 B/op       0 allocs/op✨✨
PASS
ok  github.com/rrrix/go-play/reflect-type-bench4.102s
@rrrix
rrrix / extract-css-colors.awk
Created June 20, 2024 03:12
Extract all CSS rules that have declarations relating to color, background, and borders
# vim: ft=awk ts=2 sts=2 sw=2 et:
/.*\{/ {
level++
selectors[level]=$0;
counter[level]=0
delete body[level]
}
/^ .*(color|background|border):.+|: *(#[0-9a-fA-F]+|rgba?\(|hsla?\()/ {