Skip to content

Instantly share code, notes, and snippets.

@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
#!/usr/bin/python
__author__ = 'Zack Smith @acidprime'
__version__ = '1.0'
import plistlib
import subprocess
system_profiler = '/usr/sbin/system_profiler'
spx_key = 'spdisplays_display-serial-number'
@rockpapergoat
rockpapergoat / EnCase
Created June 21, 2012 15:52
encase pkg parts
#!/bin/sh
. /etc/rc.common
StartService ()
{
ConsoleMessage "Starting EnCase Servlet"
/usr/local/sbin/enosxintel -d -p /usr/local/sbin
}
StopService ()
{
ConsoleMessage "Stopping EnCase Servlet"
@rtrouton
rtrouton / gist:5303232
Created April 3, 2013 17:19
MCX debug reporting script
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH
# Define the recipient.
RECIP="email@address.here"
# That should be it for the necessary configuration part. The rest can be pretty much as-is.
NAME=`hostname`
LOGS="/tmp/tomcat-restart.txt"
HWLOGDATE=$(printf "`date "+%a %h %e"` \n")
@gregneagle
gregneagle / gist:6957826
Last active July 24, 2024 09:28
Using PyObjC and NSWorkspace to set the desktop picture. I am such a hypocrite!
#!/usr/bin/python
'''Uses Cocoa classes via PyObjC to set a random desktop picture on all screens.
Tested on Mountain Lion and Mavericks.
See:
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html
@erikng
erikng / swupd.conf
Last active December 26, 2015 10:58
Mountain Lion Server - Maverick Client Support
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} Darwin/9
RewriteRule ^/index\.sucatalog$ http://%{HTTP_HOST}/cgi-bin/SoftwareUpdateServerGetCatalog?/index-leopard.merged-1.sucatalog
RewriteCond %{HTTP_USER_AGENT} Darwin/10
RewriteRule ^/index\.sucatalog$ http://%{HTTP_HOST}/cgi-bin/SoftwareUpdateServerGetCatalog?/index-leopard-snowleopard.merged-1.sucatalog
RewriteCond %{HTTP_USER_AGENT} Darwin/11
RewriteRule ^/index\.sucatalog$ http://%{HTTP_HOST}/cgi-bin/SoftwareUpdateServerGetCatalog?/index-lion-snowleopard-leopard.merged-1.sucatalog
RewriteCond %{HTTP_USER_AGENT} Darwin/12
RewriteRule ^/index\.sucatalog$ http://%{HTTP_HOST}/cgi-bin/SoftwareUpdateServerGetCatalog?/index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
@arunoda
arunoda / gist:7790979
Last active February 16, 2024 14:05
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@bryanzak
bryanzak / ScriptRunner.sh
Last active May 9, 2017 21:44
Script Runner. This is a Launch Agent and script launcher so we can have a folder of scripts that are run anytime a user logs in. This is very barebones and not even remotely fancy, please feel free to share any feedback or suggestions you might have. Updated 2014-03-04 to support logging
#!/bin/bash
# save this file at /Library/yourorg/ScriptRunner.sh
script_path="${0}"
source_path=$(dirname "${script_path}")
chmod 777 "/var/log/yourorg-scriptrunner.log"
if [ -d "${source_path}/User Login Scripts" ]; then
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active July 25, 2024 18:52
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@MagerValp
MagerValp / swuprun.sh
Created November 14, 2014 19:38
Start a linked clone of a VM and list available software updates.
#!/bin/bash
#
# Start a linked clone of a VM and list available software updates.
declare -r FUSION_PATH="/Applications/VMware Fusion.app"
declare -r GUEST_USER="swup"
declare -r GUEST_PASSWORD="swup"
# Exit status constants.