Skip to content

Instantly share code, notes, and snippets.

@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.

@craig-m-unsw
craig-m-unsw / .gitlab-ci.yml
Created March 5, 2023 23:38 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.

second ssh

run a second copy of sshd and enable root login without pam or password

cat << EOF > /etc/ssh/authorized_keys2
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQiKlpq/LIhf3Q145pgUP0QbRrbRTSA7SVmuW69Y0wAu3VXSTDwyCYokBVfF1q0FaIFcYHn1xUG+XDiKVQhlQKN1WEZ0wLcpFs7xYfxtQs9lH8WxdQtcXqOAeZB5/cFLYFQyB4YHpow6rlJ8V4F56GdCktDbclV2U1AD/hctdilk1Izr3wkdNIlHbAWl/VYnYlVbW6jMz6c/3XOQizoqwdhkpJao64n43/1u2B4cePyHravOU1gMElIDbZDt0Svv3iAX2nsT8dZRgCxaT8XSB9qQlbLumUWcjPueg9k3ZGNzp9hia5LWsiaMPWy1xI9y5ZtKhfEdJxGjwHb0ZFN6obaiUZ+BPxajCSWOAmSRh5V5yctnUihCKA6QMfjJZnaimZGssYHUmVAEJJHnIWWxqfZtzwK8o1mKJ5ATP7dTFuDZa5U7su1eq0qP3Yt+1gev71CRzwOf0BErmWQ0sLKC6C6uL6ap1DkD65BK39H/gmscvISRDUvguJIAoTUJi6zfk= root@host
EOF
@craig-m-unsw
craig-m-unsw / WingetUpgrade.ps1
Created December 20, 2022 10:26 — forked from alkampfergit/WingetUpgrade.ps1
Upgrade with Winget being able to select list of software to skip
class Software {
[string]$Name
[string]$Id
[string]$Version
[string]$AvailableVersion
}
$upgradeResult = winget upgrade | Out-String
$lines = $upgradeResult.Split([Environment]::NewLine)
@craig-m-unsw
craig-m-unsw / 01-directory-structure.md
Created December 15, 2022 09:57 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@craig-m-unsw
craig-m-unsw / WinGet-setup-apps.ps1
Last active November 18, 2022 01:15 — forked from codebytes/DevMachineSetup.ps1
Install Winget + packages on Windows 11
<#
name:
WinGet-setup-apps.ps1
desc:
Install Winget + packages on Windows 11
Based on these gists:
- https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
- https://gist.github.com/Codebytes/29bf18015f6e93fca9421df73c6e512c
#>
@craig-m-unsw
craig-m-unsw / README.md
Last active November 28, 2023 22:40
build chef bento box virtual machines with packer

Test VM

Use the chef bento project to build the Vagrant boxes.

Tested November 2023 on:

  • Ubuntu 22.04.3 LTS (Jammy Jellyfish)
  • Virtual Box 7.0.12 r159484 (Qt5.15.3)
  • Packer 1.9.4
  • Vagrant 2.4.0
@craig-m-unsw
craig-m-unsw / linkers.md
Created November 10, 2022 16:33 — forked from jvns/linkers.md
Notes on linkers

How to read an executable

I used to think that executables were totally impenetrable. I'd compile a C program, and then that was it! I had a Magical Binary Executable that I could no longer read.

It is not so! Executable file formats are regular file formats that you can understand. I'll explain some simple tools to start! We'll working on Linux, with ELF binaries. (binaries are kind of the definition of platform-specific, so this is all platform-specific.)

Let's write a simple C program, hello.c:

#include 
@craig-m-unsw
craig-m-unsw / PSADT-Cheatsheet.ps1
Created October 25, 2022 05:29 — forked from leeramsay/PSADT-Cheatsheet.ps1
PSADT snippits/cheatsheet
## Commonly used PSADT env variables
$envCommonDesktop # C:\Users\Public\Desktop
$envCommonStartMenuPrograms # C:\ProgramData\Microsoft\Windows\Start Menu\Programs
$envProgramFiles # C:\Program Files
$envProgramFilesX86 # C:\Program Files (x86)
$envProgramData # c:\ProgramData
$envUserDesktop # c:\Users\{user currently logged in}\Desktop
$envUserStartMenuPrograms # c:\Users\{user currently logged in}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
$envSystemDrive # c:
$envWinDir # c:\windows