depicus

changing the digital world one bit at a time...

Blants (noun) the rants of a blogger

  1. Stop Ubuntu/Debian apt-get from using ipv6

    December 31, 2014 by The Man

    Today I had a problem with apt-get using ipv6 and timing out. The answer is simple, you can force ipv4 if required.

    sudo apt-get update -o Acquire::ForceIPv4=true

    Might not solve my issue that the servers appear to be down but hoehum…


  2. Using Google SMTP with Postfix on Ubuntu/Debian

    December 22, 2014 by The Man

    I run a few servers at home for various things including a little Raspberry Pi running Debian which emails me alerts when certain things happen. I send these to an Outlook.com account or an Office365 account but being a home IP I often get blocked

    “(host mx2.hotmail.com[65.55.33.119] said: 550 OU-002 (COL004-MC5F2) Unfortunately, messages from xxx.xxx.xxx.xxx weren’t sent. Please contact your Internet service provider since part of their network is on our block list.”

    So the simple solution is to add a relay host to Postfix.
    (more…)


  3. Fix warning: database /etc/aliases.db is older than source file /etc/aliases

    November 6, 2014 by The Man

    Simply run

    sudo postmap /etc/aliases

    Then restart Postfix with

    sudo service postfix restart


  4. Gleylist spammers on Ubuntu using Postfix and Postgrey

    November 3, 2014 by The Man

    1. Hopefully you have Postfix already installed so simply install Postgres

    sudo apt-get install postgrey

    2. Edit the Postfix config file /etc/postfix/main.cf and add or amend

    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,
    reject_unauth_destination, reject_unknown_sender_domain,
    check_policy_service inet:127.0.0.1:10023

    (more…)


  5. Updating WordPress from the command line

    September 9, 2014 by The Man

    Just a reminder for me…

    wp core update /var/www/wordpress-4.0.zip


  6. Use IPTABLES to block those pesky spammers.

    August 29, 2014 by The Man

    I recently had a spate of attacks on my site from bots trying to find weaknesses in WordPress and MySQL. I mainly just log and report but after a while of the same IP over and over I decided to just block it. So here is how to block by IP addresses in Ubuntu or any Linux distro.

    sudo iptables -I INPUT -s 61.160.212.57 -j DROP

    and if you want to do a range

    sudo iptables -I INPUT -s 61.160.212.0/24 -j DROP

    would block everything in 61.160.212.x

    And yes this is the real spammers ip address out of China. Quite prolific.

    If you installed iptables-persistent you can use

    sudo /etc/init.d/iptables-persistent save

    to save your iptables.

    Update

    Because I keep forgetting, here is another way to save if you use iptables-persistent

    sudo dpkg-reconfigure iptables-persistent