Skip to content

Instantly share code, notes, and snippets.

View rickychilcott's full-sized avatar

Ricky Chilcott rickychilcott

View GitHub Profile
@rickychilcott
rickychilcott / Mac OS X - Print first mac address
Created February 18, 2011 17:58
Shell script to print the first available mac address found by ifconfig
ifconfig | grep ether | awk '{if (NR==1) {print $2}}'
@rickychilcott
rickychilcott / Mac OS X - Print first mac address
Created March 1, 2011 17:46
Shell script to print the first available mac address found by ifconfig
ifconfig en0 | awk '/ether/ {print $2}'
@rickychilcott
rickychilcott / Mac System Profiler Scripts
Created March 16, 2011 20:50
Ways to use system profiler on a mac to get information about your system
#Full output of system_profiler
system_profiler -xml -detailLevel full > ~/Desktop/full.spx
#Network and Hardware specific data found in system_profiler
system_profiler -xml SPNetworkDataType SPHardwareDataType > ~/Desktop/network_hardware.spx
#Only software registered on the system
system_profiler -detailLevel full -xml SPApplicationsDataType > ~/Desktop/software.spx
@rickychilcott
rickychilcott / Apple GSX Warranty Info
Created March 28, 2011 01:58
Contact's Apple's selfserve servers to capture warranty information about your product. Accepts arguments of machine serial numbers.
#!/usr/bin/env ruby
#
# File: Warranty.rb
#
# Decription: Contact's Apple's selfserve servers to capture warranty information
# about your product. Accepts arguments of machine serial numbers.
# Contributed by Gary Larizza
require 'open-uri'
require 'openssl'
@rickychilcott
rickychilcott / gist:1267912
Created October 6, 2011 16:48
Fixing hostnames for MunkiServer
Computer.all.each{|c|
if c.hostname == ""
c.hostname = c.name
end
if !c.valid?
c.hostname.downcase!
c.hostname.strip!
c.hostname.sub! /[_\s]/, '-'
@rickychilcott
rickychilcott / gist:1278365
Created October 11, 2011 15:17
Munki Secure Config
#Make Secure Munki Directory
sudo mkdir -p /var/munki/Managed\ Installs
sudo chown root:wheel /var/munki/Managed\ Installs
sudo chmod 750 /var/munki/Managed\ Installs
#Setup secure Munki Directory
sudo defaults write /Library/Preferences/ManagedInstalls ManagedInstallDir "/var/munki/Managed Installs"
@rickychilcott
rickychilcott / gist:1371025
Created November 16, 2011 19:15
Test Gist
<xml>
</xml>
@rickychilcott
rickychilcott / gist:1372361
Created November 17, 2011 04:28
Active Admin Ideas
ActiveAdmin.register User, :as => "Customer" do
filter :username
filter :email
filter :created_at
index do
id_column
column :username
column :email
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Munki Server: index</title>
<link href="/assets/blueprint/reset.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/blueprint/grid.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/blueprint/typography.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/blueprint/forms.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/blueprint/index.css?body=1" media="screen" rel="stylesheet" type="text/css" />
#!/bin/bash
PRODUCT=Maya
YEAR=2012
LIC=/private/var/flexlm/${PRODUCT}${YEAR}.lic
PRODCODE=657D1
SERIAL=123-4567890
SERVER=server.domain.com
LICENSEENV=/Applications/Autodesk/maya${YEAR}/${PRODUCT}.app/Contents/License.env