Skip to content

Instantly share code, notes, and snippets.

View delzep's full-sized avatar

Henry Rios delzep

  • Pereira, Colombia
View GitHub Profile
@delzep
delzep / guia-vim.md
Last active June 13, 2023 02:25
Guia Vim
  • Abrir archivo: vim [file]
  • Ver histórico de comandos: q:
  • Quitar ajuste de página: :set nowrap
  • Adicionar ajuste de página: :set wrap
  • Ir al final del archivo: shift + G
  • Ir al inicio del archivo: gg
  • Mostrar los números de línea: :number
  • Ir a una línea específica (ej: ir a la línea 100): 100G
  • Ocultar los números de línea: :nonumber
  • Buscar en el archivo: ? [texto de búsqueda]
@delzep
delzep / mysql-to-csv.md
Last active August 25, 2021 14:13
MySql query to CSV

Save query to CSV comma separated "," in MySql:

SELECT * FROM table WHERE id < 100 INTO OUTFILE '/home/usr/archivo.csv' FIELDS ENCLOSED BY '"' TERMINATED BY ',' ESCAPED BY '"' LINES TERMINATED BY '\r\n'; 

If it returns error:

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

Find the secure route with write perm:

@delzep
delzep / cronjob-mysqldump.md
Last active November 3, 2021 04:20
Cronjob mysqldump
  • Store the db password in a cnf file in home directory:
sudo nano ~/.my.cnf
  • Add db password to cnf file:
[mysqldump]
password=YOUR_PASSWORD_HERE
  • Open crontab and add the rule: