Skip to content

Instantly share code, notes, and snippets.

@karlospn
karlospn / git.migrate
Created February 6, 2018 08:52 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
git clone <repo-destination>
git remote add new-origin <repo-source>
git fetch <repo-source>
git rebase <repo-source>/<branchname>
git push
FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
EXPOSE 80
# Copy csproj and restore as distinct layers
COPY *.sln ./
COPY DockerBlankApiTest/*.csproj DockerBlankApiTest/
RUN dotnet restore
# Copy everything else and build
#r "System.Data"
#r "Newtonsoft.Json"
using System;
using System.Net;
using System.Threading.Tasks;
using System.Configuration;
using System.Text;
using System.Data;
using System.Data.SqlClient;
-----------------------------------------------
Dockerfile
-----------------------------------------------
FROM microsoft/dotnet:2.1.300-sdk AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.sln ./
COPY /src/VY.AMS.Resources.WebApi/*.csproj ./src/VY.AMS.Resources.WebApi/
@karlospn
karlospn / Cmder aliases
Last active December 17, 2018 10:44
Cmder Aliases
# use this file to run your own startup commands for msys2 bash'
# To add a new vendor to the path, do something like:
# export PATH=${CMDER_ROOT}/vendor/whatever:${PATH}
#GIT aliases
alias gcp='git clean -d -f; git reset --hard; git pull'
alias gc='git clean -d -f; git reset --hard'
alias gs='git status'
alias gb='git branch -a'
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45;net35</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
</PropertyGroup>
@karlospn
karlospn / my-simple-cf-example
Created February 10, 2019 23:14
Simple cloudformation example
Parameters:
ec2Name:
Description: ec2 name
Type: String
availZone:
Description: availability zone
Type: AWS::EC2::AvailabilityZone::Name
myKeyPair:
Description: Amazon EC2 Key Pair
Type: "AWS::EC2::KeyPair::KeyName"
Parameters:
Ec2Name:
Description: ec2 name
Type: String
Ec2AvailZone:
Description: availability zone
Type: AWS::EC2::AvailabilityZone::Name
RdsAvailZone1:
Description: availability zone
Type: AWS::EC2::AvailabilityZone::Name
@karlospn
karlospn / Dynamic Sonarqube QualityProfile allocation
Created November 15, 2019 13:51
How to assign a project into a sonarqube qualityprofile using the API
param (
[Parameter(Mandatory=$true)][string]$SonarUrl,
[Parameter(Mandatory=$true)][string]$ProjectName,
[Parameter(Mandatory=$true)][string]$ProjectKey,
[Parameter(Mandatory=$true)][string]$QualityProfile,
[Parameter(Mandatory=$true)][string]$SSMName)
function Get-Credentials{