Here is the simplest way to create a 3-node MongoDb replica set using Docker. These instructions were created using Docker on Windows 10 and setup to use Linux containers.
If you use this, you probably have to update your hosts file, as well.
On Windows you can find it at:
C:\Windows\System32\drivers\etc\hosts
Add
127.0.0.1 mongo0 mongo1 mongo2 to the file and save it.
Step 6: Initiate the replica set
Still in the MongoDb shell, type (or paste) the following
rs.initiate(config);
End result
You should see the MongoDb shell switch to SECONDARY and if you hit Enter a few times it will switch to PRIMARY (it may start out as primary, as well).
You can exit the interactive MongoDb session with quit() or juct ctrl-c
Now you should be able to connect to the replica set using the following connection string
Typescript v2.2 was released today and it offers something that I was waiting for…generate members for interface.
Steps are pretty easy. Here we go.
Download and install the new version of Typescript npm install -g typescript
Open Visual Studio Code and update the setting typescript.tsdk with the following:
"typescript.tsdk" : "{your_path_to_global_npm}\\typescript\\lib" Note: you can get your npm root path by typing npm root -g
open a Typescript file in Visual Studio Code and you should now see 2.2.1 in the status bar
You can find the release notes for Typescript v2.2 here
$EmailFrom="[email protected]"$EmailTo="[email protected]"$Subject="Test email"$Body="Testing to if email server works"$SMTPServer="mail.somecompany.com"$SMTPClient=New-ObjectNet.Mail.SmtpClient($SMTPServer,465)$SMTPClient.EnableSsl=$true$SMTPClient.Credentials=New-ObjectSystem.Net.NetworkCredential("username","password")$SMTPClient.Send($EmailFrom,$EmailTo,$Subject,$Body)
UPDATE (2016-OCT-10): Everything has changed, for the better. This process is much easier now. I will follow-up soon with a new guide.
For my tests, I sparked up an Ubuntu 14.04 64-bit image in Parallels.
Following the instructions on the Asp.Net site, I was able to get Asp.Net 5 installed on my image.
Here are the steps broken down:
Install the .NET Version Manager (DNVM)
Use the .NET Version Manager (DNVM) to install different versions of the .NET Execution Environment (DNX) on Linux.
Install unzip and curl if you don’t already have them:
sudo apt-get install unzip curl
Download and install DNVM:
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh &&source ~/.dnx/dnvm/dnvm.sh
Once this step is complete you should be able to run dnvm and see some help text.
dnvm will output:
___ _ ___ ____ ___
/ _ \/ |/ / | / / |/ /
/ // / /| |/ / /|_/ /
/____/_/|_/ |___/_/ /_/
.NET Version Manager - Version 1.0.0-rc2-15545
By Microsoft Open Technologies, Inc.
DNVM can be used to download versions of the .NET Execution Environment and manage which version you are using.
You can control the URL of the stable and unstable channel by setting the DNX_FEED and DNX_UNSTABLE_FEED variables.
Current feed settings:
Default Stable: https://www.nuget.org/api/v2
Default Unstable: https://www.myget.org/F/aspnetvnext/api/v2
Current Stable Override: <none>
Current Unstable Override: <none>
Use dnvm [help|-h|-help|--help] to display help text.
Install the .NET Execution Environment (DNX)
The .NET Execution Environment (DNX) is used to build and run .NET projects. Use DNVM to install DNX for Mono or .NET Core.
Follow the instructions to create a basic web application.
cd{name of folder (name of web application)}
dnu restore
dnx web
Open a web browser and point it at http://localhost:5000 and you should see a standard template site.
###Deploy a Docker container
Create a Docker container
Inside of the folder that houses your web application’s source code, you will find a Dockerfile file. The generator that I was using, created:
# Base of your container
FROM microsoft/aspnet:latest
# Copy the project into folder and then restore packages
COPY . /app
WORKDIR /app
RUN ["dnu","restore"]# Open this port in the container
EXPOSE 5000
# Start application
ENTRYPOINT ["dnx","-p","project.json", "web"]
Run the Docker container
Swap out {yourapplication} for the actual name of your application
docker build -t{yourapplication}.
docker run -t-d-p 8080:5000 {yourapplication}
Now if you open your web browser and point it to http://localhost:5000 and you should see the same template site that you saw earlier.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a957ec2ee445 helloworldweb "dnx web --server.url" 15 hours ago Up 15 hours 0.0.0.0:8080->5000/tcp agitated_almeida
Use the Container ID to stop the container:
docker stop a957ec2ee445
Open the Dockerfile and change it to:
FROM microsoft/aspnet
COPY . /project
WORKDIR /project
RUN ["dnu", "restore"]
ENTRYPOINT ["dnx", "web", "--server.urls", "http://0.0.0.0:5000"]
At work we were having trouble with the amount of time one of our pages was taking to move forward. To be fair, this page was doing a lot of work and posting a lot of data in one shot, but it really shouldn’t have been taking upwards of 15-20 seconds.
Using the normal means (Fiddler, Glimpse, Chrome tools, etc), we were still having trouble pinpointing the problem. We ruled out the jQuery validator, JSON serializing and the action method in our controller.
To start, use Nuget to install MiniProfiler into the project. From the Project Management Console, type:
Install-PackageMiniProfiler.MVC3
A new file called MiniProfiler.cs will be added to the App_Start folder. Looking in the Init() method in the MiniProfilerStartupModule class, code has already been added to limit MiniProfiler to run for local requests only. We wanted to take this one extra step and add configuration to shut it completely off when the application goes into the wild, but give us the ability to turn it on at a client site, just in case.
When your application runs, you should now see your profiler results in the upper left corner of your browser window.
During this little adventure, one more problem cropped up regarding the sheer size of the data that we were trying to send through the profiler. It was actually maxing out what was allowed over the pipe.
To temporarily get around this, add the following to Application_Start() in the global.asax.cs file (comment or remove this when you are done with it):