Skip to content

Instantly share code, notes, and snippets.

@edingc
edingc / gist:3075923
Created July 9, 2012 11:29
Supressing Adobe Reader X EULA and Disabling Updates on Mac OS X using PlistBuddy
#!/bin/bash
# Disables Adobe Reader X EULA and automatic update checks
USERPREFS_DIR="/System/Library/User Template/English.lproj/Library/Preferences"
/usr/libexec/PlistBuddy -c "Delete 10:EULAAccepted" "${USERPREFS_DIR}/com.adobe.Reader.plist"
/usr/libexec/PlistBuddy -c "Add 10:EULAAccepted bool TRUE" "${USERPREFS_DIR}/com.adobe.Reader.plist"
/usr/libexec/PlistBuddy -c "Delete 10:AVGeneral:CheckForUpdatesAtStartup:1" "${USERPREFS_DIR}/com.adobe.Reader.plist"
/usr/libexec/PlistBuddy -c "Add 10:AVGeneral:CheckForUpdatesAtStartup array" "${USERPREFS_DIR}/com.adobe.Reader.plist"
@edingc
edingc / pdf2jpg.sh
Created July 9, 2012 21:53
Batch Convert PDFs to JPEGs using the Poppler library and ImageMagick
#!/bin/sh
##############################################################################
####
#### Convert PDFs to JPEGs using the Poppler library and ImageMagick
####
#### This script converts a folder full of PDFs to JPEGs using libpoppler and
#### ImageMagick. In this case, PDFs are coverted at 150 dpi and outputted as
#### 85 percent quality JPEGs with a maximum width of 800 pixels. Edit these
#### values to suit your environment.
@edingc
edingc / gist:3100118
Created July 12, 2012 18:54
Google Chrome Master Preferences file for Enterprise Deployment
{
"homepage" : "http://www.codyeding.com",
"homepage_is_newtabpage" : false,
"browser" : {
"show_home_button" : true,
"check_default_browser" : false,
"show_update_promotion_info_bar" : false
},
"session" : {
"restore_on_startup" : 4,
@edingc
edingc / gist:3100143
Created July 12, 2012 18:57
Client-friendly WordPress administration URL rewrites in nginx
location /{
# Other rules here...
rewrite ^/[Ll][Oo][Gg][Ii][Nn]$ /login/ permanent;
rewrite ^/[Ll][Oo][Gg][Ii][Nn]/$ /wp-login.php permanent;
}
@edingc
edingc / gist:3105837
Created July 13, 2012 16:35
Munki Installs Keys for Adobe Creative Suite 3 Design Premium
<key>installs</key>
<array>
<dict>
<key>CFBundleIdentifier</key>
<string>com.adobe.Acrobat.Pro</string>
<key>CFBundleName</key>
<string>Acrobat</string>
<key>CFBundleShortVersionString</key>
<string>8.0.0</string>
<key>path</key>
@edingc
edingc / mindstorms-nxt-pkginfo
Created September 19, 2012 12:00
Munki PKGINFO for Lego Mindstorms NXT 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>autoremove</key>
<false/>
<key>catalogs</key>
<array>
<string>production</string>
</array>
@edingc
edingc / diskpart
Last active January 4, 2016 03:39
Recovery console diskpart commands to get Server 2012/2012R2 to start following GhettoVCB/BazaarVCB restores.
diskpart
list vol
sel vol 2
attributes volume clear hidden readonly nodefaultdriveletter shadowcopy
sel vol 3
attributes volume clear hidden readonly nodefaultdriveletter shadowcopy
exit
recovery\startrep.exe
@edingc
edingc / bootstrap_ansible.sh
Created January 24, 2014 16:46
CentOS shell script to automatically enable EPEL repository, update the system and install Ansible for configuration management. Useful to bootstrap a system in preparation for Ansible configuration.
#!/bin/bash
# Download and install EPEL repository.
/usr/bin/wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
/usr/bin/yum -y install epel-release-6*.rpm
# Fully update the system and install Ansible
/usr/bin/yum -y update
/usr/bin/yum -y install ansible
<?php
if ( ( $_GET["var1"] != '' ) || ( $_GET["var2"] != '' ) || ( $_GET["var3"] != '' ) ) {
if ( $_GET["var1"] != '' ) {
$meta_query[] = array( 'key' => 'meta_value1', 'value' => $_GET["var1"], 'compare' => '=' );
}
if ( $_GET["var2"] != '' ) {
$meta_query[] = array( 'key' => 'meta_value2', 'value' => $_GET["var2"], 'compare' => '=' );
@edingc
edingc / Get-PublicFolderOwners.ps1
Last active August 29, 2015 14:09
PoSh One-Liner to Export Top-Level Public Folders and Owners to CSV
Get-PublicFolder -Recurse | Where-Object { $PSItem.ParentPath -eq "\" } | Get-PublicFolderClientPermission | Where-Object { $PSItem.AccessRights -contains "Owner" } | Export-CSV .\PF_Owners.csv -NoTypeInformation