Skip to content

Instantly share code, notes, and snippets.

View writeameer's full-sized avatar

Ameer Deen writeameer

View GitHub Profile
@writeameer
writeameer / app2.cs
Last active December 2, 2016 02:12
app2.cs
using Microsoft.Azure.Management.ResourceManager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Rest;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Network.Models;
public void AppGateway() {
var resourceGroup = "blah";
var location = "Australia East";
var netClient = new NetworkManagementClient(credential) { SubscriptionId = Lookup.subscriptionId };
// Create IP for gateway
var ipParams = new PublicIPAddress{Location = location ,PublicIPAllocationMethod = "Dynamic" };
var newIp = netClient.PublicIPAddresses.CreateOrUpdate(resourceGroup, "appGatewayFrontendIP", ipParams);
Console.WriteLine(newIp.IpAddress);
# Enter-PSSession by default connects to 5985 (Insecure, HTTP)
# Azure by default, however, only opens up port 5986 which is for secure communications
# So just doing a Enter-PSSession <host> will likely fail complaining
# about network connectivity since 5985 is not open.
# Shortest (Insecure, HTTP)
# Assumes your local username/pwd same as Azure username/pawd
# Use Azure portal to create an endpoint for opening up port 5985
Enter-PSSession cloudmanvm1.cloudapp.net
@writeameer
writeameer / test.cs
Created June 25, 2012 07:27
Logging
internal class Logger
{
public static void Info(string p0)
{
Console.WriteLine(p0);
}
public static void Error(string couldNotLogIntoXmppServer)
{
Console.WriteLine(couldNotLogIntoXmppServer);
@writeameer
writeameer / program.cs
Created July 8, 2011 01:09
RightScale API sample
using System;
using System.Net;
using System.IO;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
@writeameer
writeameer / InstallRightLink57.ps1
Created June 24, 2011 04:49
This script installs RightLink 5.7 on a Windows Server 2008 R2 Server Core machine
###
# This script installs RightLink on a Windows Server 2008 R2 Server Core machine
function Download-File
{
param (
[parameter(Mandatory=$true)] $url
)
$fileName = $url.Split("/")[-1]
@writeameer
writeameer / git_install_windows.ps1
Created November 13, 2010 09:16
A powershell scripts that installs git tools on windows and adds it to your path
# Set download URLs
$git_download_url = "http://msysgit.googlecode.com/files/PortableGit-1.7.3.1-preview20101002.7z"
$7zip_download_url = "http://downloads.sourceforge.net/sevenzip/7za465.zip"
# Create Software folder
$software_folder = "$env:SystemDrive\software"
mkdir -force $software_folder
# Create temp folder
$temp_folder = "$env:userprofile\temp\install_git"