Skip to content

Instantly share code, notes, and snippets.

View wegotoeleven's full-sized avatar
🥶
TCOB

Stephen Warneford-Bygrave wegotoeleven

🥶
TCOB
View GitHub Profile
@wegotoeleven
wegotoeleven / getConnectedWifi.sh
Last active August 5, 2022 21:24
Get connected WiFi
# Check connected wifi
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep SSID
@wegotoeleven
wegotoeleven / jamfProMySQLCommands.sh
Last active August 5, 2022 21:24
Jamf Pro MySQL commands
# Find failed commands
select count(*) from mobile_device_management_commands where apns_result_status='Error';
# Find failed VPP commands
select count(*) from mobile_device_management_commands where command='InstallApplication' and apns_result_status='Error';
# Show devices with failed commands
select device_id from mobile_device_management_commands where apns_result_status='Error';
# Show devices with failed VPP commands
@wegotoeleven
wegotoeleven / installMacPorts.sh
Last active August 5, 2022 19:55
Install MacPorts
# Download
https://www.macports.org/install.php
# Uncompress
tar xjvf MacPorts-2.7.2.tar.bz2
# Install
cd MacPorts-2.7.2
./configure --prefix=${HOME}/.macports --with-install-user=${USER} --with-install-group=staff
make && make install
@wegotoeleven
wegotoeleven / globalPreferences.sh
Last active August 5, 2022 19:19
Global Preferences
# Show all
defaults domains | tr ',' '\n'
# Global prefs
$(defaults read -g AppleLocale)
# is the same as
$(defaults read .GlobalPreferences AppleLocale)
# is the same as
@wegotoeleven
wegotoeleven / showOpenConnections.sh
Last active August 5, 2022 19:12
Show open connections
# Show connections
netstat -tn 2>/dev/null | grep :8443 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head
# Show routing table
netstat -nr
# Show all connections
netstat -na
@wegotoeleven
wegotoeleven / readPowershellLog.ps1
Last active August 5, 2022 19:12
Read Powershell log
Get-Content "C:\Program Files\JSS\Logs\JAMFSoftwareServer.log" -Wait
@wegotoeleven
wegotoeleven / runmacOSSetupAssistant.sh
Created August 5, 2022 19:10
Run macOS Setup Assistant in user space
sudo /System/Library/CoreServices/Setup\ Assistant.app/Contents/MacOS/Setup\ Assistant -MBDebug
@wegotoeleven
wegotoeleven / tmuxScreenSharing.sh
Created August 5, 2022 19:08
Tmux screen sharing
read -p "Session name: " nameOfSession
# Create socket
touch /tmp/${nameOfSession} && chgrp serveradmins /tmp/${nameOfSession}
# Create session
tmux -CC -S /tmp/${nameOfSession} new -s ${nameOfSession}
# Connect to the session from the second terminal
tmux -S /tmp/${nameOfSession} attach -t ${nameOfSession}
@wegotoeleven
wegotoeleven / connectToSMB.sh
Last active August 5, 2022 19:06
Mount stuff
# As other user
open smb://other_username:*@server.name.here
@wegotoeleven
wegotoeleven / checkSSHFailures.sh
Created August 5, 2022 16:42
Check SSH failures
# Connect to server
grep sshd.\*Failed /var/log/auth.log | less