Skip to content

Instantly share code, notes, and snippets.

sidekiq:
image: tootsuite/mastodon:latest
restart: always
env_file: /opt/mastodon/.env.production
environment:
- DB_POOL=16
command: bundle exec sidekiq -c 16 -q pull
depends_on:
- db
- redis
@y8
y8 / playbook.md
Last active February 24, 2022 10:59

В связи с войной, коротко расскажу куда смотреть чтоб подложить соломку если у вашей компании есть айтишная инфраструктура.

Копии:

Задача: дать задуматься о «а что если». Грубо очертить сценарии, последствия и в какую сторону думать.

Почему?

alias apropos "$__fish_config_dir/patches/apropos.patched"
@y8
y8 / debug_tft_espi_esp32_idf.c
Created July 15, 2020 18:15
debug_tft_espi_esp32_idf.c
TFT_eSPI screen = TFT_eSPI();
setup_t screenSetup;
screen.init();
screen.getSetup(screenSetup);
ESP_LOGI(TAG, "Version: %s", screenSetup.version.c_str());
ESP_LOGI(TAG, "Transaction: %i | Serial: %i", screenSetup.trans, screenSetup.serial);
ESP_LOGI(TAG, "SPI overlap: %i | ESP: %x", screenSetup.overlap, screenSetup.esp);
ESP_LOGI(TAG, "SPI Read fq %i | SPI fq: %i", screenSetup.tft_rd_freq, screenSetup.tft_spi_freq);
@y8
y8 / migracion.js
Last active June 4, 2020 16:54 — forked from l337quez/migracion.js
Script que permite poblar una colecion de una base de datos de Mongo usando mongoose. El script hace la conexion con mongo y comienza a poblar la coleccion
mongoose.connect('mongodb://localhost:27017/myapp', { useNewUrlParser: true })
const modelSchema = new Schema(
{
entity: String,
scope: Number,
actionType: Number
},
{ versionKey: false }
)
const Test = mongoose.model('Test', modelSchema)
server {
listen 80;
server_name alexmak.net alexmak.yopp.in www.alexmak.net;
access_log /var/log/nginx/alexmak-ssl-access.log;
error_log /var/log/nginx/alexmak-ssl-error.log;
rewrite ^(.*)$ https://alexmak.net$1 permanent;
}
server {
@y8
y8 / kalman.cr
Last active August 29, 2015 14:23
Crystal Lang: Kalman filter implementation
require "matrix"
require "time"
class Array
def middle
if count < 3
return self
end
from = (count / 4.0).round.to_i
@y8
y8 / kalman_ips.rb
Last active August 29, 2015 14:23
Kalman filter: benchmark
require 'benchmark/ips'
require "matrix"
require "time"
class Kalman
attr_accessor :state
attr_accessor :process_noise
attr_reader :control
attr_accessor :model
attr_reader :readings
@y8
y8 / 2015-06-22
Last active August 29, 2015 14:23
Simple kalman filter for water well level ultrasonic sensor
00:00:00.50,244.97
00:00:00.142,244.90
00:00:00.234,245.03
00:00:00.327,244.21
00:00:00.419,245.10
00:00:00.512,244.76
00:00:00.604,245.10
00:00:00.696,245.03
00:00:00.789,244.55
00:00:00.881,244.62
@y8
y8 / kalman.rb
Created June 22, 2015 00:51
kalman.rb
require "matrix"
# Simple Kalman implementation, with one hidden variable: velocity.
# For very simple explanation see https://www.udacity.com/course/artificial-intelligence-for-robotics--cs373 (Lession 2)
class Kalman
attr_accessor :state
attr_accessor :process_noise
attr_reader :control
attr_accessor :model