Skip to content

Instantly share code, notes, and snippets.

View ceilidhboy's full-sized avatar

Mike Scott ceilidhboy

View GitHub Profile
@ceilidhboy
ceilidhboy / www.nginx.md
Created April 13, 2024 20:10
Add a www redirect to nginx configuration

Add the following block before the existing server block, in the nginx configuration, where domain-name.com is the domain of the website:

server {
        server_name www.domain-name.com;
        return 301 $scheme://domain-name.com$request_uri;
}
@ceilidhboy
ceilidhboy / add-composer-run-dev.md
Created April 26, 2025 08:14
Add new `composer run dev` command to existing Laravel app

The composer run dev command was added in Laravel 11.28 but it doesn't get added automatically to projects that were created with an earlier Laravel version and then upgraded beyond 11.28.

To add the command, edit composer.json and add the following to the "scripts" section after the last script entry:

,
        "dev": [
            "Composer\\Config::disableProcessTimeout",
 "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
@ceilidhboy
ceilidhboy / axios-vulnerability-scan.sh
Last active April 18, 2026 11:42
BASH script to scan for compromised axios package (v1.14.1)
#!/bin/bash
# by Mike Scott 18-Apr-26
COMPROMISED_AXIOS="1.14.1"
COMPROMISED_AXIOS_OLD="0.30.4"
COMPROMISED_PLAIN_CRYPTO="4.2.1"
RED='\033[0;31m'
GREEN='\033[0;32m'
AMBER='\033[0;33m'