Skip to content

Instantly share code, notes, and snippets.

View trejo08's full-sized avatar

Juan Trejo trejo08

View GitHub Profile
@trejo08
trejo08 / .screenrc
Created September 29, 2021 02:29 — forked from phawk/.screenrc
Sample screenrc
# Save this in ~/.screenrc
# Use bash
shell /bin/bash
autodetach on
# Big scrollback
defscrollback 5000
@trejo08
trejo08 / k8s-autoscaler-commands.txt
Created January 27, 2021 14:17
k8s cluster autoscaler command line options for version v1.18.3
$ docker run k8s.gcr.io/autoscaling/cluster-autoscaler:v1.18.3 /cluster-autoscaler -h
Usage of /cluster-autoscaler:
pflag: help requested
--add-dir-header If true, adds the file directory to the header
--address string The address to expose prometheus metrics. (default ":8085")
--alsologtostderr log to standard error as well as files
--aws-use-static-instance-list Should CA fetch instance types in runtime or use a static list. AWS only
--balance-similar-node-groups Detect similar node groups and balance the number of nodes between them
--cloud-config string The path to the cloud provider configuration file. Empty string for no configuration file.
--cloud-provider string

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@trejo08
trejo08 / systemd-manager.md
Created February 28, 2020 21:44 — forked from illvart/systemd-manager.md
Install systemd-manager for Ubuntu/Arch Linux

Screenshot_2019-05-20_02-46-48

systemd-manager for ubuntu:

lsb_release -a

Example output:

Distributor ID: Ubuntu
@trejo08
trejo08 / Dockerfile
Created February 13, 2020 14:51
example of multi-stages using two different images to relase a final
FROM golang:1.12-alpine AS gobuild
RUN apk update && apk add --no-cache gcc g++ make git
COPY ./ /build
WORKDIR /build
RUN GOOS=linux GOAR=amd64 go build -o binary
FROM jrottenberg/ffmpeg AS base-build
ENV PYENV_ROOT=/root/.pyenv
ENV PATH=$PYENV_ROOT/bin:$PATH
ENV PATH=$PYENV_ROOT/shims:$PATH

Stop all containers

docker kill $(docker ps -q)

Kill all containers

docker stop $(docker ps -a -q)

Remove all containers

docker rm $(docker ps -a -q)

Remove all images

#!/bin/bash
## small hack to print $PATH var in readable mode
echo $PATH | awk '{split($0,a,":"); for (i in a) print a[i]}'
@trejo08
trejo08 / routes.js
Created July 19, 2019 20:47
List URLs for Vue using VueRouter
import Vue from "vue"
import VueRouter from "vue-router"
const router = new VueRouter({
routes,
})
function getRoutesList(routers, pre) {
return routers.reduce((array, route) => {
const path = `${pre}${route.path}`;
@trejo08
trejo08 / morse.rb
Last active December 30, 2022 05:26
Morse Code translator written in Ruby as solution of CodementorX Assessment.
class Morse
def posibilities(signals)
signals.include?('?') ? check_wildcard(signals) : morses["#{signals}"]
end
def check_wildcard(signals)
length = signals.split('').length
values = []
if length.eql?(1)
values = ["E", "T"]
# before run this command you have to configure a directory where the remote will be mounted and also have to configured a remote using rclone
~$ rclone mount --allow-non-empty --allow-other --daemon remote:remote_directory /path/to/local/target