SQL - SQL GROUP IP ADDRESSES BY NET RANGE /24
SELECT inet_ntoa(min(ip_address)), inet_ntoa(max(ip_address)),count(*) FROM ip_list GROUP BY ip_address >> 8 ...
View ArticleBash - QUERY A MYSQL DB AND SEND RESULTS AS CSV FILE VIA EMAIL
1. connect to db 2. connect to smtp server 3. execute the query 4. create a csv file 5. send it (to,cc,bcc)
View ArticlePython - COPY MYSQL ROWS FROM A DATABASE TO ANOTHER
1. connect to db1 2. execute query to extract everything we need 3. connect to db2 4. copy data collected at point 2 4. close connections
View ArticleSQL - SELECT DATE AND HOUR YYY-MM-DD HH
select substring('2013-04-02 10:12:53',1,13 ...
View ArticleSQL - SELECT DATE AND HOUR YYY-MM-DD HH UNIX_TIMESTAMP
SELECT substring(from_unixtime(saved_time),1,13 ...
View ArticlePython - Extract data from different MySql databases and write results into...
# set credentilas # set databases dictionary # set sql query # for cycle to extract data from all databases # wirte results in separated csv files NOTE this script includes also column names :D
View ArticlewordWrap
Function: wordWrap Returns an string with the extra characters/words "broken". maxLength maximum amount of characters per line breakWtih string that will be added whenever it's needed to break the line...
View ArticleQUERY A MYSQL DB AND SEND RESULTS AS CSV FILE VIA EMAIL
connect to db connect to smtp server execute the query create a csv file send it (to,cc,bcc)
View ArticleCOPY MYSQL ROWS FROM A DATABASE TO ANOTHER
connect to db1 execute query to extract everything we need connect to db2 copy data collected at point 2 close connections
View ArticleSELECT DATE AND HOUR YYY-MM-DD HH UNIX_TIMESTAMP
SELECT DATE AND HOUR YYY-MM-DD HH UNIX_TIMESTAMP
View ArticleExtract data from different MySql databases and write results into separated...
set credentilas set databases dictionary set sql query for cycle to extract data from all databases wirte results in separated csv files NOTE this script includes also column names :D
View Article