All posts by PF

mysql – search & replace HUGE databases

So!, I have with almost 3Gb… and I need to make a search & replace…
This looks the best way to me…

EXPORT FROM MYSQL > LINUX SEARCH & REPLACE > IMPORT TO MYSQL

Dump database to text file

mysqldump -u user -p databasename > ./db.sql

Run sed command to find/replace target string

sed -i 's!oldString!newString!g' ./db.sql

Reload the database into MySQL

mysql -u user -p databasename < ./db.sql

As copied from http://stackoverflow.com/questions/11839060/find-and-replace-text-in-the-entire-table-using-a-mysql-query

enom – Expiration Date

WTF?!

Domain Name: SOMETHING.COM
Registrar: ENOM, INC.
Sponsoring Registrar IANA ID: 48
Whois Server: whois.enom.com
Referral URL: http://www.enom.com
Name Server: DNS1.NAME-SERVICES.COM
Name Server: DNS2.NAME-SERVICES.COM
Name Server: DNS3.NAME-SERVICES.COM
Name Server: DNS4.NAME-SERVICES.COM
Name Server: DNS5.NAME-SERVICES.COM
Status: pendingDelete https://icann.org/epp#pendingDelete
Updated Date: 08-dec-2016
Creation Date: 25-sep-2015
Expiration Date: 25-sep-2016

>>> Last update of whois database: Sat, 10 Dec 2016 12:56:07 GMT <<<

Domains Index lists of all registered domains, registered domains database ccTLD

 

domain-index.com

Domains Index
lists of all registered domains, registered domains database  ccTLD

Building web scraper or doing marketing research you face a problem of obtaining domain lists for crawling. We collected and update them regularly for one of our projects and are happy to share. gTLD, ccTLD, and newgTLDs, everything in one place.

According to Q2 2016 Domain Name Industry Brief, today approximately 344MM domain names registered worldwide in ccTLD,  gTLD, and newGTLD zones. We have about 90% domains in our registered domains dataset.

Cloudflare – ban country with .htaccess

One of my clients asked me to BAN an specific country to one of his sites.
Since we have Cloudflare, this is how I made it…

On .htaccess I’v simply added the following lines – on the top of .htaccess -.

SetEnvIf CF-IPCountry IN BuzzOff=1
SetEnvIf CF-IPCountry PT BuzzOff=1
Order allow,deny
Allow from all
Deny from env=BuzzOff

But remember!
Domain/subdomain must have Cloudflare active on DNS settings…