Skip to content

Instantly share code, notes, and snippets.

View blackjid's full-sized avatar
🎹

Juan Ignacio Donoso blackjid

🎹
View GitHub Profile
@rverchere
rverchere / kube-state-metrics-vpa.yaml
Last active February 29, 2024 14:04
kube-state-metrics configuration for VPA metrics
## Kube State Metrics to get VPA metrics
# Old vs New metrics:
# - kube_verticalpodautoscaler_labels -> kube_customresource_verticalpodautoscaler_labels
# - kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target -> kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_target
# - kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound -> kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound
# - kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound -> kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound
# - kube_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget -> kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget
# Resources:
# - https://github.com/kubernetes/kube-state-metrics/blob/main/docs/customresourcestate-me
@lumascet
lumascet / esphome.yaml
Last active February 7, 2024 10:39
FYSETC-E4 esphome roller blinds
substitutions:
device_name: "lush-cover-controller"
pulley_diameter_mm: "21.963"
gear_ratio: "1880/2000"
distance_mm: "2050"
acceleration: 500 steps/s^2
velocity: 2500 steps/s # 200 (motor steps) * ${microsteps}
back_off_steps: "200" # back off some steps to reduce stepper energize noise
open_current_x: 1000ma
@anonoz
anonoz / Dockerfile
Created March 26, 2018 03:13
Sample of multistage Dockerfile for Rails app in production
FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf_savior
# STAGE for bundle & yarn install
FROM ruby:2.4.3-alpine3.7 as builder
ENV CA_CERTS_PATH /etc/ssl/certs/
ENV RAILS_ENV production
ENV RAILS_LOG_TO_STDOUT true
ENV RAILS_SERVE_STATIC_FILES true
@blackjid
blackjid / update-multi.sh
Last active January 4, 2017 01:39
Update heroku multibuildpack on all your apps
#!/bin/bash
request=$(heroku apps --json)
apps=$(echo $request | jq -r '.[] | select(.buildpack_provided_description=="Multipack").name')
for i in $apps;
do
echo $i
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi.git --app $i
done
@sebboh
sebboh / postgres96upgrade.md
Created November 18, 2016 23:32
Upgrade to Postgres 9.6

Stop your running postgres server (your plist name may or may not have specified the version in it, mine had 94 in the name)

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql94.plist

Upgrade to 9.6

brew update && brew upgrade postgresql

Check your version

@charity
charity / init.sh
Created May 18, 2016 20:19
terraform environment init.sh
#!/bin/bash
# Usage: ./init.sh once to initialize remote storage for this environment.
# Subsequent tf actions in this environment don't require re-initialization,
# unless you have completely cleared your .terraform cache.
#
# terraform plan -var-file=./production.tfvars
# terraform apply -var-file=./production.tfvars
tf_env="production"
@vincent99
vincent99 / gist:491afed2306ba448dd89
Last active August 14, 2019 01:16
Simple example of subscribing to Rancher change events
/*
Setup:
npm install ws
Usage:
Create an API key in Rancher and start up with:
node socket.js address.of.rancher:8080 access_key secret_key project_id
*/
var WebSocket = require('ws');
@ldlsegovia
ldlsegovia / osx-postgres-postgis.sh
Last active December 6, 2022 09:54
Installing postgis 2.1.4 with previously installed postgres 9.3.2 on OS X 10.9
$ brew install geos proj gdal libxml2 json-c
$ wget http://download.osgeo.org/postgis/source/postgis-2.1.4.tar.gz
$ tar xvfz postgis-2.1.4.tar.gz
$ cd postgis-2.1.4
$ ./configure --with-projdir=path-to-proj --with-jsondir=path-to-json-c (example: ./configure --with-projdir=/opt/boxen/homebrew/Cellar/proj/4.8.0 --with-jsondir=/opt/boxen/homebrew/Cellar/json-c/0.11)
$ make
$ sudo make install
$ cd path-to-your-postgres-previously-installed/contrib/postgis-2-1 (example: cd /opt/boxen/homebrew/Cellar/postgresql/9.3.2-boxen/share/postgresql/contrib/postgis-2.1)
$ createdb template_postgis
$ createlang plpgsql template_postgis
@blackjid
blackjid / README.md
Last active August 29, 2015 14:01
Google Calendar Attendees widget for Dashing

Description

A Dashing widget for displaying the number of attendees for a specific calendar event on Google Calendar

It's specially designed to be used against a recursive event. For example, we use it at platanus to show how many people and who is going to have lunch in the office.

screen shot

Made by platanus in Chile