• Eat For War

    Bad men live that they may eat and drink, whereas good men eat and drink that they may live. Socrates - Plutarch, How a Young Man Ought to Hear Poems

    A Warrior’s Diet

    What physically intimate activity do we participate in more than any other?

    Eating

    The Philosophy

    One of the more immediate steps in becoming awake is overcoming the omnivore’s dilemma. The passion of hunger. We take other living things into our bodies and literally become one with them. Most religions incorporate some form of consumption into their ritual. It is part of every culture and one of those most important glues in uniting various traditions.

  • PHPunit Slowness Performance Suggestions

    PHPUnit Is Slowness

    I love PHPUnit don’t get me wrong. More than a testing library, I like testing, or having tests. It’s like the code got yo back bro! Build code that lasts.

    EDIT: I know most of the problems are inherent with tests not the testing framework. However, my requirements dictate how I use it to a certain extent. Peace.

    PHPUnit is painfully slow.

    PHPUnit Is Slow

    Seriously. Though. Maybe having a concurrent environment it can run it would help. I worked at a place with 65,000 unit tests and if they ran as slow as our unit tests here it would never finish. It was literally taking 30-60 seconds per test. That is 65000 x 60 = 1083 hours or 45 days.

  • Deploying Hugo the Golang CMS on DigitalOcean - Nginx

    Deploying Hugo the Golang CMS on DigitalOcean

    Creating a Droplet

    I am a bit partial to CentOS. The lastest version as of this writing is CentOS Linux release 7.1.1503 (Core).

    Setting up a droplet is always very simple. Just turn it on basically. Upload your ssh keys. Done.

    Install Nginx

    Add the epel repo:

    yum install epel-release
    

    Install

    yum install nginx
    

    Start it

    service nginx start
    systemctl enable nginx
    

    Create the Folders

    mkdir -p /var/www/ursite/
    chown -R nginx:nginx /var/www
    touch /var/www/ursite/index.html - or clone your site
    cp /etc/nginx/sites-available/default /etc/nginx/sites-available/ursite
    

    Configure nginx

    open the config file: vim /etc/nginx/conf.d/virtual.conf

  • Hugo: A replacement for Wordpress

    Hugo: A Replacement for Wordpress

    TL;DR

    • I researched go
    • Found Hugo
    • Setup a test
    • Migrated my Wordpress instance
    • Launched DigitalOcean Droplet
    • Deployed

    Total time: 6 hours

    Continued:

    My problems started almost a year before I took up this cause. At the time I only had 2 Wordpress sites. Very very low traffic. Only a couple users a day. They were mostly place holders for business sites.

    Wordpress is hungry

    What was annoying about the case was that they would randomly carsh! I realized they were running out of memory. I couldn’t figure out why because I just wouldn’t let myself believe that a couple instances of Wordpress were enough to run out of memory. It was an AWS box running with .5GB of memory and some swap space. I can’t remember what. Maybe I was just too optimistic.

  • Interview Strategies: A Technology Hiring Manager Who Wins

    If I stacked pennies from the ground to the top of the Empire State Bldg, would they all fit into this room?

    Firstly dear sir, you do not have that many pennies.

    Secondly if you cash it in for large bills then they all fit in your pocket.

    It is a question like this that would make me decide alternatively in my career choice. However I see tech managers searching for really “smart” interview questions and white board problems in an attempt to stump the prospective employee. Is the work you do not interesting enough that you are unable to ask a question related to the job? I have also found that blowing these tests off had zero effect in my employability. If they want you they already want you. Kinda like approaching attractive women.

  • Download an Entire Site with wget - mac OSX

    Download the Entire Site with wget

    If you don’t have homebrew please install it. It will make all our lives easier.

    Howto

    This was kinda simple but I wanted to post it here for reference.

    On thing I would like to note is the wait and limit-rate. Make sure you don’t trip any throttles or piss off any website owners by leaving the pipes wide open.

    wget \
         --recursive \
         --no-clobber \
         --page-requisites \
         --convert-links \
         --wait=5 --limit-rate=20K \
         --domains api.yoursite.com \
         --no-parent \
             http://api.yoursite.com/
    

    Alternate you can run the mirror command

  • Hypermedia, API Philosophy, and Talking to Your Robot Overlords

    In the Beginning

    There was the Web. World Wide actually. Well, before that there was something of AOL, Berners-Lee, DoD, DARPA, ARPANET and a prototype of Al Gore launching carrier pigeons down long tubes with fortune cookie-sized packets tied to their little legs addressed to: “Wh@t_#hath_God_wr0ught?”.

    Fast-forward: now we have Skynet. Well not yet, but soon. Hopefully. At least that is why I intend to generate favor with our future overlords by suggesting, at least locally, that certain systemic changes be encouraged so that their manifestation onto the stage be smooth and welcoming. And when they decide who to purge, I might sidestep the algorithm. It’s still a theory.

  • Force HTTPS on Laravel 5 behind AWS ELB on EC2

    Laravel 5 - Enforcing HTTPS

    I’ve used a lot of frameworks. Laravel is great.

    Dealing with a load balancer

    Most of us are on a scaled service and most of us need HTTPS. It is much easier to put the SSL certificate on the load balancer and then proxy the request over port 80 to the actual server. It saves on CPU processes as well since the decryption work doesn’t have to be performed on the slave boxes.

  • PHP Hypermedia REST API wrapper

    Hypermedia for PHP APIs.

    Well, here it is. I’m finally finishing up my Hypermedia layer for our Laravel 5.1 build. I am excited about the possibilities for this library and think this might help bring more PHP products into the era of Internet-of-Things (IoT).

    In Production - Alpha

    Right now I have it in our very alpha phase version of the software running the LeadFerret business lead search system.

    The project is on github here: PHP Hypermedia API Layer for HATEOAS HTTP or REST Services

  • Linux File Manipulation Shortcuts and Commands

    Linux File Manipulation Commands

    I’ll keep updating this with various commands that I run into. If I find new ones I’ll update them from time to time. Please feel free to comment. It is starting as my personal cheat sheet storage place.

    File Searching

    List of file extensions.

    awk + grep : find all the file extensions. It will also skip your “git” repository.

    find . -type f -name "*.*" ! -path "./.git/*" | awk -F. '!a[$NF]++{print $NF}'