Skip to content

Instantly share code, notes, and snippets.

View aledbf's full-sized avatar
🕸️

Manuel Alejandro de Brito Fontes aledbf

🕸️
View GitHub Profile
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
# Mount the boot partition. The device name will probably be different from "vda".
mount /dev/vda1 /mnt/
# Double check that we are in the right place
cat /mnt/syslinux/boot_kernel.cfg
#label boot_kernel
# menu label boot_kernel
# kernel vmlinuz-boot_kernel
# append console=ttyS0,115200n8 console=tty0 ro noswap cros_legacy root=LABEL=ROOT rootflags=subvol=root usr=gptprio:
#!/bin/bash
# apt-get install jq
#set -eu
shopt -s nullglob
readonly base_dir=$1
if [ -z "$base_dir" ] ; then
echo 'please location docker registry store location!';
exit;
fi
@aledbf
aledbf / haproxy.cfg
Created October 13, 2015 19:58 — forked from GABeech/haproxy.cfg
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
global
log 127.0.0.1:514 local0
defaults
mode http
log global
option httplog
option http-server-close
option dontlognull
option redispatch

This is an example of using Linux Kernel's Transparent Proxy to route all TCP traffic to docker containers without having to resort to PROXY protocol which is not supported by some applications (e.g. sshd). To get the demo to work you only need vagrant installed:

git clone [this-gist] tproxy-demo
cd tproxy-demo
vagrant up
@aledbf
aledbf / exabgp-setup.sh
Created September 6, 2016 15:41 — forked from totallyunknown/exabgp-setup.sh
Virtual IP with ExaBGP
#!/usr/bin/env bash
LOCAL_AS=65210
PEER_AS=65200
LB_IP="1.2.3.4"
HOST_IP=`ip address list | grep "scope global" | grep -v "scope global lo" | cut -d" " -f6 | cut -d"/" -f 1`
GATEWAY=`ip route | grep "^default" | cut -d" " -f3`
EXA_BGP_CONFIG="/etc/exabgp/exabgp.conf"
EXA_BGP_CHECK="/etc/exabgp/exabgp-check.sh"
@aledbf
aledbf / Transantiago public endpoints.md
Created July 12, 2017 22:36 — forked from radutzan/Transantiago public endpoints.md
APIs REST públicas con data del Transantiago. Respuestas en JSON.

Importante

Transantiago implementó estas APIs para uso interno, por lo que no hay ninguna garantía sobre su funcionalidad, mantenimiento o futura existencia. Úsalas bajo tu propio riesgo. (Probablemente no es aconsejable que las uses para nada crítico.)

Paraderos alrededor de un punto

http://www.transantiago.cl/restservice/rest/getpuntoparada?lat=-33.6089714&lon=-70.5742975&bip=1

Estimación de parada

http://www.transantiago.cl/predictor/prediccion?codsimt=PA420&codser=504 (código de servicio es opcional, pero el parámetro debe estar presente aunque esté vacío)

Lista de servicios

@aledbf
aledbf / dev-containers-cloud-native.md
Created December 8, 2023 00:05 — forked from craiglpeters/dev-containers-cloud-native.md
Dev Containers in the Cloud Native Ecosystem

Dev Containers

https://containers.dev an open spec that extends container definition to also include dev environment configuration including:

  • packages
  • lifecycle automation
  • processes
  • IDE configurations
  • remote connection
  • port forwarding
@aledbf
aledbf / download-vs-code-server.sh
Created May 16, 2024 18:49 — forked from b01/download-vs-code-server.sh
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
# Copyright 2023 Khalifah K. Shabazz
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the “Software”),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions: