Skip to content

Instantly share code, notes, and snippets.

@craig-m-unsw
craig-m-unsw / chef_local_development_workflow.md
Created November 1, 2023 00:07 — forked from smford22/chef_local_development_workflow.md
Chef Local Development Workflow - ChefDK, Vagrant, VirtualBox, Test Kitchen

Chef Local Development Workflow with ChefDK, Vagrant, VirtualBox, and Test Kitchen

Overview

The following document is intended to be a quick guide to getting you setup for doing local development with Chef. This guide was created on my MacBook, but should work fine with Linux, and Windows workstations as well.

Quick review on fundamental tenets of Chef

  • Workstation - A workstation is a computer that is configured to run various Chef command-line tools that synchronize with a chef-repo, author cookbooks, interact with the Chef server, interact with nodes, or applications like Chef Delivery
  • Node - A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef.
  • Chef Server- The Chef server acts as a hub for configuration data. The Chef server stores cookbooks, the policies that are applied to nodes, and metadata that describes each registered
@craig-m-unsw
craig-m-unsw / inspec.md
Created November 1, 2023 00:06 — forked from dgrizzanti/inspec.md
Inspec Blog Post

Introduction to Infrastructure testing with Inspec

Testing is a common practice for software teams and has evolved tremendously over the last 2 decades. Test Drive Development (TDD), Unit Testing, Integration, Acceptance Testing, you name it there is a testing pattern for it. However, less attention is paid infrastructure testing. It’s more of a nebulous topic and is often a bit more difficult to know where it fits into your development process. developers responsible for writing these tests or the folks deploying the software? What if it’s the same team and you’re following a more “DevOps” model?

We’ll attempt to answer some of those questions and more by showcasing a common tool that can be used for infrastructure testing, called Inspec, and patterns your team can adopt to test your infrastructure like you test your software.

What is Inspec

Inspec is an open-source framework, written and maintained by Chef, for auditing and testing your application and infrastruc

@craig-m-unsw
craig-m-unsw / get_rclone.py
Last active November 28, 2023 22:39
get_rclone.py - find latest Rclone release and download + check all packages
#!/usr/bin/env python3
# find latest Rclone release and download + check all packages as per https://rclone.org/release_signing/
#
# example use:
#
# $ python3 -m venv get_rclone
# $ source get_rclone/bin/activate
# $ pip install python-gnupg requests
# $ ./get_rclone.py
@craig-m-unsw
craig-m-unsw / check_puppet
Created October 19, 2023 10:38 — forked from seidler2547/check_puppet
Nagios/Icinga Puppet run check
#!/opt/puppetlabs/puppet/bin/ruby
require 'yaml'
require 'puppet'
require 'optparse'
options = {
:lastrun_warn => 3600,
:lastrun_crit => 36000,
:runtime_warn => 25,
@craig-m-unsw
craig-m-unsw / find-all-electron-versions.sh
Created September 28, 2023 23:39 — forked from april/find-all-electron-versions.sh
find all apps using Electron and their versions, on macOS systems
#!/usr/bin/env zsh
# patched versions for CVE-2023-4863: 22.3.24, 24.8.3, 25.8.1, 26.2.1
mdfind "kind:app" 2>/dev/null | sort -u | while read app;
do
filename="$app/Contents/Frameworks/Electron Framework.framework/Electron Framework"
if [[ -f $filename ]]; then
echo "App Name: $(basename ${app})"
electronVersion=$(strings "$filename" | grep "Chrome/" | grep -i Electron | grep -v '%s' | sort -u | cut -f 3 -d '/')
# Gets a list of files and/or directories to build a SHA-256 from their contents.
# Returns the SHA-256 hash if succeeded, otherwise an empty string.
sha256sum_from_files() {
local files_in=${@:-}
local files=""
local shasum=""
# Process the input files:
# - discard the files/directories that don't exist.
# - find the files if it is a directory
@craig-m-unsw
craig-m-unsw / pwnd.md
Created April 5, 2023 02:13 — forked from MattKetmo/pwnd.md
pwnd

This list has moved to pwnd.dev

Tools

  • Metaspoit: Penetration testing software
  • GhostShell: Malware indetectable, with AV bypass techniques, anti-disassembly, etc.
  • BeEF: The Browser Exploitation Framework
  • PTF: Penetration Testers Framework
  • Bettercap: MITM framework
  • Nessus: Vulnerability scanner
@craig-m-unsw
craig-m-unsw / AdvancedDistributedSystemDesignCourseNotes.md
Created April 5, 2023 02:12 — forked from craigtp/AdvancedDistributedSystemDesignCourseNotes.md
Notes on Udi Dahan's Advanced Distributed System Design Course

Advanced Distributed System Design Course - Udi Dahan

Notes by Craig Phillips

Fallacies of Distributed Computing

  • There are 11 fallacies of Distributed Computing:
    1. The network is reliable
    2. Latency isn’t a problem
    3. Bandwidth isn’t a problem
    4. The network is secure
  1. The topology won’t change
@craig-m-unsw
craig-m-unsw / MemoryAcquisitionUNIX.md
Created April 2, 2023 08:28 — forked from SyeedHasan/MemoryAcquisitionUNIX.md
Commands to acquire a snapshot of the memory on *UNIX based systems

Generic Commands

Checking Kernel release: uname -r

Checking Kernel version: uname -v

Commands to Acquire Memory

Here's a list of commands which you may execute to acquire memory from a *UNIX system:\


@craig-m-unsw
craig-m-unsw / README.md
Created March 25, 2023 01:16 — forked from TJM/README.md
Puppet SCCM Client Install as a package

SCCM Install using Puppet "package"

This script was donated by a customer of ours. They have sent us a sanitized version of the script to share.

Please use this at your own risk, and fully understand what it is doing before using it!

The Problem:

SCCM Installation fires off in the background and you have no idea whether it worked or not. Also, if any other installs try to start while the SCCM setup is running, you will get an error.