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
version: '2'
services:
web-app:
build: ./app/
image: dockerguatemala/giphy-nodejs
restart: unless-stopped
volumes:
- "./app/:/app"
ports:
- "127.0.0.1:3000:3000"
@jmarcos-cano
jmarcos-cano / Jenkinsfile
Created June 9, 2017 05:27
Jenkins file for Doke
node {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'gnome-terminal']) {
stage ("Clone"){
git 'git@github.com:jmarcos-cano/go-demo.git'
}
stage ("Clean" ){
sh "make clean"
}
stage ("Unit Tests & Build Build Docker image"){
sh "make docker"
@jmarcos-cano
jmarcos-cano / runon-each-node.groovy
Last active December 7, 2019 19:23
Jenkinsfile to run a command on each node
/*
Created by: Marcos Cano
Team: DevOps
Date: 7/7/17
*/
stage("Run cmd on each node") {
def node_names=nodeNames()
for (String item:node_names) {
@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();
@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 / 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 / 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 / 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 / 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 / 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