Skip to content

Instantly share code, notes, and snippets.

View AndrewWCarson's full-sized avatar
🐦

Andrew Worth Carson AndrewWCarson

🐦
View GitHub Profile
# $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
### Andrew Carson - 2017
#
# macOS 10.11.6
# Today's project was a simple install of CentOS 7's arm build for Raspberry Pi.
# I am using a Raspberry Pi B+ and a Kingston 8GB microSD card.
# Download with curl
curl http://mirror.centos.org/altarch/7/isos/armhfp/CentOS-Userland-7-armv7hl-Minimal-1611-RaspberryPi3.img.xz > CentOS-rpi3-1611.img.xz
# Download with wget (not on Mac by default)
@AndrewWCarson
AndrewWCarson / force_all_logoff_after_15m.ps1
Last active February 6, 2020 19:33
Logoff all users on a windows terminal server to run app-specific backups
<#
all_user_notify_15m_drop.ps1, v1.2
Andrew Carson
(C) 2016
This script notifies users before kicking them off this server so that
backups can be appropriately run. Then, the script waits 2 hours before enabling logons.
#>
@AndrewWCarson
AndrewWCarson / enable-o365-focused-inbox.ps1
Last active October 10, 2017 04:33
Enable Focused Inbox for an organization in Office 365 E1.
# This opens a GUI password prompt to store the O365 admin password.
$UserCredential = Get-Credential
# Initiate a remote Powershell session with O365.
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
# Display the org-wide settings.
Get-OrganizationConfig
@AndrewWCarson
AndrewWCarson / install-backblaze-silent.sh
Last active June 27, 2022 22:39
Addigy - "Silently" install backblaze
# Mount the DMG. Make sure you change the path to wherever your Custom Software says your file will be downloaded to.
hdiutil attach "/Library/Addigy/ansible/packages/Backblaze (1.0.0)/install_backblaze.dmg"
# Install Backblaze using their script.
sudo /Volumes/Backblaze\ Installer/Backblaze\ Installer.app/Contents/MacOS/bzinstall_mate -nogui bzdiy -signin user@corp.com 'password-goes-here'
# Unmount the DMG. The DMG will appear in Finder as a mounted drive until this command runs.
hdiutil detach /Volumes/Backblaze\ Installer
# Decompress
unzip "/Library/Addigy/ansible/packages/ABMAN Agent/" -d "/Library/Addigy/ansible/packages/ABMAN Agent/"
# Run the InstallAgent script
/Library/Addigy/ansible/packages/ABMAN\ Agent/LANrev\ Agent\ Installer\ 7_3\(MAC\)/InstallAgent.sh
@AndrewWCarson
AndrewWCarson / mac-system-analyst.sh
Created July 10, 2017 14:11
Run a basic analysis of programs, users, and hardware on a Mac.
#!/bin/sh
# Establish host and username.
HOST=`hostname`
USER=`whoami`
# Establish the correct path.
LOG_DIR="/Volumes/Carson Utilities/Logs/"
DIR="$LOG_DIR$HOST"
@AndrewWCarson
AndrewWCarson / upgrade_to_sierra.sh
Created July 10, 2017 15:12
Upgrade to macOS 10.12
/Library/Addigy/macmanage/MacManage.app/Contents/MacOS/MacManage action=notify title="Install MacOS Sierra" description="After clicking install your machine will reboot within 5-15mins." closeLabel="Later" acceptLabel="Install"
#BOOT_VOLUME=$(ls -al /Volumes/ | grep '\-> \/' | awk '{print $9}')
tar -zxvf macOS_Sierra.tar.gz -C /Applications/
chmod -R 755 "/Applications/Install macOS Sierra.app"
#"/Applications/Install macOS Sierra.app/Contents/Resources/startosinstall" --volume "/Volumes/${BOOT_VOLUME}" --applicationpath "/Applications/Install macOS.app" --agreetolicense
@AndrewWCarson
AndrewWCarson / enable_fast_user_switching.sh
Last active August 2, 2018 13:32
Enables fast user-switching for all macOS user
#!/bin/bash
# This script is designed to be run as root from a mgmt system like Addigy.
# Change the field separator to newline for usernames with directories
OIFS=$IFS
IFS=$'\n'
# Iterate through all users
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do
@AndrewWCarson
AndrewWCarson / Add Favorite Servers.sh
Last active August 23, 2018 04:46
Add Favorite Servers in macOS
#!/bin/bash
# (C) Andrew Worth Carson
# MIT License: https://andrewworthcarson.com/mit_license.html
declare -a servers=('smb://server/share' 'smb://anotherserver/anothershare')
range=$(seq 0 1 $(expr ${#servers[@]} - 1))
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do