Skip to content

Instantly share code, notes, and snippets.

View sebackend's full-sized avatar
🏠
Working from home

Sebastián Estrada sebackend

🏠
Working from home
  • Santiago, Chile
View GitHub Profile

1.- Crear nuevo usuario

Para evitar entrar como usuario root, crear otro usuario y darle permisos de sudo

$ sudo adduser deploy

2.- Otorgar permisos de sudo

@wafiq
wafiq / rails-5-6-ubuntu-mina-puma-nginx.md
Last active November 27, 2023 02:43
How to deploy Rails 5/6 in Ubuntu VM using Mina deployment with Puma webserver and Nginx

Rails 5 and 6 Deployment with Ubuntu, Mina, Puma and Nginx

Based on this tutorial but simplified and inlined. Particularly removed any Rails and 3rd party services part, assumed you just need deployment to any Ubuntu machine.

Prerequisite

  1. A functional Rails app
  2. Hosted Git repository (Github, Bitbucket, Gitlab)
  3. Cloud hosting account (Digital Ocean, Vultr, Linode, Lightsail)
  4. Local SSH account
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active April 3, 2024 05:30
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2022 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
curlExists=$(command -v curl)
echo "Testing Postman version"
@radutzan
radutzan / Transantiago public endpoints.md
Last active October 13, 2023 03:31
APIs REST públicas con data del Transantiago. Respuestas en JSON.

Nuevo: SCLTransit

Ignacio Hermosilla implementó un servicio web de acceso público usando los feeds GTFS de Transantiago y los puntos de acceso oficiales que normalmente requieren acuerdos con el DTPM, para que tú no tengas que hacerlo.

Está toda la información de Transantiago que puedas necesitar, con formatos de alta calidad y sin trámites. Estas APIs son las que ahora alimentan a Cromi.

APIs internas de Transantiago (no recomendadas)

Transantiago implementó estas APIs para uso interno, por lo que no hay ninguna garantía sobre su funcionalidad, mantenimiento o futura existencia. Úsalas bajo tu propio riesgo. (Probablemente no es aconsejable que las uses para nada crítico.)

@wojteklu
wojteklu / clean_code.md
Last active May 17, 2024 12:49
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@zulhfreelancer
zulhfreelancer / heroku_pg_db_reset.md
Last active January 29, 2024 10:09
How to reset PG Database on Heroku (for Rails app)?

It's important to note that running this reset will drop any existing data you have in the application

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

@parmentf
parmentf / GitCommitEmoji.md
Last active May 17, 2024 13:56
Git Commit message Emoji
@probil
probil / AdvancedFormSerialization.js
Last active May 14, 2018 21:52
Usefull function to serialize form inputs including input[type=file]
//USAGE: $("#form").serializefiles();
(function($) {
$.fn.serializefiles = function() {
var obj = $(this);
/* ADD FILE TO PARAM AJAX */
var formData = new FormData();
$.each($(obj).find("input[type='file']"), function(i, tag) {
$.each($(tag)[0].files, function(i, file) {
formData.append(tag.name, file);
});