This file contains hidden or 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
| #!/bin/bash | |
| if [ "$#" -ne 3 ] || ! [ -d "$1" ]; then | |
| echo "Usage: $0 THEMEDIR $1 ADMINDIR $2 COPYNAME" >&2 | |
| exit 1 | |
| fi | |
| #The admin controller needs a capitalized theme name | |
| function capitalize_first(){ | |
| string0=$COPY |
This file contains hidden or 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
| #!/bin/sh | |
| # in case of `mysqlcheck -o` not available | |
| [ -z "$1" ] && exit 1 | |
| db="$1" | |
| for table in $(mysql -Nse "SHOW TABLES" "$db"); do | |
| mysql -Nve "OPTIMIZE TABLE \`$table\`" "$db" | |
| done |
This file contains hidden or 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
| <style> | |
| .read-more.collapse { | |
| position: relative; | |
| display: inherit; | |
| height: auto !important; | |
| transition: none !important; | |
| } | |
| .read-more.collapse.in, | |
| .read-more.collapsing { | |
| position: relative; |
This file contains hidden or 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
| #!/bin/sh | |
| # install Midnight Commander locally (without root) | |
| wget https://download.opensuse.org/repositories/home:/laurentwandrebeck:/mc/CentOS_7/x86_64/mc-4.8.27-1.1.x86_64.rpm | |
| (mkdir rpm && cd rpm/ && rpm2cpio ../mc-4.8.27-1.1.x86_64.rpm | cpio -idv) | |
| echo "export MC_DATADIR=~/rpm/usr/share/mc" >> .bashrc | |
| echo "alias mc=~/rpm/usr/bin/mc" >> .bashrc | |
| cp -rp rpm/usr/libexec/mc/* .local/share/mc/ |
This file contains hidden or 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 | |
| /** | |
| * Simple PHP 301 redirect script: Space separаted list of redirects loaded from redirect.txt | |
| * | |
| * @author Andrey Chesnakov | |
| * @link https://clayrabbit.ru | |
| */ | |
| if (!empty($_SERVER['REQUEST_URI']) AND $_SERVER['REQUEST_URI'] != '/' AND file_exists('redirect.txt')) { | |
| $request = explode('?', $_SERVER['REQUEST_URI'], 2); | |
| foreach(file('redirect.txt') as $str) { |
This file contains hidden or 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
| #!/bin/sh | |
| # file: ttfb.sh | |
| # curl command to check the time to first byte | |
| # ** usage ** | |
| # 1. ./ttfb.sh "https://google.com" | |
| # 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com" | |
| curl -so/dev/null -w"Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" "$1" |
This file contains hidden or 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
| #!/bin/sh | |
| # https://gist.github.com/ClayRabbit/0441561b409fe631a6ab5df88e759b37 | |
| # OpenCart invoker for crontab or CLI | |
| # Alternative to `wget -O- -qt 1 https://...` | |
| [ -z "$1" ] && echo "Usage: $0 [options] [admin/]extension/module/route1 [extension/module/route2 ...]" && exit 1 | |
| initial_dir="$(pwd)" | |
| oc_dir=$(cd $(dirname "$0") && pwd) | |
| php="$(env which php)" |
This file contains hidden or 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
| #!/bin/sh | |
| HOSTNAME=$(hostname) | |
| sudo apt-get update | |
| sudo apt-get install -y nginx | |
| sudo apt-get install -y mysql-server mysql-client | |
| sudo apt-get install -y php-fpm | |
| sudo apt-get install -y composer |
NewerOlder