This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Jacob Salmela | |
# 2016-06-02 | |
# Writes text to a PDF at coordinates. Use for quickly filling out forms that you use regularly. | |
# This takes some manual setup, but saves a ton of time once done | |
# http://stackoverflow.com/a/17538003 | |
# Make sure to install the two utilities below first | |
# sudo easy_install pyPdf | |
# sudo easy_install reportlab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample configuration for dnsmasq to function as a proxyDHCP server, | |
# enabling LTSP clients to boot when an external, unmodifiable DHCP | |
# server is present. | |
# The main dnsmasq configuration is in /etc/dnsmasq.conf; | |
# the contents of this script are added to the main configuration. | |
# You may modify the file to suit your needs. | |
# Don't function as a DNS server: | |
port=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo select disk 0 > diskpart%ID%.txt | |
echo clean >> diskpart%ID%.txt | |
echo ** Creating system reserved partition... | |
echo create partition primary size=500 >> diskpart%ID%.txt | |
echo select partition 1 >> diskpart%ID%.txt | |
echo active >> diskpart%ID%.txt | |
echo format quick fs=ntfs >> diskpart%ID%.txt | |
echo assign letter="r" >> diskpart%ID%.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Jacob Salmela | |
# 2016-03-12 | |
# Convert annoying DOCX into PDFs with a right-click | |
# Run this as an Automator Service | |
###### SCRIPT ####### | |
for f in "$@" | |
do | |
# Get the full file PATH without the extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osascript <<EOT | |
display dialog "MD5: | |
$(openssl md5 $1 | awk '{print $2}') | |
SHA1: | |
$(openssl sha1 $1 | awk '{print $2}') | |
SHA256: | |
$(openssl dgst -sha256 $1 | awk '{print $2}')" with title "$(basename $1)" with icon Caution | |
EOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Foundation import NSKeyedUnarchiver | |
from struct import unpack | |
# This entire function is black magic of the highest order and I'll blog about it later | |
def extract_share(bookmark_data): | |
content_offset, = unpack('I', bookmark_data[12:16]) | |
first_TOC, = unpack('I', bookmark_data[content_offset:content_offset+4]) | |
first_TOC += content_offset | |
TOC_len, rec_type, level, next_TOC, record_count = unpack('IIIII', bookmark_data[first_TOC:first_TOC+20]) | |
TOC_cursor = first_TOC + 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apiKey="abcD12345efGhIJkLmn-abcD12345efGhIJkLmn_cO_8" | |
filename=$(basename "$1") | |
filename="${filename%.*}" | |
directoryname=$(dirname "$1") | |
latitude=$(mdls "$1" | awk '/Latitude/ {print $3}') | |
longitude=$(mdls "$1" | awk '/Longitude/ {print $3}') | |
data=$(curl -s https://maps.googleapis.com/maps/api/geocode/json?latlng="$latitude","$longitude"&key="$apiKey") | |
city=$(echo "$data" | grep "formatted_address" | head -1 | cut -d',' -f2 | sed -e 's/^[ \t]*//') | |
case "$city" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#----------AUTHOR------------ | |
# Jacob Salmela | |
# 02 March 2015 | |
#-----------IMPORTS---------- | |
from os import system | |
from subprocess import call | |
from socket import gethostname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bud='/usr/libexec/Plistbuddy' | |
plist=$HOME'/Library/Preferences/com.apple.sidebarlists.plist' | |
servers=('afp://servername' | |
'smb://servername' | |
'vnc://servername' | |
'ftp://servername') | |
killall cfprefsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osascript -e 'tell application "system events" to delete login items' |