Skip to content

Instantly share code, notes, and snippets.

View sg-gs's full-sized avatar
📈
Simpler = better

Sergio Gutiérrez sg-gs

📈
Simpler = better
View GitHub Profile
@sg-gs
sg-gs / install-r-kernel-in-jupyer.md
Last active October 1, 2024 12:48 — forked from aaizemberg/guia.md
instalando el kernel de R para jupyter notebook
@sg-gs
sg-gs / README.md
Created September 16, 2023 10:01 — forked from arikfr/README.md
Setting up HTTPS with LetsEncrypt for Redash Docker Deployment
  1. Make sure the domain you picked points at the IP of your Redash server.
  2. Switch to the root user (sudo su).
  3. Create a folder named nginx in /opt/redash.
  4. Create in the nginx folder two additional folders: certs and certs-data.
  5. Create the file /opt/redash/nginx/nginx.conf and place the following in it: (replace example.redashapp.com with your domain name)
    upstream redash {
        server redash:5000;
    }
    
@sg-gs
sg-gs / mongodb_backup_restore
Created October 24, 2021 09:49 — forked from JAlbertoGonzalez/mongodb_backup_restore
Backup & restore MongoDB database
# BACKUP
mongodump -u "USER_NAME" -p "USER_PASSWORD" --archive=test.gz --gzip --db DATABASENAME
# RESTORE
mongorestore --gzip --archive=test.gz --nsInclude 'DATABASENAME.*'
# If failed, edit /etc/mongodb.cong and set/uncomment noauth = true
# After edition, sudo service mongodb restart
@sg-gs
sg-gs / mysql_install
Created October 24, 2021 09:49 — forked from JAlbertoGonzalez/mysql_install
Installation of local MySQL on Ubuntu
sudo apt update
sudo apt install mysql-server
sudo mysql
# Drop root@localhost user to recreate it
DROP USER 'root'@'localhost';
CREATE USER 'root'@'localhost';
GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
CREATE USER 'root'@'%' IDENTIFIED BY 'password';

Paso 1. Enchufa/conecta/añade el nuevo volumen a la máquina de linux.

Paso 2. Ejecuta el comando lsblk e identifica cuál de todos es tu nuevo volumen.

Usa como pistas las columnas TYPE (debe ser disk), SIZE (el tamaño del volumen, normalmente lo sabemos de antemano, si hemos enchufado un volumen de 300GB, será el volumen que tenga 300GB), y MOUNTPOINT (el nuevo volumen no tiene ningún punto de montaje, aún, probablemente sea la única línea disk a la que le falte este valor).

Si tu disco no aparece porque has conectado el volumen con la máquina encendida, reinicia la máquina y vuelve a ejecutar este comando.

Ejemplo de lsblk en una máquina virtual que he creado con un volumen de 100G:

1. Login into mysql console
> mysql -u root -p
(-p parameter will ask you the password with a hidden prompt)
2. Watch available users to change passwords:
> select user, host, password from mysql.user;
const levelup = require('levelup')
const leveldown = require('leveldown')
const kfs = require('kfs')
const moment = require('moment')
const tokens = levelup(leveldown('/root/XCORE/tokens.db'))
const contracts = levelup(leveldown('/root/XCORE/contracts.db'))
const shards = kfs('/root/XCORE/sharddata.kfs')
function readAllTokens(callback) {
@sg-gs
sg-gs / mysql_table_foreign_keys.sql
Created October 24, 2021 09:48 — forked from JAlbertoGonzalez/mysql_table_foreign_keys.sql
Localiza todas las claves ajenas que apuntan a una determinada tabla
SELECT
CONCAT(TABLE_NAME,'.',COLUMN_NAME) as source_table, CONSTRAINT_NAME, CONCAT(REFERENCED_TABLE_NAME,'.',REFERENCED_COLUMN_NAME) as target_table
FROM
INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE
REFERENCED_TABLE_SCHEMA = '<schema_name>' AND
REFERENCED_TABLE_NAME = '<table_name>';
@sg-gs
sg-gs / mongodb_install_configure
Created October 24, 2021 09:48 — forked from JAlbertoGonzalez/mongodb_install_configure
MongoDB installation & configuration on Ubuntu
1. Install MongoDB
sudo apt-get install mongodb
2. Edit configuration file to allow any access w/out user/password authentication
sudo nano /etc/mongodb.conf
Search line:
# noauth = true

Boost MariaDB performance

Sistema Operativo

Estas son las configuraciones recomendadas que tienen que ver con el sistema oprativo sobre el que está instalada la máquina con MariaDB. Puedes configurarlas incluso antes de haber instalado la base de datos.

Cabe asumir que el sistema operativo por excelencia que mejor rendimiento presta para una base de datos como MariaDB es Linux.

1. Programador E/S