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.
| #Get the final date not including holydates, having the numbers days that want calculate and the date inicial | |
| #Try in http://rextester.com/live/QACMX44672 | |
| # EN este ejemplo se prueba con un numero de dias de 30 y con la fecha inicial la de hoy. | |
| # Se debe tener la tabla con cada fecha festiva despues de el dia de fecha inicia, incluyendo domingos tal como la tabla que se crea, | |
| # este ejemplo se probo el dia 19 de octubre de 2017 | |
| CREATE TABLE IF NOT EXISTS `festivos` ( | |
| `dia` date NOT NULL | |
| ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; |
| #!/bin/sh | |
| ### (v2) | |
| ## 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) | |
| ## IGNORE THIS BLOCK TO >=(v2) | |
| ## 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 |
| String.prototype.SelectToJSON = function(){ | |
| var str = '['+this.split('\n').map((el)=>{return '{'+el.split(', '). | |
| map((e,i)=>{return `"${i}": ${e.replace(/'/gi, '"')}`})+'},'}).join('\n').slice(0,-1)+']' | |
| return JSON.parse(str) | |
| } | |
| // Result shown by Gui And Copy whit the option 'Copy Row' | |
| var result = `'6', 'PAULA ', '2018-01-30', ' KEVIN', '', '0', '', '', 'SASA1', '2' | |
| '7', 'BRANDON ', '2018-01-30', 'ALBLO', '', '0', '', '', 'SASA1', '3' | |
| '8', 'PILAR', '2018-01-30', 'CACERES', '', '0', '', '', 'SASA1', '4'` |
| mysql -e "select concat('show grants for ','\'',user,'\'@\'',host,'\'') from mysql.user" > user_list_with_header.txt | |
| sed '1d' user_list_with_header.txt > ./user.txt | |
| while read user; do mysql -e"$user" > user_grant.txt; sed '1d' user_grant.txt >> user_privileges.txt; echo "flush privileges" >> user_privileges.txt; done < user.txt | |
| awk '{print $0";"}' user_privileges.txt >user_privileges_final.sql | |
| rm user.txt user_list_with_header.txt user_grant.txt user_privileges.txt |
| #!/usr/bin/python | |
| import os, math | |
| for root, dirs, files in os.walk("./manual"): | |
| n = int(input(raw_input("Ingrese el numero de archivos en el que se particionara: "))) | |
| dbs = '' | |
| length =len(files) | |
| cantArchives = int(math.ceil(float(length)/n)) | |
| print(str(length)+' nombres de db seran guardadas en '+str(cantArchives)+' archivos') | |
| for i,filename in enumerate(files, start=1): |
| #!/usr/bin/python | |
| # If you have a dir whithout list, just whit all sql dump, you can use next script, | |
| # that list all the files in a dir, into a file or multiples files: | |
| # https://gist.github.com/osoda/69f21664352a55540ec18781c0ab7119 | |
| import re | |
| from subprocess import call | |
| mysql="/usr/bin/mysql" | |
| archivo = raw_input('Escriba el nombre del archivo que tiene las db: ') |
| <?php | |
| /** | |
| * PHP script that perform a find and replace in a database dump (tested with | |
| * MySQL) with adjustments of the PHP serialize founded. | |
| * | |
| * Don't forget to escape your "special characters": | |
| * "a$b" -> "a\$b" | |
| * "a"b" -> "a\"b" | |
| * "a`b" -> "a\`b" |
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.
| function play() { | |
| var audio = new Audio('https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3'); | |
| audio.play(); | |
| } | |
| function bucleReproductor(){ | |
| if(stopPlay == 1){ | |
| clearInterval(downloadTimer); | |
| return | |
| } |