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 bash | |
# Only tested on Mac OSX 10.10 | |
if [ -d ~/.chef_pp ]; then | |
echo "Changing to Pre-Production Chef Environment." | |
mv ~/.chef ~/.chef_sandbox | |
mv ~/.berkshelf ~/.berkshelf_sandbox | |
mv ~/.chef_pp ~/.chef | |
mv ~/.berkshelf_pp ~/.berkshelf |
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
# Convert all flac files in all subdirs to mp3 with ffmpeg | |
find . -type f -name "*.flac" -print0 | while read -d $'\0' a; do | |
< /dev/null ffmpeg -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}" | |
done |
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
# Apply the Local Configuration Manager for DSC. | |
# DSC by default runs a consistancy check once every 15 minutes. | |
# We disable this because it causes collisions with chef-client runs. | |
powershell_script 'apply_lcm' do | |
code <<-EOH | |
configuration LCM | |
{ | |
LocalConfigurationManager | |
{ | |
ConfigurationMode = "ApplyOnly" |
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
def virtual_disk_for(vm, options) | |
if options[:datastore].to_s.empty? | |
raise ":datastore must be specified when adding a disk to a cloned vm" | |
end | |
idx = vm.disks.count | |
RbVmomi::VIM::VirtualDeviceConfigSpec( | |
:operation => :add, | |
:fileOperation => :create, | |
:device => RbVmomi::VIM.VirtualDisk( | |
:key => idx, |
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/sh | |
# See: https://github.com/sferik/t on installation instructions | |
spammer_list=$(t search all SEARCH_QUERY | awk '/YOUR REGEX HERE, MATCH TWEET TEXT/{print x};{x=$0}') | |
for spammer in $spammer_list; do | |
#echo $spammer # test first before reporting everyone in the world | |
t report_spam $spammer | |
done |
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
iis_ws_config = "#{node['app']['file_cache_path']}\\iis_ws_config.ps1" | |
template iis_ws_config do | |
source 'iis_ws_config.ps1.erb' | |
variables( | |
ws_pool_user: env_credentials['ws_pool_user'], | |
ws_pool_pswd: env_credentials['ws_pool_pswd'], | |
site_name: ws['site_name'], | |
site_path: ws['site_path'], | |
formservice_path: ws['formservice_path'], | |
formsetservice_path: ws['formsetservice_path'], |
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
configuration iis_ws_config | |
{ | |
Import-DscResource -Module xWebAdministration | |
xWebsite DefaultWebSite | |
{ | |
Name = "<%= @site_name %>" | |
Ensure = "Present" | |
PhysicalPath = "<%= @site_path %>" | |
State = "Started" |
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
if (platform_family? 'windows') && (node['kernel']['name'] == 'Microsoft Windows Server 2012 R2 Standard') | |
# Apply the Local Configuration Manager for DSC. | |
# DSC by default runs a consistancy check once every 15 minutes. | |
# Disable this because it causes collisions with chef-client runs. | |
powershell_script 'apply_lcm' do | |
code <<-EOH | |
configuration LCM | |
{ | |
LocalConfigurationManager |
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
class MyPrint: | |
def __init__(self): | |
pass | |
def myPrint(self): | |
for item in range(10): | |
print("This is the item at " + str(item) + " .") | |
return True |
OlderNewer