Skip to content

Instantly share code, notes, and snippets.

@davidwesst
Last active August 29, 2015 14:21
Show Gist options
  • Save davidwesst/f9e998bbdaa661b28174 to your computer and use it in GitHub Desktop.
Save davidwesst/f9e998bbdaa661b28174 to your computer and use it in GitHub Desktop.
Script to connect and start up a VM in Windows Azure
## IDE Free, presentation demos
This gist contains sample scripts of the terminal demos used throughout the presentation.
mvn archetype:generate -DgroupId=ca.prdc -DartifactId=java-webapp -DarchetypeArtifactId=maven-archetype-webapp
mvn clean install
<!-- Add this to the "build" section of your POM.xml -->
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://dw-tomcat.azurewebsites.net/manager/text</url>
<username>prdc</username>
<password>prdc2015</password>
</configuration>
</plugin>
</plugins>
#
# CVS Commands
#
# initialize repository and module
cvs -d ~/prdc/cvsrepo init
mkdir ~/prdc/cvsrepo/awesomeproject
# checkout module into sandbox
cvs -d /cygdrive/c/prdc/cvssandbox checkout awesomeproject
# add and commit
cd ~/prdc/cvssandbox/awesomeproject
cvs add hello.md
cvs commit -lm "First commit to CVS"
#
# Git Commands
#
# intialize new repository
git init
# clone
git clone <repository URL> awesomegit
cd awesomegit
# add and commit
git add . --all
git push origin master
# branch
git checkout -b my-branch
git branch
#!/bin/bash
#
# This starts an Azure VM and lists the necessary information to SSH into into
# -- David Wesst
# -- (2015) Prarie Dev Con - Regina, SK
#
echo "Hello there! This script will login to Windows Azure, and start a VM for you."
echo -n "Enter the account name that owns the VM and press [ENTER]: "
read accountname
echo -n "Enter the name of the VM to start and press [ENTER]: "
read vmname
echo -n "Enter your username and press [ENTER]: "
read username
echo -n "Enter your password and press [ENTER]: "
read -s pass
echo -n "Executing script...."
azure login -u "$username" -p "$pass"
azure account set "$accountname"
azure vm start "$vmname"
azure vm list
azure vm endpoint list "$vmname"
echo -n "Script Complete...."
# demonstrate connecting via ssh
# ssh <username>@<vmname>.cloudapp.net -p <port>
#!/bin/bash
#
# This uses Maven to generate a project using a template, and installs the defined dependencies
# -- David Wesst
# -- (2015) Prarie Dev Con - Regina, SK
#
mvn archetype:generate -DgroupId=ca.prdc -DartifactId=java-quickstart -DarchetypeArtifactId=maven-archetype-quickstart
mvn clean install
mvn test
mvn package
java -cp target/java-quickstart-1.0-SNAPSHOT.jar ca.prdc.App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment