Skip to content

Instantly share code, notes, and snippets.

View acerzhou's full-sized avatar

Acer Zhou acerzhou

View GitHub Profile
@acerzhou
acerzhou / Basic GO CLI
Last active June 9, 2020 00:08
[GO CLI] go lang cli #go #cli
# Help Command
go help <command>
# Run go code
go run <go_program>
# Build code
go build <go_program>
# Build code and with dependency
@acerzhou
acerzhou / Some Example
Last active May 29, 2020 08:00
[Docker CMD] docker command #docker #client
# Build a docker image with a tag
docker build -t <tag>
# Pull down asp.net sample app
docker pull mcr.microsoft.com/dotnet/core/samples:aspnetapp
# List all local docker images
docker image list
# Run Docker at background
@acerzhou
acerzhou / Dockerfile - Asp.Net Core
Created May 28, 2020 11:13
[Docker] some docker examples #docker
# Step 1: Specify the parent image for the new image
FROM ubuntu:18.04
# Step 2: Update OS packages and install additional software
RUN apt -y update && apt install -y wget nginx software-properties-common apt-transport-https \
&& wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& add-apt-repository universe \
&& apt -y update \
&& apt install -y dotnet-sdk-3.0
@acerzhou
acerzhou / Create VM
Last active October 25, 2020 05:33
[Azure Powershell] Azure PowerShell #Azure #Powershell
$myResourceGroup = Read-Host -prompt "Enter a resource group name: "
$myLocation = Read-Host -prompt "Enter a location (ie. WestUS): "
$myVM = Read-Host -prompt "Enter a VM name: "
$vmAdmin = Read-Host -prompt "Enter a VM admin user name: "
# The password must meet the length and complexity requirements.
$vmPassword = Read-Host -prompt "Enter the admin password: "
# create a resource group
New-AzResourceGroup -Name $myResourceGroup -Location $myLocation
@acerzhou
acerzhou / Azure Function CLI
Last active August 18, 2020 11:07
[DotNet Core CLI] some useful dotnet core cli #dotnetcore #cli
# Installation
sudo apt-get update
sudo apt-get install azure-functions-core-tools-3
# create function app
func init LocalFunctionProj --dotnet
@acerzhou
acerzhou / ARM Template
Last active August 29, 2020 05:51
[Azure CLI] Useful Azure CLI Command #Azure #CLI
az group deployment create \
--name ExampleDeployment \
--mode Complete \
--resource-group ExampleGroup \
--template-file storage.json \
--parameters storageAccountType=Standard_GRS
@acerzhou
acerzhou / openpdf.html
Last active May 13, 2020 11:20
[HTML link tag open PDF] #html #pdf
    <a href='http://www.pdf995.com/samples/pdf.pdf' download>click</a>