Skip to content

Instantly share code, notes, and snippets.

View Banhawy's full-sized avatar
🏠
Working from home

Adham El Banhawy Banhawy

🏠
Working from home
View GitHub Profile
@Banhawy
Banhawy / check-linux-distro
Last active February 2, 2019 15:20
[Check Linux Distribution] Terminal command to check which linux distro is being used #linux #bash
uname -r
or
uname -a
cat /etc/lsb-release
cat /etc/os-release
@Banhawy
Banhawy / install-sudo
Created January 29, 2019 10:48
[Install sudo on linux] And give users access to it #linux #bash
# Login as root & update and upgrade the os:
apt update
apt upgrade
apt install sudo
# Give a user access to use sudo
usermod -aG suo USERNAM
@Banhawy
Banhawy / install-php-7.sh
Created January 29, 2019 16:09
[Upgrade from PHP 5.X.X to PHP 7 on an AWS EC2 Linux Server] #linux #aws
#!/bin/bash
echo "==============================="
echo "Installing PHP 7"
echo "==============================="
sudo yum install php70
echo "==============================="
echo "Installing PHP 7 additional commonly used php packages"
echo "==============================="
@Banhawy
Banhawy / source-command
Created January 30, 2019 11:15
[Reload bash_profile in same session] #bash #linux
source ~/.bash_profile
@Banhawy
Banhawy / remove-image
Created January 31, 2019 11:31
[Romove Image] #docker
# romeve image by name
docker rmi <image name>
## romve all images
docker rmi $(docker images -a -q)
@Banhawy
Banhawy / install-nvm
Created January 31, 2019 12:35
[Install & Upgade Nodejs using NVM] #linux #javascript
# get nvm manager
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
#install nodejs version you need
nvm install v10.15.0
@Banhawy
Banhawy / check-node
Created January 31, 2019 14:24
[Check if Node installed is 32 or 64 bit] #javascript #node
# Will return 'arm', 'ia32', or 'x64'
node -p "process.arch"
@Banhawy
Banhawy / change-mode
Created February 1, 2019 09:49
[Change Magento mode] #magento
# Display current mode
bin/magento deploy:mode:show
# Change mode
bin/magento deploy:mode:set developer | production | default
@Banhawy
Banhawy / clear-cache
Last active February 1, 2019 11:25
[Clear Magento Cache] #magento
# https://magemojo.com/kb/knowledge-base/clear-magento-2-cache/
php bin/magento cache:flush
php bin/magento cache:clean
@Banhawy
Banhawy / commonly-used-commands
Created February 1, 2019 11:55
[MySQL commands] #mysql #magento
#https://www.liquidweb.com/kb/delete-a-mysql-database-on-linux-via-command-line/
# Login to the MySQL server using root
mysql -u root -p
# show all dbs
SHOW DATABASES;
# Delete a db
DROP DATABASE IF EXISTS db_name;