Skip to content

Instantly share code, notes, and snippets.

View tempusthales's full-sized avatar
🤷‍♂️
It's not my fault, he made me do it...

Gilbert Palau tempusthales

🤷‍♂️
It's not my fault, he made me do it...
View GitHub Profile
@tempusthales
tempusthales / goon-auth.php
Created May 8, 2018 02:06
goon auth in php
<?php if (isset($_GET["username"])): ?>
<?php
$username = $_GET["username"];
$url = "http://forums.somethingawful.com/member.php?action=getinfo&username=$username";
$page = file_get_contents($url);
if (preg_match("/<dt>Interests<\\/dt>\s*<dd>(.*?)<\\/dd>/i", $page, $matches)) {
echo "${username}'s interests are: $matches[1]";
} else {
echo "What the heck, man";
@tempusthales
tempusthales / mrclean.sh
Created April 19, 2018 01:28
script for cleaning the keychain
#!/bin/bash
\#
\# keychain-clean.sh
\# cleans and disinfects keychains
\#
if [ -d "/Users/default/Library/Keychains" ]; then
/bin/rm -rf /Users/default/Library/Keychains
fi
/bin/mkdir /Users/default/Library/Keychains
/usr/sbin/chown default:staff /Users/default/Library/Keychains
@tempusthales
tempusthales / rename_and_bind.sh
Created April 19, 2018 01:11
Rename your Mac and then bind it to a AD Domain via Bash
#!/bin/bash
# renamer script -- use with ComputerName name below
# By Gilbert Palau, Enterprise OS X - www.enterpriseosx.com
#
# this script renames the mac by chassi type + serial number: ??-SERIAL
#
# Legend:
#
laptop="ML-"
workstation="MW-"
@tempusthales
tempusthales / mac_rename.sh
Last active September 20, 2022 14:54
rename mac's by chassis-serialnumber.domain
#!/bin/bash
#define variables
laptop="ML-"
workstation="MW-"
server="S-"
tld="your.fully.qualified.domain"
# grabbing mac serial number...
serial=$(ioreg -l |grep "IOPlaLormSerialNumber"|cut -d ""="" -f 2|sed -e s/[^[:alnum:]]//g) # and model name...
#!/bin/sh
# ipv6-off.sh
# Disable IPv6 on all interfaces.
IFS=$'\n'
net=`networksetup -listallnetworkservices | grep -v asterisk`
for i in $net
do
networksetup -setv6off "$i"
@tempusthales
tempusthales / kace-installer.sh
Created April 17, 2018 17:07
Installs KACE 6.4.180 for Mac with modifiable server settings
#!/bin/sh
#
# Kace Remover for 5.1 and 5.3 from http://derflounder.wordpress.com
# Removes the 5.1 KBox agent
# Modified on 02/03/2017
# Gilbert Palau
#
sudo /Library/StartupItems/KBOXAgent/KBOXAgent stop
sudo /Library/KBOXAgent/Home/bin/kagentctl stop 2>&1
sudo /Library/KBOXAgent/Home/bin/SMMPctl stop 2>&1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.yourcompanyorschool.drivemapper</string>
<key>Program</key>
<string>/Applications/yourcompanyorschool-Drive-Mapper.app/Contents/MacOS/applet</string>
<key>RunAtLoad</key>
<true/>
@tempusthales
tempusthales / drive_mapper.scpt
Last active March 25, 2021 10:41
map drive script for macOS
----------------------------------------------------------------------------------------------------
--
-- Drive Mapping Script
-- Original by Ben Toms | MacMule / Modified By: Gilbert Palau
--
----------------------------------------------------------------------------------------------------
-------------------------------
--- User Information Logic
-------------------------------
@tempusthales
tempusthales / allow_printers_4_all.sh
Created April 17, 2018 15:19
allow everyone to add or remove printers on a Mac
#!/bin/sh
dseditgroup -o edit -a "everyone" -t group lpadmin
exit $?
@tempusthales
tempusthales / changedline68.txt
Created March 19, 2018 22:38
Managed to Unmanaged
”/path/to/Sophos Installer.app/Contents/MacOS/Installer” — install