PowerShell script to add a disk on Azure VM

  $rgName = ‘testingsan’ $vmName = ‘testingsan’ $location = ‘myAzureLocation’ $storageType = ‘StandardLRS’   Function Dateformat {        $date =Get-Date -UFormat “%y%m%d%H%M”      $date.ToString()      }   $df = Dateformat     $dataDiskName = $vmName + ‘_datadisk’+‘_’+$df   $diskConfig = New-AzureRmDiskConfig -AccountType $storageType -Location $location -CreateOption Empty –DiskSizeGB 9999   $dataDisk = New-AzureRmDisk -DiskName … Continue reading PowerShell script to add a disk on Azure VM

Add a NIC in Azure with Powershell

First at all, log in Azure Login-AzureRmAccount Choice the subscription to use and declare the variables Select-AzureRmSubscription –SubscriptionId <id_of_your_subscription> $VMname = ‘VMName’ $VMRG = ‘ResourceGroupName’ $NICName = ‘NICName’ $NICResourceGroup = ‘NICResourceGroupName’ Get the VM $VM = Get-AzureRmVM -Name $VMname -ResourceGroupName $VMRG Add the second NIC $NewNIC = Get-AzureRmNetworkInterface -Name $NICName -ResourceGroupName $NICResourceGroup $VM = Add-AzureRmVMNetworkInterface … Continue reading Add a NIC in Azure with Powershell

Apache y SSL en Ubuntu

Pequeño laboratorio para instalar Apache y SSL en un servidor Ubuntu y crear varios sites, unos securizados con SSL y otros no. Ponemos password al usuario Root sudo passwd Entramos como Root y actualizamos los repositorios apt-get update Instalar ssh apt-get install openssh-server Instalar apache2 #Comprobamos que tenemos las fuentes cat /etc/apt/sources.list #Instalamos Apache2 apt-get … Continue reading Apache y SSL en Ubuntu