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 / source-command
Created January 30, 2019 11:15
[Reload bash_profile in same session] #bash #linux
source ~/.bash_profile
@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 / 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 / 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 / Secure-Copy
Created January 25, 2019 16:54
[SCP] Copy files from and to remote servers #linux #bash
# Copy one single local file to a remote destination
scp /path/to/source-file user@host:/path/to/destination-folder/
# Copy one single file from a remote server to your current local server
scp user@host:/path/to/source-file /path/to/destination-folder
# Copy one single file from a remote server to another remote server
scp user1@server1:/path/to/file user2@server2:/path/to/folder/
# Copy multiple files with one command
@Banhawy
Banhawy / Creat new admin user command
Last active January 24, 2019 10:23
[Magento: Create a New Admin User] Using the Command-line #magento #php
php bin/magento admin:user:create --admin-user="<username>" --admin-password="<password>" --admin-email="<email>" --admin-firstname="Admin" --admin-lastname="Admin"
@Banhawy
Banhawy / Find-Admin-Url-Command
Last active January 24, 2019 16:30
[Magento: Finding Admin Url] On the server's Magento folder's root type the following command #magento #php
php bin/magento info:adminuri
@Banhawy
Banhawy / .eslintrc.js
Last active February 19, 2018 18:39
integrating eslint into any project with babel
module.exports = {
"parser": 'babel-eslint',
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
{
"presets": ["latest", "stage-0", "react"]
}
{
"name": "twitch",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.0",
"node-sass-chokidar": "0.0.3",
"npm-run-all": "^4.1.1",