This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
BASE_DIR="/home/user/sites/site.com" | |
GIT_SSH="" | |
BRANCH="master" | |
SHARED=("failed" "temp" "uploads" "working") # root directories that will be moved into shared storage and symlinked on each deploy | |
# Dont forget to setup your SSH key in Github | |
############################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uploads everything in the current directory to Dropbox UPLOAD directory (change line 7) | |
# Configured for 2 threads, any more and you get api throttling errors | |
find . -type f -print0 | xargs -0 -n 1 -P 2 -I {} sh -c ' | |
file="{}" | |
log_file="uploaded_files.log" | |
dropbox_path="UPLOAD${file#.}" | |
# Check if file is already in log | |
if grep -qxF "$file" "$log_file"; then |
Inspired by Capistrano https://github.com/capistrano/capistrano
- Zero Downtime - Gets everything ready, and then switches the
current
directory symolic link - NPM Install
- Composer Install
- Persistant storage at /storage/
- 5 most recent releases are stored in /releases/ for quick rollback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare -A replacers | |
# Define the settings to be replaced or added | |
replacers[upload_max_filesize]=500M | |
replacers[post_max_size]=500M | |
replacers[max_input_vars]=5000 | |
replacers[memory_limit]=512M | |
replacers[max_execution_time]=360 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"github.com/gorilla/websocket" | |
"log" | |
"net/url" | |
"os" | |
"os/signal" | |
"syscall" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select id as contactid, firstname, lastname, email, phonenumber as phonebusiness from tblcontacts where CONCAT('44',TRIM(LEADING '0' FROM TRIM(LEADING '+44.' FROM REPLACE(phonenumber, ' ', '')))) = '@Number'; |
Do not copy and paste this code, it requires changes
Other PHP versions available here: https://gist.github.com/search?q=user%3Amrl22+moss
As of writing this, Moss.sh STILL does not support anything above PHP 7.4 via the control panel even though Ubuntu does.
Set up your website using Moss.sh and select Apache with PHP 7.4.
Once complete, we need to install PHP 8.3 with all the packages moss installs for 7.4.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
APC=$(apcaccess status) | |
NOMPOWER=$(echo "$APC"|grep NOMPOWER|cut -d' ' -f3) | |
LOADPCT=$(echo "$APC"|grep LOADPCT|cut -d' ' -f4) | |
WATTS=$(echo "$NOMPOWER / $LOADPCT"|bc) | |
echo "$WATTS Watts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: leo108 | |
* Date: 2017/8/14 | |
* Time: 15:44 | |
* | |
* Updated by Richard Leishman to support PHP 8.2 | |
*/ |
NewerOlder