Skip to content

Instantly share code, notes, and snippets.

View carlosvargasvip's full-sized avatar

Carlos Vargas carlosvargasvip

View GitHub Profile
#!/bin/sh
# Author: Carlos Vargas (ContainerKing.Ninja)
# Filename: /etc/dhcp/dhclient.d/hostname
# Purpose: Used by dhclient-script to set the hostname of the system
# to match the DNS information for the host as provided by
# DHCP.
#
hostname=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1 | awk -F'.' '{print $1"-"$2"-"$3"-"$4}')
echo $hostname > /etc/hostname
hostname $hostname
@carlosvargasvip
carlosvargasvip / centos4mesos.sh
Last active September 27, 2016 18:18
CentOS Configuration for Mesosphere
#!/bin/bash
#
# Author: Carlos Vargas (ContainerKing.Ninja)
# Script: centos4mesos.sh
echo "Configure Hostname Script"
curl https://gitlab.com/carlosvargas/devops/raw/master/CentOS/hostname>/tmp/hostname && chmod +x /tmp/hostname && sudo cp /tmp/hostname /etc/init.d/
ln -s /etc/init.d/hostname /etc/rc3.d/S11hostname
#
#!/bin/bash
#
#
mkdir vmware
cd vmware
wget https://github.com/vmware/docker-volume-vsphere/releases/download/1.0.beta/docker-volume-vsphere-1.0.beta-1.x86_64.rpm
wget https://github.com/vmware/docker-volume-vsphere/releases/download/1.0.beta/docker-volume-vsphere_1.0.beta_amd64.deb
wget https://github.com/vmware/docker-volume-vsphere/releases/download/1.0.beta/vmware-esx-vmdkops-1.0.beta.vib
# Author: Carlos Vargas
# Version 1:0
# Scriptname: Get-AzureStackRootCAcert.ps1
Write-Verbose "Retrieving Azure Stack Root Authority certificate..." -Verbose
$cert = Invoke-Command -ComputerName mas-ca01 -ScriptBlock { Get-ChildItem cert:\currentuser\root | where-object {$_.Subject -eq "CN=AzureStackCertificationAuthority, DC=AzureStack, DC=local"} }
if($cert -ne $null)
{
if($cert.GetType().IsArray)
#!/bin/sh
/sbin/route add -net 192.168.102.0/27 -interface $1
/sbin/route add -net 192.168.105.0/27 -interface $1
# Author: Carlos Vargas
# Version 1:0
# Scriptname: Get-AzureStackNatIP.ps1
$natip = Invoke-Command -ComputerName mas-bgpnat01 -ScriptBlock {Get-NetIPConfiguration | ? {$_.IPv4DefaultGateway -ne $null } | Foreach {$_.IPv4Address.IPAddress}}
Write-Output "Your IP Address for VPN is : $natip" | Out-File $env:userprofile\downloads\natip.txt
Get-Content $env:userprofile\downloads\natip.txt
####################################################
# Script Name: CreateTenantOfferWithPowerShell.ps1
# Author Name: Carlos Vargas
# Version : 1.0
####################################################
clear
Write-Host "**************** Azure Stack Create Tenant Offers *********************"