Categories
Software WordPress

Easy PHP Upgrade

I had a few servers that needed upgrading from PHP7.2 to 7.3, so I wrote this little single-line command to help simply things.

It uses apt list to get the PHP modules that are currently installed with 7.2, and passes them through to apt install for 7.3.

sudo apt install $(apt list --installed | grep php7.2- | cut -d'/' -f1 | sed -e 's/7.2/7.3/g')

This can easily be modified for any PHP version later.

Categories
Software

Empty Space in macOS Dock

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
Categories
Software WordPress

Variable SSL certificate directives in nginx (part 2)

Feeling encouraged by my friend Jeremy Felt’s blog post on the subject, I thought I may finally be able to achieve the panacea of WordPress Multi-Network SSL configurations:

Continue reading “Variable SSL certificate directives in nginx (part 2)”
Categories
Software

Install nginx from source

At the time of this writing, the latest stable version of nginx is 1.16.0, and none of the package managers have updated themselves to include it.

Before you get started, you’ll want to be logged in to an open terminal session with a user that has sudo access. The reason for this, is because nginx itself requires root access when it starts up, to bind itself to lower number ports (usually 80 and 443.)

You’ll also notice that I use nano for editing files. Use what you prefer.

First, stop any version of nginx that might already be running:

sudo service nginx stop

Next, you’re going download the latest version of nginx directly from the official website:

cd ~/
wget http://nginx.org/download/nginx-1.16.0.tar.gz

Next, decompress it, and change into the new directory it made:

tar xvf nginx-1.16.0.tar.gz nginx-1.16.0/
cd nginx-1.16.0/

Next, you’ll probably want to install some related dependencies. Below is a pretty general list, but if you know better for yourself, replace these as needed:

sudo apt-get install -y curl build-essential make gcc libpcre3 libpcre3-dev libpcre++-dev zlib1g-dev libbz2-dev libxslt1-dev libxml2-dev libgd2-xpm-dev libgeoip-dev libgoogle-perftools-dev libperl-dev libssl-dev libcurl4-openssl-dev libatomic-ops-dev

Next, you’ll want to configure nginx.

There are about a million different ways to do this depending on your needs. For our purposes (and for most people reading this) the below approach should be sufficient:

sudo ./configure \
--user=nginx \
--group=nginx \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--with-select_module \
--with-poll_module \
--with-threads \
--with-file-aio \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
--with-http_xslt_module=dynamic \
--with-http_image_filter_module \
--with-http_image_filter_module=dynamic \
--with-http_geoip_module \
--with-http_geoip_module=dynamic \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_auth_request_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_degradation_module \
--with-http_slice_module \
--with-http_stub_status_module \
--with-http_perl_module \
--with-http_perl_module=dynamic \
--with-mail \
--with-mail=dynamic \
--with-mail_ssl_module \
--with-stream \
--with-stream=dynamic \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-stream_geoip_module \
--with-stream_geoip_module=dynamic \
--with-stream_ssl_preread_module \
--with-google_perftools_module \
--with-cpp_test_module \
--with-compat \
--with-pcre \
--with-pcre-jit \
--with-zlib-asm=CPU \
--with-libatomic \
--with-debug \
--with-ld-opt="-Wl,-E"

Many of the above flags are important, but I think the most important one for our purposes is --with-debug because without that flag, you cannot log any of nginx’s important debug information, in the event something isn’t working correctly.

Next, you need to build the executable from the configured source. You’ll make it and install it like this:

sudo make && sudo make install

Next, you’ll want nginx to autostart on boot, so:

sudo nano /lib/systemd/system/nginx.service

And put this in there:

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Then run these two commands and nginx should fire right up:

sudo systemctl daemon-reload
sudo service nginx start

All done!

Categories
Bad UI

Wi-Fi Calling – macOS

This glitchy bit of UI shows up after enabling WiFi calling on an iPhone.

Categories
Software Politics

Open source requires a senatorial style of leadership to move big projects forward since there isn't necessarily a single key decision maker.

Joe McGill

Categories
Software

Stop indexing your development directory

Are you a software developer?

Do you run macOS?

Do you frequently checkout files from third party code repositories?

Do you use an IDE like PHPStorm, Xcode, Atom, Netbeans, or something else?

Do you frequently run commands like npm install that reach out to the web and pull down a bajillion files you will literally never-ever open even if your life depended on it?

I do… and that’s why I block macOS Spotlight from indexing the parent directory to all of those files. It’s a dead simple and obvious thing to do once you think of it.

Continue reading “Stop indexing your development directory”

Categories
Software

Philips Hue Bug(Fix): Hue app “Link” button doesn not work.

The cause and fix for a long-lasting bug on the Philips Hue app that prevented users from “Linking” their phone and using Hue, resulting in being stuck.

Source: Philips Hue Bug(Fix): Hue app “Link” button doesn not work.

Categories
Software Fun

We’re gonna build a framework!

 

Categories
Opinion Software WordPress

On staying Indie

WordPress, to me, is an independent publishing platform. It grants me the right to complete & total autonomy when it’s desireable, but also allows me to group up with others when that makes sense too.

An article from The New York Times puts into a nice perspective why I think WordPress is really important to the future of the web.

Every pirated music video or song posted on YouTube or Facebook robs the creators of income, and YouTube in particular is dominated by unlicensed content. Google’s YouTube has an over 55 percent market share in the streaming audio business and yet provides less than 11 percent of the streaming audio revenues to the content owners and creators. But Facebook, which refuses to enter into any licensing agreement on music or video, is challenging YouTube in the free online video and music world.

And this…

“They are taking all the money,” he noted. “They have algorithms we don’t understand, which are a filter between what we do and how people receive it.”

I don’t think this is anything new – tides will shift, and new technologies will emerge to try and help with distribution of content – but it’s scary to me now that so much of what’s being published funnels out into our enormous world through only a few hoses.

There’s more money in the world changing hands than every in recorded history, and I suppose it’s always been this way – content creators are starving artists and content distributors are benefactors – but the trickle-down distribution of wealth continues to run perpetually dryer vs. wetter.

I think in the WordPress space, companies like Envato are undervalued. Their operating costs are surely not as low as one may think, yet they continue to pay out millions of dollars to digital artists & creators. I think there may be room for more Envato’s to carve out their own niches, and WordPress plugins like Easy Digital Downloads and WooCommerce are the long-term solutions for people hoping to have a sustainable independent lifestyle.