Skip to content

Instantly share code, notes, and snippets.

View kkbruce's full-sized avatar
🆚
Coding for fun

Bruce Chen kkbruce

🆚
Coding for fun
View GitHub Profile
@kkbruce
kkbruce / Get-WindowsKubernetesImages.ps1
Last active April 29, 2019 09:17
Docker for Windows for Kubernetes Images
docker pull k8s.gcr.io/kube-proxy-amd64:v1.10.11
docker pull k8s.gcr.io/kube-apiserver-amd64:v1.10.11
docker pull k8s.gcr.io/kube-controller-manager-amd64:v1.10.11
docker pull k8s.gcr.io/kube-scheduler-amd64:v1.10.11
docker pull k8s.gcr.io/etcd-amd64:3.1.12
docker pull k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.8
docker pull k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.8
docker pull k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.8
docker pull k8s.gcr.io/pause-amd64:3.1
@kkbruce
kkbruce / RedisProjectUrlCollection.txt
Created December 4, 2018 01:58
Redis Project URL Collection
1. https://redis.io
2. https://github.com/MicrosoftArchive/redis
3. https://github.com/ServiceStack/redis-windows
4. https://github.com/tporadowski/redis
@kkbruce
kkbruce / Program.cs
Created November 18, 2018 07:09
Test Slack API Connection
using Nito.AsyncEx;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace SlackApiTest
{
class Program
{
private static HttpClient client = new HttpClient();
@kkbruce
kkbruce / AddNetworkDrive.ps1
Created April 23, 2018 05:58
Add Nework Share Disk by PowerShell
New-PSDrive -Name "J" -PSProvider FileSystem -Root "\\DomainOrIP\app$" -Persist
# net use J: \\DomainOrIP\apps$
@kkbruce
kkbruce / IEProxy.ps1
Created April 23, 2018 05:44
Get-Set-Remove IE Proxy Settings by PowerShell
# Get IE Proxy Settings
Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings'
# Set IE Proxy Settings
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyEnable -value 1
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyServer -value [IPorDomain:Port]
# Remove IE Proxy Setings
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyEnable -value 0
Remove-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyServer
@kkbruce
kkbruce / Dockerfile.IISDemo
Last active May 15, 2019 15:21
windowsservercore:1809 Enable IIS Dockerfile
FROM mcr.microsoft.com/windows/servercore:ltsc2019
LABEL maintainer="kkbruce" description="Container for IIS" Vendor="Microsoft" Version="1809"
RUN powershell -Command Add-WindowsFeature Web-Server
# Todo: add some test HTML page.
RUN echo "Hello World - Server 2019 IIS - Dockerfile" > c:\inetpub\wwwroot\index.html
# or
# COPY index.html /inetpub/wwwroot
# COPY index.html c:/inetpub/wwwroot
# COPY index.html c:\inetpub\wwwroot will not work.
EXPOSE 80
@kkbruce
kkbruce / Dockerfile.redis-windows.3.2.100.config
Last active January 13, 2018 13:54
Redis-Windows 3.2.100 Dockerfile
FROM microsoft/windowsservercore:1709
SHELL ["powershell"]
RUN $ErrorActionPreference = 'Stop'; \
wget https://github.com/MicrosoftArchive/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.zip -OutFile redis.zip ; \
Expand-Archive redis.zip -dest 'C:\Program Files\Redis\' ; \
Remove-Item redis.zip -Force
RUN setx PATH '%PATH%;C:\Program Files\Redis\'
@kkbruce
kkbruce / redis-windows.basic-step.txt
Last active January 13, 2018 13:55
docker image for redis-windows
docker run -it microsoft/windowsservercore powershell
---
# Direct download from container
Invoke-WebRequest -Method Get -Uri https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip -OutFile c:\redis-latest.zip
# Host download then copy to container
# docker cp .\redis-latest.zip ContainerId:Dest_Path
Expand-Archive -Path C:\redis-latest.zip -DestinationPath c:\redis
---
docker commit --change='WORKDIR /redis' --change='CMD powershell .\redis-server.exe' -c "EXPOSE 6379" containerid [username]/[imagename]:[tagname]
@kkbruce
kkbruce / DeleteDockerImages.ps1
Last active April 30, 2020 02:51
Delete all containers and images
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
# Delete all dangling images
docker rmi $(docker images -f "dangling=true" -q)
# Delete all before time images
docker rmi $(docker images -f "before=..." -q)
@kkbruce
kkbruce / UpgradeSqlLocalDBtoVersion.bat
Created December 15, 2017 07:19
Upgrade SqlLocalDB to New Version
sqllocaldb d "MSSQLLocalDB"
sqllocaldb c "MSSQLLocalDB"
sqllocaldb i "MSSQLLocalDB"