Monday, November 20, 2017

Get row data from Datatables

You know how you'll have a action item on every row of your Datatable and need to get that row data when that item is clicked?



Here's how:

//
// create datatable
//
var table = $('#table').DataTable({
    ...
    ...
});

//
// handle clicks of the action selector
//
$('.action-selector').click(function(ev){
    var rowdata = table.row( $(this).parents('tr') ).data();
    //
    // rowdata now has the data from the row that 'action-selector' was clicked on
    //
}

Wednesday, November 8, 2017

Twilio 502 gateway errors when using Valet / ngrok.io

Are you getting 502 gateway errors when using Valet / ngrok.io with Twilio? Update your ngrok.io and it should fix it (press control-u while ngrok.io is running, then restart it).

Friday, September 15, 2017

composer update error: please create GitHub OAuth token to go over the API rate limit

While performing a "composer update" today I ran into an odd error. A lot was dumped to the screen, but this is the important part:

please create a GitHub OAuth token to go over the API rate limit

After Googling around for a bit, I stumbled into the solution.
  1. First, create a "Personal Access Token" in your github account. If you don't have a github account, you'll need one so sign up. Here's how you create that token: How to create a Personal Access Token on GitHub
  2. Make sure you copy this access token down. It is *only* display after creation. Once you leave that page, you will never be able to view it again at GitHub. I keep a copy of mine in my Dashlane Secure Notes section - use whatever tool you prefer.
  3. In your project root, enter this:

    composer config --global github-oauth.github.com <TOKEN>

    where <TOKEN> is the access token you created in step 1 above.

Saturday, September 9, 2017

Setting up a new Laravel 5.5 site

First change the ownership of storage and bootstrap/cache to nobody:

sudo chgrp -R nobody.nobody storage bootstrap/cache

Next, set the permissions:

sudo chmod -R 777 storage bootstrap/cache

Thursday, September 7, 2017

Back in the saddle.

It's been a while. Wife died and this kinda fell off the map. I remarried a few months ago and lets see if I can resurrect this...

Wednesday, January 28, 2015

Show all active TCP connections

To display all active TCP connections, at your command prompt:
netstat -tnlp
For example, from an AWS instance setup for serving web pages:
[root@t2-micro ssh]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address        Foreign Address       State       PID/Program name
tcp        0      0 0.0.0.0:80           0.0.0.0:*             LISTEN      2201/nginx
tcp        0      0 0.0.0.0:22           0.0.0.0:*             LISTEN      5103/sshd
tcp        0      0 127.0.0.1:9000       0.0.0.0:*             LISTEN      2197/php-fpm
tcp        0      0 0.0.0.0:3306         0.0.0.0:*             LISTEN      2723/mysqld
tcp        0      0 :::22                :::*                  LISTEN      5103/sshd

Friday, January 9, 2015

I've been a fan of Seagate since the venerable 2080. Seagate used to be the "go to" drive, but that no longer appears to be true.

A few years ago I started buying the FreeAgent GoFlex desktop external (USB 3.0) drives for backup purposes. Since it's used for backup, I need it to be reliable and why I went with Seagate (instead of Western Digital).

Both have failed and Seagate has swapped them out per warranty - no problems there. Guess what? One of the replacements has now failed and I no longer trust the other to not fail soon.

Time to start looking for a large SSD to be the replacement...