Categories
Apple OSX

Flushing your DNS on Big Sur

It’s always DNS! – every time When ever something on the internet doesn’t work, it’s always DNS. DNS is a vital part of everything we do, but it also should be the first thing to check when something “just doesn’t work”. Just ask the Auzre guys and girls from their recent world-wide issue. On OSX […]

Categories
Apple OSX

Disable Apple Messages from “Smart Quoting” your code in messages

Do you use Apple’s Messages to send code snippets to text to other developers, or to yourself, BUT messages converts your ” and ‘ to smart quotes and when you then copy that code and … it doesn’t work? That’s annoying! The Fix: Open Terminal or iTerm on your Mac and paste in the following […]

Categories
Code PHP Servers

Auto-deploy your PHP app with Bitbucket Pipelines

I’ve got to admit – I’m old school! Then we moved to subversion, woah, this is cool! Then SSH to the relevant webserver, cd to the right dir, and calling svn up, that’s progress! Then we introduced load-balancing and multiple app servers, so we wrote a bash script we can call from our mac’s that […]

Categories
Code OSX PHP

Setting up OSX Big Sur with Valet, PHP & MySQL for Web Development

In this post I’ll post all of the steps to set up your Mac for PHP web development. We will be setting up OSX Big Sur with Valet, PHP & MySQL. I’ll be using the follow tools: OSX Big Sur 11.2.3 iTerm (or osx terminal) Homebrew Composer 2 Laravel Valet PHP 8 and PHP 7.4 […]

Categories
Linux mySQL Servers

Hourly MySQL Backups with a BASH Script

Here is a script I recently wrote to run hourly backups of our production database server.It’s important to note here a couple of things;  This *could* use a lot of disk space! Backups are processor heavy, I’m running mine on on a dedicated VPS connecting to the SLAVE in a MASTER => SLAVE SLAVE replication […]

Categories
Code PHP

Simple PHP Script to Pluralize Month names

You often need to refer to a Month’s name in the Plural, Eg, “I want Junes Database back up” or “Display Marches Orders”.  Here is a very simple PHP function to show the nice Pluralized month, simply don’t pass in a param to show hte current months plural, or pass in the PHP Date’s ‘n’ ( […]

Categories
mySQL Servers

Finding disk usage on Linux/Ubuntu

There are a few ways to see how much free or used disk space in linux;The  easiest way is to use: If you want to drill down and find where all your disk space has gone, then ncdu is the best too, all day. On Ubuntu you can apt install this repo, else there are installation instructions […]

Categories
Code PHP

Basic REGEX for cleaning and prepping data

Over the 15 years or so, I have used the PHP Framework CodeIgniter, Amongst many of its good features is its built in Form Validation Library. Every now and then I need to write adhoc code, or help others to write or develop sections of their site, I happy to help friends in need. Today […]

Categories
Code PHP

Calculating memory used by PHP to generate that page

Do you know how much memory those loops are using ?Why is this page taking so long to load ?Well with this simple PHP code you can daily benchmark different versions of your script to use the least possible amount of Memory.

Categories
Code CSS

Webkit custom scroll bars

Webkit browsers such as Safari and Chrome support some superb CSS3 styling.They are ( even thought I use firefox as my primary browser ) the most advanced browsers. For a while now I have created custom scroll bars using a Javascript library called Mootools, other libraries such as jQuery and Prototype can do this too, […]