Skip to content

Instantly share code, notes, and snippets.

View claylo's full-sized avatar

Clay Loveless claylo

View GitHub Profile
@claylo
claylo / prep_jira_proxy.sh
Created April 27, 2011 01:08
Perform the steps to get JIRA ready to be proxied and locked down to localhost and using MySQL
# we'll only have IPv4 addresses to look for
sed -i -e 's/standalone=JIRA/standalone=JIRA -Djava.net.preferIPv4Stack=true/' jira/bin/setenv.sh
# block anyone not on localhost IP
sed -i -e '/<Context>/ a\
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\\.0\\.0\\.1" />
' jira/conf/context.xml
# make sure Tomcat knows it's behind a proxy
# UPDATE THIS FOR YOUR ATLASSIAN SUITE SERVER HOSTNAME
@claylo
claylo / jira_crowd_prep.sh
Created April 29, 2011 01:34
Configure JIRA for Crowd SSO
# Configure JIRA property files for SSO
# RUN THESE COMMANDS FROM ~/Apps
# sort of uncomment the right line, and comment the right line
sed -i -e '
/CROWD:START.*SSOSeraphAuthenticator/ {
a\
\ <authenticator class="com.atlassian.jira.security.login.SSOSeraphAuthenticator"/>
}
' -e 's/^\(.*login.JiraSeraphAuthenticator.*\)$/<!-- & -->/' jira/atlassian-jira/WEB-INF/classes/seraph-config.xml
@claylo
claylo / confluence_setup.sh
Created May 3, 2011 21:13
Confluence OS X setup script for Atlassian Dragons
# su atlassian
# cd ~/Apps
# Get Confluence
curl -L -O http://www.atlassian.com/software/confluence/downloads/binary/confluence-3.5.2-std.tar.gz
tar -xzf confluence-3.5.2-std.tar.gz
# Symlink so we can just call it "confluence"
# NOTE: this is what Atlassian docs refer to as the Confluence Installation Directory
# or <confluence-install>
@claylo
claylo / confluence.sql
Created May 3, 2011 21:16
Atlassian Confluence database & user creation for MySQL
#
# You will want to pick a real password here!
#
CREATE USER 'confluenceuser'@'localhost' IDENTIFIED BY 'some_pass';
CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON confluence.* to 'confluenceuser'@'localhost';
FLUSH PRIVILEGES;
# In case you forgot to change the password above...
# SET PASSWORD for 'confluenceuser'@'localhost' = PASSWORD('someother_pass');
@claylo
claylo / set_confluence_home.sh
Created May 3, 2011 21:29
Set confluence.home in the app properties
# Confluence comes with all defaults commented out, so we just add an
# uncommented entry with a little vertical whitespace breathing room
echo '' >> confluence/confluence/WEB-INF/classes/confluence-init.properties
echo 'confluence.home=/Users/atlassian/Documents/confluence' >> confluence/confluence/WEB-INF/classes/confluence-init.properties
@claylo
claylo / prep_confluence_proxy.sh
Created May 3, 2011 22:19
Perform the steps to get Confluence ready to be proxied and locked down
# JIRA and Confluence have the same default ports. So, let's avoid a conflict.
sed -i -e 's/8000/8015/g' confluence/conf/server.xml
sed -i -e 's/8080/8090/g' confluence/conf/server.xml
# Restrict to localhost addresses, nevermind about IPv6
sed -i -e 's/headless=true/headless=true -Djava.net.preferIPv4Stack=true/' confluence/bin/setenv.sh
# Block anyone not on localhost IP
sed -i -e '/<Context>/ a\
\ <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\\.0\\.0\\.1" />
@claylo
claylo / confluence_crowd_prep.sh
Created May 14, 2011 20:20
Configure Confluence for Crowd SSO
# Configure Confluence property files for SSO
# RUN THESE COMMANDS FROM ~/Apps
# shutdown confluence
confluence/bin/shutdown.sh
# inject the right line, and comment the line we do not want
sed -i -e '
/Crowd single-sign on/ {
a\
@claylo
claylo / launchd_wrapper.sh
Created June 1, 2011 17:44
launchd wrapper for Atlassian JIRA on OS X
#!/bin/bash
function shutdown()
{
date
echo "Shutting down JIRA"
$JIRA_HOME/bin/stop-jira.sh
}
date
echo "Starting JIRA"
@claylo
claylo / jira.plist
Created June 1, 2011 17:45
LaunchDaemon for Atlassian JIRA
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" >
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>JIRA_HOME</key>
<string>/Users/atlassian/Apps/jira</string>
@claylo
claylo / cf-invalidate.php
Created June 5, 2011 17:09
How to invalidate items in AWS CloudFront
<?php
/**
* Super-simple AWS CloudFront Invalidation Script
*
* Steps:
* 1. Set your AWS access_key
* 2. Set your AWS secret_key
* 3. Set your CloudFront Distribution ID
* 4. Define the batch of paths to invalidate
* 5. Run it on the command-line with: php cf-invalidate.php