Skip to content

Instantly share code, notes, and snippets.

View osoda's full-sized avatar
💻
Developing

osoda osoda

💻
Developing
View GitHub Profile
@andsens
andsens / dump.sh
Last active October 24, 2023 07:04
Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
@zapthedingbat
zapthedingbat / number-bytes.js
Created May 14, 2019 19:30
converting between numbers and bytes in javascript
function bitLength(number) {
return Math.floor(Math.log2(number)) + 1;
}
function byteLength(number) {
return Math.ceil(bitLength(number) / 8);
}
function toBytes(number) {
if (!Number.isSafeInteger(number)) {
@osoda
osoda / Crear conexion con git para hacer Push.MD
Last active February 14, 2025 17:59
Crear conexion con git para hacer Push

En terminal:

  • Iniciar el agente ssh:

    eval `ssh-agent -s`

  • Adiccionar el archivo con la llave privada creada en el paso [1.1]

    ssh-add ~/.ssh/github_osoda

Note: Desde Putty. Despues de generado el Archivo ppk o cargado.