Skip to content

Instantly share code, notes, and snippets.

View jmarcos-cano's full-sized avatar
🏠
Working from home

Marcos Cano jmarcos-cano

🏠
Working from home
View GitHub Profile
@jmarcos-cano
jmarcos-cano / Instalar_previo_al_evento.md
Last active August 23, 2020 03:33
Container Bootcamp v2.0 - Advanced.md

Pre Requisitos

Instalación

Aseguráte de tener estos paquetes instalados en tu computadora

"En Común"

  • Instalar git
  • Terminal y ambiente de terminal: Git bash, bash o powershell (windows)
  • Crear una cuenta en hub.docker.com
  • Crear una cuenta en github.com si no la tiene creada
@jmarcos-cano
jmarcos-cano / Dockerfile
Last active April 30, 2020 14:42 — forked from croblesm/Dockerfile
msql-tools custom image using Alpine
# SQL Server Command Line Tools - custom image
# From Alpine 3.11 (~5 MBs)
FROM alpine:3.11
# * ##################################
# * CHANGES
# * wrap RUNs into a single RUN command, this avoids multiple layers, reduce it from ~40MB to 17.7MB (so basically we added 12MB on top of alpine)
# * Allows you to change MSSQL_VERSION by passing `--build-arg MSSQL_VERSION=<new version>` during docker build.
ARG MSSQL_VERSION=17.5.2.1-1
@jmarcos-cano
jmarcos-cano / README.md
Last active April 17, 2020 23:27
Change audio Source in my Mac, input and output

Change Audio Source Automation

If you have multiple Audio Inputs like me:

  • MacBook Pro Speakers
  • Astro A50 Game
  • Krisp Speaker
  • DisplayPort (my monitor speakers)

And you want to change audio source using your keyboard you can use these two scripts alongside with

@jmarcos-cano
jmarcos-cano / docker-compose.simple.yml
Last active October 15, 2019 23:39
simple docker-compose
version: "3.5"
services:
web:
image: ${IMAGE_NAME:-mcano/docker:intro}
environment:
- REDIS_HOST=redis
- FOO=${FOO:-BAR}
ports:
- target: 5000
published: 5000
@jmarcos-cano
jmarcos-cano / docker-compose.redis.yml
Last active August 13, 2019 22:09
docker-compose file to demonstrate sysctls for docker stacks 🐳
version: '3.7'
services:
redis:
image: redis:alpine
deploy:
mode: global
restart_policy:
condition: on-failure
ports:
- 6379:6379
@jmarcos-cano
jmarcos-cano / healthcheck.sh
Last active August 31, 2023 16:53
Logspout healthcheck based on outgoing network packets.
#!/bin/sh
# requires latest version
# apk add --update net-tools
if [ -z $PROTOCOL ]; then
ps aux|grep logspout|grep -q "udp://" && {
PROTOCOL=u
ps aux|grep logspout|grep -q "tcp://" && {
PROTOCOL=t${PROTOCOL}
} || {
@jmarcos-cano
jmarcos-cano / hyper.js
Last active May 6, 2019 14:38
Hyper.is config in Windows to use git-bash
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@jmarcos-cano
jmarcos-cano / bios.yml
Last active September 3, 2020 06:30
BIOS yaml config for UFM students
# set Clock freq (Hz), possible values: Range 0-2, being 0 = step and -1 = infinite or as fast as you can.
clock: 1.2
# turn on visualization and specify which things to print
visualization:
RAM: true
Registers: true
Clock: false
ALU: true
@jmarcos-cano
jmarcos-cano / generic-initd
Created September 12, 2017 23:18
generic initd file
#!/bin/bash
### BEGIN INIT INFO
# Provides: generic
# Required-Start: a
# Required-Stop: a
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: generic service
### END INIT INFO
@jmarcos-cano
jmarcos-cano / kill-jenkins-stuck-build.groovy
Created August 6, 2017 03:58
Stop & Kill Jenkins stuck build
def jobname = "the-job-name"
def buildnum = 85
def job = Jenkins.instance.getItemByFullName(jobname)
for (build in job.builds) {
if (buildnum == build.getNumber().toInteger()){
if (build.isBuilding()){
build.doStop();
build.doKill();