Skip to content

Instantly share code, notes, and snippets.

View asamofal's full-sized avatar
🇺🇦

Anton Samofal asamofal

🇺🇦
View GitHub Profile
#!/bin/bash
##################################################
# auto wakeonlan v. 1.4
# Anton Samofal, 2018
##################################################
# set MACs for wakeup
declare -A macToWake=(
[Anton_Sam]=b0:6e:bf:c4:66:65
@asamofal
asamofal / MySQL_tunning
Last active June 25, 2018 07:16
add it to /etc/mysql/my.cnf
[mysqld]
# Increase available RAM memory size for MySQL server
# Default: 135M
innodb_buffer_pool_size = 1G
# Split memory pool by multiple instance
# Default: 1
innodb_buffer_pool_instances = 8
# Increase size of redo log file
# Default: 50M
innodb_log_file_size = 256M
sudo apt install sshfs
sudo mkrid /mtn/FOLDER_NAME
If you have a ssh key:
sudo sshfs -o allow_other,default_permissions,IdentityFile=~/.ssh/id_rsa USER_NAME@HOST_NAME:/ /mnt/FOLER_NAME
If you have only a password:
sudo sshfs -o allow_other,default_permissions USER_NAME@HOST_NAME:/ /mnt/FOLER_NAME
Permanently Mounting the Remote File System:
# remove access via domain.com/phpmyadmin
nano /etc/phpmyadmin/apache.conf
#Alias /phpmyadmin /usr/share/phpmyadmin
# create new virtualhost for subdomain:
nano /etc/apache2/sites-available/pma.conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName pma.demo-itmaster.com
@asamofal
asamofal / xdebug (remote)
Created January 21, 2019 08:44
How to setup xdebug for remote debugging
# install xdebug extension
apt install php-xdebug
# config xdebug
/etc/php/7.2/<fpm> or <apache2>/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 0
xdebug.remote_host = localhost
xdebug.remote_port = 9001
@asamofal
asamofal / homestead-manual-install.md
Last active August 15, 2019 07:41 — forked from idecardo/homestead-manual-install.md
Laravel Homestead Manual Installation

Getting Started

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. Read more...

Download

Download homestead box:

#!/bin/bash
##################################################
# DeskTime updater v1.0
# Anton Samofal, 2019
##################################################
# design
txtbld=$(tput bold)
red=${txtbld}$(tput setaf 1)
wget -qO- bench.sh | bash
cd /etc/update-motd.d
sudo chmod -x 10-help-text 50-motd-news
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://nginx.org/packages/keys/nginx_signing.key | sudo gpg --dearmor -o /etc/apt/keyrings/nginx.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/nginx.gpg] http://nginx.org/packages/ubuntu \
$(lsb_release -cs) nginx" | sudo tee /etc/apt/sources.list.d/nginx.list > /dev/null
sudo apt update
sudo apt install nginx
nginx -v