Skip to content

Instantly share code, notes, and snippets.

View phsantiago32's full-sized avatar

Pedro Santiago phsantiago32

View GitHub Profile
@phsantiago32
phsantiago32 / appveyor.yml
Created July 18, 2017 01:08
Basic .yml template for publishing .NET Core NuGet packages using AppVeyor
os: Visual Studio 2017
version: 1.0.{build}
branches:
only:
- master
configuration:
- Release
@phsantiago32
phsantiago32 / Bootstrapper.cs
Created July 28, 2017 23:14
Nancy bootstrapper that sets request pipeline logging with and Serilog
using Nancy;
using Nancy.Bootstrapper;
using Nancy.TinyIoc;
using Serilog;
using System.Diagnostics;
namespace MyApp.Bootstrappers
{
public class Bootstrapper : DefaultNancyBootstrapper
{
@phsantiago32
phsantiago32 / docker-compose.yaml
Last active October 27, 2017 19:06
Compose file for creating a CI/CD stack using Rancher and Drone with and external MySql database and Nginx
version: '2'
services:
rancher-server:
image: rancher/server:stable
restart: unless-stopped
container_name: rancher-server
volumes_from:
- mysql
environment:
- CATTLE_DB_CATTLE_MYSQL_NAME=cattle
@phsantiago32
phsantiago32 / run-splunk-on-docker.sh
Created October 9, 2018 18:27
Run Splunk on Docker
#!/bin/sh
docker run --name splunk --hostname splunk -p 8000:8000 -p 8088:8088 -p 10000:10000 -d -e "SPLUNK_START_ARGS=--accept-license --answer-yes --seed-passwd {YOUR_PASSWORD}" -e "OPTIMISTIC_ABOUT_FILE_LOCKING=1" splunk/splunk
@phsantiago32
phsantiago32 / Dockerfile
Created October 9, 2018 18:52
Dockerfile for running an instance of hubot on Heroku
FROM alpine
# Install dependencies
RUN apk update && apk upgrade \
&& apk add --update nodejs nodejs-npm \
&& npm install -g npm
# Create hubot user
RUN adduser -h /hubot -s /bin/bash -S hubot
USER hubot
@phsantiago32
phsantiago32 / gist:be15671062d90edf5cc4f02d74bc4e7c
Created November 8, 2019 21:13
Export all IIS sites to XML command
appcmd list site /config /xml > c:\sites.xml
@phsantiago32
phsantiago32 / import-sites.bat
Created November 8, 2019 21:14
Import IIS sites from XML command
%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml
@phsantiago32
phsantiago32 / Program.cs
Created November 22, 2019 18:01 — forked from DanielSWolf/Program.cs
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@phsantiago32
phsantiago32 / MyDbContext.cs
Created August 2, 2019 17:12
C# snippet for connecting to an Azure DB instance via access token in a .NET Core app
using Microsoft.Azure.Services.AppAuthentication;
using System.Data.SqlClient;
namespace MyApp.Infrastructure.EntityFramework
{
public class MyDbContext : DbContext
{
public MyDbContext()
{
var conn = (SqlConnection)this.Database.GetDbConnection();
@phsantiago32
phsantiago32 / cloneAll.sh
Last active November 22, 2021 14:02
Script for cloning all repositories from a specific organization
#!/bin/bash
#requires jq -> http://stedolan.github.io/jq/
#optional change working_dir
working_dir=${1-$(pwd)}
cd $working_dir
user="YOUR_USER"
token="YOUR_GH_TOKEN"
organization="YOUR_ORGANIZATION"