Skip to content

Instantly share code, notes, and snippets.

View melvinlee's full-sized avatar
🏠
Working from home

melvinlee melvinlee

🏠
Working from home
  • Singapore
View GitHub Profile
@melvinlee
melvinlee / myapp.py
Created February 29, 2024 03:41
stramlist
import streamlit as st
import time
col1, col2, col3 = st.columns([1,2,1])
col1.markdown("# Welcome to my app")
uploaded_photo = col2.file_uploader("Upload a photo")
camera_photo = col2.camera_input("Take a photo")
@melvinlee
melvinlee / Dockerfile
Created August 10, 2020 11:56
Baked NuGet packages cache into base images.
FROM mcr.microsoft.com/dotnet/core/sdk:3.1
# warmup NuGet package cache
WORKDIR /sln
COPY *.sln .
COPY projectfiles.tar .
RUN tar -xvf projectfiles.tar
RUN dotnet restore \
--source https://api.nuget.org/v3/index.json
@melvinlee
melvinlee / CKAD.md
Created June 10, 2020 09:51 — forked from veggiemonk/CKAD.md
CKAD exam preparation
#File: .azure-pipelines/azure-pipelines-fluxcd.yaml
trigger:
branches:
include:
- master
- releases/*
paths:
include:
- flux/*
## Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# VS Code
choco install vscode -y
# Chrome
choco install googlechrome -y
# Utilities

PKI

How to Generate Private Key

File parameters to be updated. fileName is file’s name keyPassword is the API Key password

export filename=mykey

Generate new PKI key pair, with 2048 key encryption

minikube start --cpus 4 --memory 8192
@melvinlee
melvinlee / Dockerfile
Created August 2, 2018 13:09
Hydrate dotnet nuget packages.
FROM microsoft/dotnet:2.1-sdk
# warmup NuGet package cache
COPY packagescache.csproj /tmp/warmup/
RUN dotnet restore /tmp/warmup/packagescache.csproj \
--source https://api.nuget.org/v3/index.json \
--verbosity quiet \
&& rm -rf /tmp/warmup/
WORKDIR /
@melvinlee
melvinlee / bootstrap.ps1
Last active July 25, 2018 17:16
Windows bootstrap
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install add-on software
choco install docker-for-windows -y
choco install visualstudio2017community -y
choco install dotnetcore-sdk -y
# Enable HyperV for Docker
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
# Restart
Restart-Computer
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y docker.io kubelet kubeadm kubectl
systemctl enable docker