brew tap tonidy/tools-tap
brew install mkpasswd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Install Docker Toolbox: | |
| # Docker and DockerMachine are required. | |
| > DockerToolbox-<version>.exe /COMPONENTS="Docker,DockerMachine" | |
| # Edit "Docker Quick Terminal" with this patch -> https://github.com/docker/toolbox/issues/463#issuecomment-335318852 | |
| > docker-machine create -d "hyperv" --hyperv-virtual-switch "Network Name" default | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //taken from https://blogs.msmvps.com/kenlin/2018/01/18/2694/ | |
| protected void Application_BeginRequest(object sender, EventArgs e) | |
| { | |
| if (HttpContext.Current.Request.HttpMethod == "OPTIONS") | |
| { | |
| //These headers are handling the "pre-flight" OPTIONS call sent by the browser | |
| HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE"); | |
| HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept"); | |
| HttpContext.Current.Response.AddHeader("Access-Control-Allow-Credentials", "true"); | |
| HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # NB: When editing this file, be careful to preserve the original whitespace (especially newlines). | |
| HDXRTME_install_loadstrings_en() | |
| { | |
| HDXRTME_install_yeschoices="yes,YES,Yes,y,Y" | |
| HDXRTME_install_nochoices="no,NO,No,n,N, " # <-- trailing comma+space indicates empty input defaults to N |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env bash | |
| set -eo pipefail | |
| # | |
| # Part of an introductory Fedora CoreOS blog post on my website: | |
| # https://www.matthiaspreu.com/posts/fedora-coreos-first-steps/ | |
| # | |
| # Script sets up a FCOS virtual machine using QEMU. | |
| # | |
| # Initial user "matthias" with password "test" can be used. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Using: | |
| ## to see newconfig | |
| ## make view newconfig=~/new-config.yaml | |
| ## to merge configs | |
| ## make merge newconfig=~/new-config.yaml | |
| view:: | |
| cp ~/.kube/config ~/.kube/config.bak && KUBECONFIG=~/.kube/config:$(newconfig) kubectl config view --flatten > /tmp/config && cat /tmp/config | |
| merge:: | |
| cp ~/.kube/config ~/.kube/config.bak && KUBECONFIG=~/.kube/config:$(newconfig) kubectl config view --flatten > /tmp/config && mv /tmp/config ~/.kube/config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @page | |
| @{ | |
| Layout = ""; | |
| } | |
| @using System.Linq; | |
| @using System.Collections; | |
| @using System.Reflection; | |
| <html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections.Generic; | |
| namespace Extensions | |
| { | |
| public static class EnumerablePaginationExtensions | |
| { | |
| public static IEnumerable<IEnumerable<T>> Paginate<T>(this IEnumerable<T> items, int pageSize) | |
| { | |
| var page = new List<T>(); | |
| foreach (var item in items) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mock<IConfiguration> configuration = new Mock<IConfiguration>(); | |
| configuration.Setup(c => c.GetSection(It.IsAny<String>())).Returns(new Mock<IConfigurationSection>().Object); |