-
Navegar entre proyectos:
Ctrl+r
- Cambiar de terminal.
Focus en terminal
| # NOTE: We need disable the ONLY_FULL_GROUP_BY mode | |
| SET SESSION sql_mode=(SELECT replace(REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''),'NO_ENGINE_SUBSTITUTION','')); | |
| select count(1) cant from ( | |
| SELECT e.*, s.name , s2.code, group_concat(s2.code) codeVal, COUNT(s.name) cant | |
| from enrollment e | |
| inner join student s on e.student_id =s.id | |
| inner join `group` g on e.group_id = g.id | |
| left join subject s2 on g.subject_id =s2.id and right(s2.code,1) = '1' |
| 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 | |
| } |
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.
| <?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" |
| #!/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: ') |
| #!/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): |
| 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 |
| 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'` |