depicus

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

Blants (noun) the rants of a blogger

  1. Ubuntu find text in a folder recursively

    February 10, 2016 by The Man

    Very simple just grep it

    grep -r "WakeOnLanGui.zip" /var/www

    where WakeOnLanGui.zip is the text you want to find and /var/www is the folder and subfolders you want to search.

    Easy 😉


  2. Clear out the Postfix queue

    December 7, 2015 by The Man

    If you find that your Postfix mail server is full of spam messages waiting to go out you can check the mail queue with

    mailq

    n.b. Postfix needs to be running for this to work but not if you need to purge the queue simple use

    postsuper -d ALL


  3. letsencrypt.org and XP – a bodge fix for chrome

    December 4, 2015 by The Man

    Ok as luck would have it the second site I set up letsenrypt.org‘s new certificates on the client was using Windows XP and Chrome and got this nasty error message when I redirected the http to https.

    Now I’m a firm believer of https everywhere – yes I know it doesn’t solve every problem but it helps. So the options were bleak according to a github issue but if you are using Apache it’s possible to bodge a solution so XP Chrome clients can still see your site.

    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_USER_AGENT} !(Windows\ NT\ 5.1|Windows\ NT\ 5.2) [NC]
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}

    So what are we doing here.

    First we check to see if https is off – not sure this is really needed as we are putting this in our :80 .conf file.

    Then we check its NOT XP with the !

    And finally we redirect to the https address.

    Now we could get really clever and just check for Chrome on XP and I may work on that as I plan to use letsencrypt.org wherever I can 🙂


  4. depicus is https now thanks to letsencrypt.org

    December 3, 2015 by The Man

    If you haven’t heard of letsencrypt.org they are “Let’s Encrypt is a new Certificate Authority: It’s free, automated, and open”

    Basically they will issue ssl certs for web sites free and in milliseconds, and here’s how.

    1. Get hold of the letsencrypt program

    git clone https://github.com/letsencrypt/letsencrypt
    cd letsencrypt
    ./letsencrypt-auto --help

    Then for me it was just a question of running

    ./letsencrypt-auto --apache -d depicus.com -d www.depicus.com

    And within seconds we are https – cool as <3


  5. 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…


  6. Ubuntu network setting – because I always forget

    December 26, 2014 by The Man

    This is just so I can remember how to do it.