Skip to content

Instantly share code, notes, and snippets.

View rbrto's full-sized avatar

Roberto Esparza rbrto

View GitHub Profile
@croxton
croxton / SSL-certs-OSX.md
Last active June 3, 2025 17:42 — forked from leevigraham/Generate ssl certificates with Subject Alt Names on OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@rosiehoyem
rosiehoyem / getting-started-with-airflow.md
Last active January 14, 2023 18:09
Getting Started With Airflow

Install Airflow

1. Install Airflow

Follow the installation instructions on the Airflow website.

Update Airflow Configurations

To configure Airflow to use Postgres rather than the default Sqlite3, go to airflow.cfg and update this configuration to LocalExecutor:

# The executor class that airflow should use. Choices include
@pecavalheiro
pecavalheiro / elasticsearch-model-custom-mapping.rb
Created October 1, 2016 21:31
Snippets for Medium Post = Rails + Elasticsearch 101
class Article < ActiveRecord::Base
include Elasticsearch::Model
include Elasticsearch::Model::Callbacks
settings index: { number_of_shards: 1 } do
mappings dynamic: 'false' do
indexes :name
indexes :author
indexes :location, type: :geo_point
indexes :created_at, type: :date
@PavloBezpalov
PavloBezpalov / 1. ELK.install
Last active January 5, 2024 16:14
ELK Stack with Rails (Elasticsearch, Logstash, Kibana) on Ubuntu VPS
INSTALL JAVA
$ sudo apt-get update && sudo apt-get install default-jre
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart
$ sudo service elasticsearch status
redis:
image: redis:3.0.5
expose:
- 6379
volumes:
- redis:/var/lib/redis/data
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
@caalberts
caalberts / deploy.yml
Last active December 31, 2023 21:04
Ansible Playbook to Deploy Rails to AWS
---
# Deploy rails app from localhost to remote servers
- name: Set up AWS infrastructure
hosts: localhost
connection: local
roles:
- setup_aws
- name: Package app
@vdeville
vdeville / Tuto Nginx SSL Cerbot Let's Ecnrypt.yml
Last active January 30, 2017 19:43
Tuto Nginx SSL Cerbot Let's Ecnrypt
# /etc/nginx/sites-available/www.valentin-deville.eu
# Redirection de http sur https
server {
listen 80;
server_name www.valentin-deville.eu;
rewrite ^ https://$server_name$request_uri? permanent;
}
@mrcrilly
mrcrilly / netdata.yml
Created June 21, 2016 06:34
netdata Ansible Playbook
---
- name: Install netdata on a Linux host
hosts: all
become: true
tasks:
- name: Install depdendencies
yum:
name: "{{item}}"
state: present
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@joekr
joekr / Dockerfile-Nginx
Last active January 9, 2025 12:22
Kubernetes + Rails (NGINX & Unicorn) on GCE
# Set nginx base image
FROM nginx
# Copy custom configuration file from the current directory
COPY nginx.conf /etc/nginx/nginx.conf