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 / df
Created February 2, 2019 15:28
[List disk storage info] #Linux
# Prints out a list of storage drives with their sizes, usage, and locations
df -ah
@Banhawy
Banhawy / ipconfig
Created February 2, 2019 15:25
[Find IP address of current machine] #linux
# Detailed view
ipconfig
# Filter the results
ipconfig | grep inet
@Banhawy
Banhawy / run-in-background
Created February 1, 2019 15:17
[Run proccess in background] #linux #node
# Will return the process id
nohup any_command &
@Banhawy
Banhawy / list-containers-horizontally
Created February 1, 2019 14:37
[Horizontal Docker Display] #docker
# This can be in .zshrc or .bash_profile
export FORMAT="\nID\t{{.ID}}\nIMAGE\t{{.Image}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.RunningFor}}\nSTATUS\t{{.Status}}\nPORTS\t{{.Ports}}\nNAMES\t{{.Names}}\n"
docker ps --format $FORMAT
@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;
@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 / 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 / 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 / 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 / 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)