Skip to content



Recovery and decoupling of Linux Centos with MySQL Database and WikiMedia articles.

Decouple of:

  • Linux Server
  • MySQL database
  • Wikimedia articles


S3 cp sync exclude include

aws s3 sync /var/log/ s3://{MYBUCKET-NAME}/ --recursive --exclude "*" --include "{MY-log-files-name}*"

aws s3 sync /var/log/ s3://{MYBUCKET-NAME}/ --exclude "*" --include "{MY-log-files-name}*"

to work on another blog post

aws s3 presign s3://path-to-file

aws s3 help presign


Linux iptables, quick, simple and effective way to block an ip address or subnet range.

Syntax for Linux iptables command to block or drop an ip address

iptables -A INPUT -s IP-ADDRESS -j DROP

Example for Linux iptables command to block and ip

# iptables -A INPUT -s -j DROP

Example for Linux iptables command to block a port for a specific ip address

# iptables -A INPUT -s -p tcp --destination-port 25 -j DROP

Example to remove or unblock and ip address from the iptables list

# iptables -D INPUT -s -j DROP # iptables -D INPUT -s -j DROP

Remember to safe your iptables!

# service iptables save



Blocking advertising and pops using hosts file

Full script code file on github


Remember, do not execute or run what you do not understand, use at your own risk!


# Version 2018-11-09 11:24
# Author #AntonioFeijaoUK
# Purpose:  Script to automate the update on /etc/hosts with entries about malicious or advertising domains sites,
#           so that my computer or DNS-Server resolves these domains to, therefore avoiding/blocking the connection.
# Result:   "Cleaner" web-pages, safer navigation, faster loading pages as the extra mess/ads will not download.
# Updates:
#   2019-02-06 - Updated clean up script  awk '{print $1}'

echo -e "\n\n ...initiating LIST var with list of URLs... \n\n"


#echo ${LIST}

echo -e "\n\n ...going through the list and curl the domains to block... \n\n"


for URL in $(echo ${LIST}) ; do
  echo -e "\n\n ...curl URL -->  ${URL} ... \n\n"
  curl ${URL} --output "list_${COUNT}.txt"
  COUNT=$(( ${COUNT} + 1 ))

echo -e "\n\n ...aggregating and clearing up the lists, removing duplicates... \n\n"

cat -v list_* | grep -v ^# | grep -v ^$ | sed -e 's/\^M//g' | sed s/''//g | sed s/''//g |  awk '{print $1}' | sed 's/[[:blank:]]//g' | sort | uniq | sort > domains-list-to-block.txt

echo -e "\n\n ...adding to the domains lists to protect from connection to the real IP... \n\n"

for DOMAIN in $(cat domains-lis