Skip to content

Instantly share code, notes, and snippets.

@mwaaas
mwaaas / omnisharp.json
Last active August 30, 2022 15:14
ominisharp custom build
{
"msbuild": {
"enabled": true,
"ToolsVersion": null,
"VisualStudioVersion": null,
"Configuration": null,
"Platform": null,
"EnablePackageAutoRestore" : false,
"MSBuildExtensionsPath": null,
"TargetFrameworkRootPath" : null,
@mwaaas
mwaaas / gist:ff596c6450b6fe9d48e0bfb235ea57e8
Created July 20, 2020 06:36
Windows container not accessing internet
Getting this error while building dot net application.
Unable to load the service index for source https://api.nuget.org/v3/index.json
It fails when it trys to restore packages and it can't access nutget repository
To confirm this run the following command to access PowerShell inside a container
docker run -it --rm microsoft/nanoserver:sac2016 powershell
@mwaaas
mwaaas / Backup, restore postgres in docker container
Created September 9, 2018 14:00 — forked from gilyes/Backup, restore postgres in docker container
Backup/restore postgres in docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@mwaaas
mwaaas / .txt
Last active April 29, 2017 13:00
docker cloud ssl haproxy configuration
The following instructions to add ssl in haproxy
1. Create crs file check in this link on how to create https://support.rackspace.com/how-to/generate-a-csr-with-openssl/
2. Get crt and ca file from autorizing organisation
3. copy your private key to another file. eg foo.text
4. cat {crt you got from authorization} >> foo.text
5. cat {cat you got from authorization company} >> foo.text
5. convert to format that haproxy support awk 1 ORS='\\n' cert1.pem
6. add environment to haproxy key as DEFAULT_SSL_CERT and value as the outcome of step 5
#================
Start Swarm setup
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NODE_TYPE=manager
DYNAMODB_TABLE=HermesStagingDockerSwarm-dyndbtable
HOSTNAME=ip-172-31-14-75.eu-west-1.compute.internal
STACK_NAME=HermesStagingDockerSwarm
INSTANCE_NAME=ManagerAsg
AWS_REGION=eu-west-1
MANAGER_IP=
#================
Start Swarm setup
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NODE_TYPE=manager
DYNAMODB_TABLE=HermesStagingDockerSwarm-dyndbtable
HOSTNAME=ip-172-31-42-202.eu-west-1.compute.internal
STACK_NAME=HermesStagingDockerSwarm
INSTANCE_NAME=ManagerAsg
AWS_REGION=eu-west-1
MANAGER_IP=
@mwaaas
mwaaas / docker-stack.yml
Created April 8, 2017 10:49
docker-stack.yml traefik path prefix example
version: '3'
services:
lb:
image: traefik:latest
command: >
--web --docker --docker.swarmmode
--docker.domain=traefik --docker.watch
--accesslogsfile=/dev/stdout --logLevel=DEBUG
volumes:
- /var/run/docker.sock:/var/run/docker.sock
@mwaaas
mwaaas / .yml
Created April 7, 2017 09:06
test
version: '3'
services:
lb:
image: traefik:latest
command: --web --docker --docker.swarmmode --docker.domain=traefik --docker.watch --logLevel=DEBUG
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /dev/null:/traefik.toml
ports:
- "9000:80"