Skip to content

Instantly share code, notes, and snippets.

View damuz91's full-sized avatar
🎯
Focusing

David Muñoz damuz91

🎯
Focusing
View GitHub Profile
@damuz91
damuz91 / gist:429bed215c7ff13ee33e3968d52a4729
Created July 5, 2024 16:11
Sidekiq 7 - Jemalloc. Error backtrace
-- Logs begin at Tue 2024-07-02 23:16:22 UTC. --
Jul 05 05:00:01 subsystems-sync sidekiq[11766]: <jemalloc>: Error in munmap(): Invalid argument
Jul 05 05:00:01 subsystems-sync sidekiq[11766]: /home/ec2-user/production/sync-backend/shared/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/associations/join_dependency/join_part.rb:58: [BUG] Segmentation fault at 0x0000ffff69bfe000
Jul 05 05:00:01 subsystems-sync sidekiq[11766]: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [aarch64-linux]
Jul 05 05:00:01 subsystems-sync sidekiq[11766]: -- Control frame information -----------------------------------------------
Jul 05 05:00:01 subsystems-sync sidekiq[11766]: c:0063 p:0043 s:0386 e:000382 METHOD /home/ec2-user/production/sync-backend/shared/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/associations
Jul 05 05:00:01 subsystems-sync sidekiq[11766]: c:0062 p:0014 s:0373 e:000371 METHOD /home/ec2-user/production/sync-backend/shared/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1
@damuz91
damuz91 / gist:f79dbcc6d927b222a79d28d53938ebfb
Created February 27, 2024 19:03
Programa en pseudocodigo que hace operaciones
// Ejemplo de programa que hace operaciones con funciones
Inicio
Mientras(verdadero) Hacer
Imprimir('Que operacion desea realizar?')
Imprimir('1. Suma')
Imprimir('2. Restar')
Imprimir('3. Multiplicar')
Imprimir('4. Dividir')
operacion = Leer()
Si(operacion == 1) Entonces
@damuz91
damuz91 / nota_2_demostracion.txt
Created July 26, 2022 15:30
Nota número 2: Lo que se debe agregar adentro de las etiquetas <header>
<!-- Nota número 2: Lo que se debe agregar adentro de las etiquetas <header> -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script src="index.js"></script>
@damuz91
damuz91 / notas_demostracion.txt
Created July 1, 2022 19:39
Las notas necesarias para el video de demostración
# Parte 1
# El contenido del pie de la tabla, es decir de la etiqueta <tfoot>
# Estas 4 lineas se deben copiar de aqui y pegar entre las etiquetas <tfoot> </tfoot>
<td><input id="id" type="text" class="form-control"></td>
<td><input id="producto" type="text" class="form-control"></td>
<td><input id="precio" type="text" class="form-control"></td>
<td><button onclick="agregarProducto()" class="btn btn-success">Agregar</button></td>
@damuz91
damuz91 / sidekiq.systemd
Created April 15, 2022 21:12
My sidekiq systemd configuration file for AL2
[Unit]
Description=sidekiq
After=syslog.target network.target
[Service]
Type=simple
User=ec2-user
Group=ec2-user
UMask=0002
WorkingDirectory=/home/ec2-user/production/railsapp/current
@damuz91
damuz91 / gist:99b5c10ecc74b3e4dcdc50b1944159a9
Last active April 15, 2022 21:24
My mina production deployment script for AL2
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
set :application_name, 'railsapp'
set :domain, '255.255.255.255'
set :deploy_to, '/home/ec2-user/production/railsapp'
set :repository, '[email protected]:company/railsapp.git'
set :branch, 'main'
set :user, 'ec2-user'
@damuz91
damuz91 / production.prb
Created April 15, 2022 20:16
My puma production configuration file for AL2
rails_env = "production"
environment rails_env
app_dir = File.expand_path("../../..", __FILE__)
bind "unix://#{app_dir}/puma.sock"
pidfile "#{app_dir}/puma.pid"
state_path "#{app_dir}/puma.state"
directory "#{app_dir}"
@damuz91
damuz91 / puma.systemd
Created April 15, 2022 20:12
My puma configuration file for AL2
[Unit]
Description=Puma
After=network.target
[Service]
Type=forking
User=ec2-user
Environment=RAILS_ENV=production
WorkingDirectory=/home/ec2-user/production/railapp/current
@damuz91
damuz91 / app.nginx.conf
Last active April 15, 2022 21:44
My nginx configuration file for AL2 setup
upstream rails {
server unix:///home/ec2-user/production/railsapp/current/puma.sock fail_timeout=0;
}
server {
server_name _;
root /home/ec2-user/production/railsapp/current/public;
location / {
@damuz91
damuz91 / sidekiq.service
Created August 29, 2020 01:35
Sidekiq service systemd config file
[Unit]
Description=sidekiq
After=syslog.target network.target
[Service]
Type=simple
User=ubuntu
Group=ubuntu
UMask=0002
WorkingDirectory=/path/to/rails