Skip to content

Instantly share code, notes, and snippets.

@stuartf7
stuartf7 / install.sh
Created January 6, 2017 09:41
amazon linux install .net core preview 4
curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=837969
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
find /opt/dotnet/ -type f -name "*.dll" -exec sudo chmod 644 {} \;
sudo rm -rf dotnet.tar.gz
# get the teamcity startup script
wget -O teamcity https://gist.github.com/stuartf7/4999497/raw
# move the script into the init.d folder and set required permissions
sudo mv teamcity /etc/init.d/teamcity
sudo chown root:root /etc/init.d/teamcity
sudo chmod 755 /etc/init.d/teamcity
export TEAMCITY_DATA_PATH="/data/teamcity"
case $1 in
start)
/var/teamcity/bin/teamcity-server.sh start
;;
stop)
/var/teamcity/bin/teamcity-server.sh stop
;;
# Apply updates to the instance
sudo yum -y update
@stuartf7
stuartf7 / server.diff
Last active December 12, 2015 12:49
Configuring the TeamCity Server to run on port 80.
- <Connector port="8111" protocol="HTTP/1.1"
+ <Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
enableLookup="false"
useBodyEncodingForURI="true"
/>
@stuartf7
stuartf7 / mount-ebs-for-teamcity-data-dir.sh
Last active December 12, 2015 12:48
Mount a new EBS volume for use as a TeamCity Data Directory in Amazon Linux.
# Create the new filesystem
sudo mkfs -t ext4 /dev/sdf
# Create a directory to mount the filesystem
sudo mkdir -p /data
# Update fstab file
echo '/dev/sdf /data ext4 defaults 0 0' | sudo tee -a /etc/fstab
# Mount the new filesystem
@stuartf7
stuartf7 / install-teamcity.sh
Last active December 12, 2015 12:39
Installing TeamCity on Amazon Linux
# Download TeamCity 7.1.5
wget http://download.jetbrains.com/teamcity/TeamCity-7.1.5.tar.gz
# Extract the downloaded file
tar -xvzf TeamCity-7.1.5.tar.gz
# Tidy up the folder name and move it to a sensible location /var/teamcity
mv TeamCity teamcity
sudo mv teamcity /var/.
@stuartf7
stuartf7 / install-oracle-jdk.sh
Last active December 12, 2015 12:38
Installing Oracle JSDK 1.6 (32bit) on Amazon Linux
# Download Java (Note the required cookie to accept Oracle's license)
wget -O jdk-6u39-linux-i586-rpm.bin --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk-6u39-download-1501626.html;" http://download.oracle.com/otn-pub/java/jdk/6u39-b04/jdk-6u39-linux-i586-rpm.bin
# Install Oracle Java
chmod +x jdk-6u39-linux-i586-rpm.bin
sudo sh jdk-6u39-linux-i586-rpm.bin
# Create an alternative for Java for Oracle JDK
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_39/bin/java 20000
sudo /usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_39/bin/javac 20000
@stuartf7
stuartf7 / SelectTests.cs
Created July 4, 2012 16:28
Selenium Select Unit Tests
using System.Collections.Generic;
using System.Collections.ObjectModel;
using NMock2;
using NUnit.Framework;
namespace OpenQA.Selenium.Support.UI
{
[TestFixture]
public class SelectTests
{
@stuartf7
stuartf7 / example.cs
Created July 4, 2012 16:27
Selenium Select Example Use
Select select = new Select(webElement);
select.SelectByText("Select Me");