Skip to content

Instantly share code, notes, and snippets.

View gencebay's full-sized avatar
🎯
Focusing

Gencebay Demir gencebay

🎯
Focusing
View GitHub Profile
@gencebay
gencebay / DataTransform-Dockerfile
Created April 15, 2018 08:51
DataTransform Dockerfile
FROM microsoft/mssql-server-linux:2017-latest
RUN mkdir -p /var/opt/mssql/backup
COPY MusicStore.bak /var/opt/mssql/backup
##Enable it if you have already downloaded the .bak file for this database
##https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks2016.bak
#COPY AdventureWorks2016.bak /var/opt/mssql/backup
sudo ln -s /etc/nginx/sites-available/httplive /etc/nginx/sites-enabled/httplive
sudo ln -s /etc/nginx/sites-available/sentry /etc/nginx/sites-enabled/sentry
docker run -d -v ~/db:/var/db -p 5003:5003 gencebay/httplive -d /var/db/httplive.db
docker-compose up -d
# DO firewall
$ sudo ufw app list
$ sudo ufw allow 'Nginx Full'
server {
listen 80 default_server;
server_name sentry.netcorestack.com;
location / {
proxy_pass http://127.0.0.1:9000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
server {
server_name httplive.netcorestack.com;
location / {
proxy_pass http://127.0.0.1:5003;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
{
"compilerOptions": {
"target": "es6",
"module": "es6",
"jsx": "react",
"outDir": "src/Build",
"rootDir": "src/TS",
"types": ["reflect-metadata"],
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
public Task Invoke(HttpContext context)
{
var method = context.Request.Method;
if (method == "GET")
{
var path = context.Request.Path;
if (path.StartsWithSegments("/public-fs"))
{
return HandleFileServerHttpRequest(context);
}
package main
import (
"log"
"net/http"
"os"
"path"
"path/filepath"
"github.com/kardianos/service"
package main
import (
"log"
"net/http"
"os"
"path"
"path/filepath"
)
@gencebay
gencebay / DeployWebsite.ps1
Last active March 22, 2017 13:16
DeployWebsite PowerShell WinRM Compatible
[CmdletBinding()]
param (
[Parameter(Mandatory=$True,Position=1)][string]$packagePath,
[Parameter(Mandatory=$True)][string]$siteName,
[Parameter(Mandatory=$True)][string]$siteFullPath,
[Parameter(Mandatory=$True)][string]$environmentName,
[Parameter(Mandatory=$False)][string]$projectUri
)
function Run-Command
public class DefaultHttpFactory
{
// HttpClient is intended to be instantiated once and re-used throughout the life of an application.
// Instantiating an HttpClient class for every request will exhaust the number of sockets available under heavy loads.
// This will result in SocketException errors.
private readonly ObjectPool<HttpClient> _httpClientPool;
public int PoolSize => _httpClientPool.PoolSize;
public DefaultHttpFactory()