depicus

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

Blants (noun) the rants of a blogger

  1. 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 πŸ™‚


  2. 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


  3. Sometimes I wonder if spammers are really putting their heart into their work

    April 4, 2015 by The Man

    I’m not really sure anybody tried too hard when writing this spam message…

    Screen Shot 2015-04-02 at 09.55.11


  4. Change Postfix port number

    March 31, 2015 by The Man

    Sometimes you want to send out but not have every spammer try and send you rubbish on port 25 so changing to a non standard port helps with automated spammers.

    First edit the config file

    sudo nano etc/postfix/master.cf

    and find the line

    smtp inet n – n – – smtpd

    and change to

    9876 inet n – n – – smtpd

    and then save and restart Postfix

    sudo service postfix restart

    then if you need to check simply grep

    netstat -tanp | grep 9876

    which should give you at least a line like this

    tcp 0 0 0.0.0.0:9966 0.0.0.0:* LISTEN


  5. Wake on Tweet – because you never asked for it…

    December 30, 2014 by The Man
    Wake on Tweet

    Wake on Tweet

    tl:dr Just send a tweet with the hashtag #wakeonlan and a properly formatted mac address like AA:BB:CC:DD:EE:FF, an ip address or FQDN and a port number and that is it. Easy.

    It all started a few weeks ago when I was looking at Slack to use at a clients site so we could integrate more. If you haven’t tried Slack I would highly recommend taking a look – it’s WhatsApp for groups with a steroid injection of crazy fun stuff for developers. One of those fun things are hooks where you can define actions when things happen. So I have Slack hook alert to a group called #twitter whenever a tweet mentions @depicus it would call a webpage on a server. Sadly the info Slack passes wasn’t enough for me as it doesn’t include the message body of the tweet. So sadly my brave idea of Wake on Lan via Twitter died….

    (more…)


  6. Check slow WordPress sites with Splunk and fix them

    December 26, 2014 by The Man

    I’d thought this site was a bit sluggish, it’s a WordPress site with quite a few plugins as I often like to play with new WordPress stuff. I’m now running a Splunk server at home, again, mainly for testing and development for a new project for one of my clients. One of Splunks Apps is a web site monitor and I decided to give it a go.

    splunk-web-monitor

    As you can see from the image above my blog was hitting the red slow response time all the time. It was time to remove some old pluggins, anything that was not being used. The after was a lot better and pages come it smother now. Some pluggins can be like toolbars, often not needed and they just slow things down.