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
sudo apt install -y htop net-tools mc curl gnupg2 ca-certificates lsb-release ubuntu-keyring | |
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null | |
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ | |
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \ | |
| sudo tee /etc/apt/sources.list.d/nginx.list | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:ondrej/php | |
apt update | |
apt install -y htop net-tools mc nginx mysql php8.0-common php8.0-cli php8.0-fpm php8.0-{curl,intl,mysql,readline,xml,mbstring} |
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
#!/bin/bash | |
DIR=/var/www | |
USER=grvoyt | |
GROUP=www-data | |
chown -R $USER:$GROUP $DIR | |
find $DIR -type f -exec chmod 644 {} \; | |
find $DIR -type d -exec chmod 755 {} \; |
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
#!/bin/bash | |
#settings | |
chat_id= //chat_id | |
api_key= //bot api key | |
#code | |
file=$1 | |
url=https://api.telegram.org/bot$api_key/sendDocument |
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
$(document).ready(function() { | |
window.myAfterSendedFunction = function($form){ | |
//id yandex метрики | |
var metrikID = 99999999; | |
var goal = $form.find('[name=tildaspec-formname]').val(); | |
var res = window['yaCounter'+metrikID].reachGoal(goal); | |
console.log(yaCounter51697628, res) | |
return true; | |
} |
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
function youtube_parser(url){ | |
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/; | |
var match = url.match(regExp); | |
return (match&&match[7].length==11)? match[7] : false; | |
} |
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
//delete files | |
$dir = dirname(dirname(dirname(dirname(dirname(__FILE__))))); | |
exec('cd '.$abs.' && rm -rf *'); | |
//delete database | |
$sql="SELECT Concat('TRUNCATE TABLE ', TABLE_NAME) as cmd FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'u0614655_itc_stone'"; | |
$pdoTools=$modx->prepare($sql); | |
$pdoTools->execute(); | |
$rows = $pdoTools->fetchAll(PDO::FETCH_ASSOC); |
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
chown -R www-data:staff ./ | |
sudo find ./ -type f -not -path "./vendor/*" -print0 | xargs -0 sudo chmod 644 | |
sudo find ./ -type d -not -path "./vendor/*" -print0 | xargs -0 sudo chmod 755 | |
cp -n .env.example .env | |
cd docker | |
cp -n .env-example .env | |
source .env | |
docker-compose build | |
docker-compose up -d | |
docker-compose exec -T app sh -c 'composer install' && docker-compose exec -T app sh -c 'php artisan migrate' && docker-compose exec -T worker sh -c 'php artisan queue:restart' |
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
if( window.history && window.history.pushState ){ | |
history.pushState( "nohb", null, "" ); | |
$(window).on( "popstate", function(event){ | |
if( !event.originalEvent.state ){ | |
history.pushState( "nohb", null, "" ); | |
return; | |
} | |
}); | |
} |
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
#!/bin/bash | |
name=$1 | |
modx=$2 | |
mkdir $name && | |
cd $name && | |
mkdir html psd && | |
cd html && | |
touch index.html |
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
RewriteEngine on | |
RewriteCond %{HTTP_USER_AGENT} android [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} opera\ mini [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} blackberry [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} iphone [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} (pre\/|palm\ os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} (iris|3g_t|windows\ ce|opera\ mobi|windows\ ce;\ smartphone;|windows\ ce;\ iemobile) [NC,OR] | |
RewriteCond %{HTTP:Accept} (text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml) [NC,OR] | |
RewriteCond %{HTTP:Profile} .+ [NC,OR] | |
RewriteCond %{HTTP:Wap-Profile} .+ [NC,OR] |
NewerOlder