Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
WCplistFile="/Users/eclassoom/Library/Group Containers/EG27766DY7.com.wacom.WacomTabletDriver/Library/Preferences/com.wacom.wacomtablet.prefs"
/usr/libexec/PlistBuddy -c "set :'WDCAutoStart' false" "${WCplistFile}"

Keybase proof

I hereby claim:

  • I am wartz on github.
  • I am joeschlimmer (https://keybase.io/joeschlimmer) on keybase.
  • I have a public key ASBAqLMhmxUjqlmbhyThC_Sp5SD1uB9yFSeovahetAvlQgo

To claim this, I am signing this object:

@Wartz
Wartz / tm.sh
Last active January 15, 2022 13:56
#!/bin/sh
enabled=`/usr/bin/defaults read /Library/Preferences/com.apple.TimeMachine AutoBackup`
if [ "$enabled" == "1" ];then
lastBackupTimestamp=`date -j -f "%a %b %d %T %Z %Y" "$(/usr/libexec/PlistBuddy -c "Print Destinations:0:SnapshotDates" /Library/Preferences/com.apple.TimeMachine.plist | tail -n 2 | head -n 1 | awk '{$1=$1};1')" "+%Y-%m-%d %H:%M:%S"`
echo "$lastBackupTimestamp"
else
echo "<result>Disabled</result>"
fi
#!/bin/bash
loggedInUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
/bin/cat << EOF > "/Users/$loggedInUser/Library/LaunchAgents/com.myorg.myapp.plist"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
@Wartz
Wartz / set-desktopshortcut.ps1
Created March 25, 2020 14:00
Create a desktop shortcut in the Users\Public\Desktop folder
## Ripped out of an installer script for CapIQ in SB 120 and 105
## Insert your silent install commands here
# Create a desktop shortcut after the app is installed.
function set-shortcut {
param ( [string]$SourceLnk, [string]$DestinationPath )
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($SourceLnk)
$Shortcut.TargetPath = $DestinationPath
@Wartz
Wartz / encrypt text with openssl.md
Created March 6, 2020 14:17
encrpt text with openSSL for use in Jamf script paramters.

Encrypt text or files with OpenSSL

This has been very useful for Jamf policy / script parameters that contain passwords. It's not perfect because the passphrase and salt must be transferred as well, but at least it's not in cleartext...

Salt and passphrase

You can use OpenSSL to generate psuedo-random text which is more than enough for this tbh considering all the other problems this solution has. I believe the salt cant be more than 8 characters long cuz it's a hexidecimal value. Or it could be that both the salt and the passphrase need to be a valid hex string which means they could be longer just have to be a specific length. (Idk I could be entirely wrong on this).

Just do 8 and 12, I know that works.

<key>Accessibility</key>
<array>
<dict>
<key>Allowed</key>
<true/>
<key>CodeRequirement</key>
<string>anchor apple generic and identifier "com.wacom.TabletDriver" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = EG27766DY7)</string>
<key>Comment</key>
<string></string>
<key>Identifier</key>
@Wartz
Wartz / PKGBUILD
Created October 23, 2015 15:52
lib32-libusb-1.0.20
# Maintainer: Sven-Hendrik Haase <[email protected]>
# Contributor: 3V0LU710N <db_eee-at-hotmail-dot-com>
pkgname=lib32-libusb
pkgver=1.0.20
pkgrel=1
pkgdesc="A cross-platform user library to access USB devices (32-bit)"
arch=('x86_64')
url="http://libusb.info/"
license=('LGPL')
joe@Joe-Arch-20150109 ~ % sup
/home/joe/.gem/ruby/2.2.0/gems/sup-0.21.0/lib/sup/modes/thread_index_mode.rb:1030: warning: else without rescue is useless
Error: the index is locked by another process! User 'joe' on
host 'Joe-Arch-20150109' is running /home/joe/.gem/ruby/2.2.0/bin/sup with pid 8698.
The process was alive as of at least 2 seconds ago.
Should I ask that process to kill itself (y/n)? y
Let's try that again.
I couldn't lock the index. The lockfile might just be stale.
Should I just remove it and continue? (y/n) y
@Wartz
Wartz / mkpl
Last active August 29, 2015 14:17
Create a playlist of media files in a specified folder
#!/bin/bash
if [ "$#" -gt 0 ] ; then
find "$1" -maxdepth 1 -type f -iregex ".*\.\(aac\|flac\|mp3\|ogg\|wav\|mp4\|mkv\|avi\)$" > "$1"/playlist
else
echo "Please provide a foldername";
fi