Skip to content

Instantly share code, notes, and snippets.

View shabayekdes's full-sized avatar
❤️
code. eat. sleep. loop

Esmail Shabayek shabayekdes

❤️
code. eat. sleep. loop
View GitHub Profile
# How to install and run kubernetes locally (Ubuntu)
## 1. Intsall [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/)
## 2. Intsall [MiniKube](https://minikube.sigs.k8s.io/docs/start/)
## 3. Add Docker to Sudo group:
```bash
# (required) to be able to start minikube
$ sudo groupadd docker
{
"schemaVersion": 1,
"label": "is it monday",
"message": "no",
"color": "orange",
"namedLogo": "phpmyadmin"
}
@shabayekdes
shabayekdes / .zshrc_aliases
Created December 29, 2021 11:55
php aliases
# Git
alias g='git'
alias gs='git status'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias wip="git add . && git commit -m 'wip'"
alias nah="git reset --hard && git clean -df"
# Laravel
alias pa='php artisan'
alias pam='php artisan migrate'
@shabayekdes
shabayekdes / domain.sh
Last active December 14, 2021 21:51
Create nginx block domain
#!/bin/bash
# Check if arguments is empty domain
if [ $# -eq 0 ]
then
echo "No arguments supplied"
fi
domain=$1
php="7.4"
if [ -n "$2" ]
@shabayekdes
shabayekdes / wp-localhost-requests.php
Created December 5, 2021 18:33
Allow localhost http requests
<?php
/**
* Plugin Name: Allow localhost http requests.
* Plugin URI: https://gist.github.com/saas786/a567363477df7e28b0c1df6295cadf75/
* Description: Note: Please don't use it on live website. If you are working locally, sometimes you get errors such as "A valid URL was not provided" or such, specially when you are interacting with website which is also hosted locally, so it becomes annoying at times to find the cause, and most of the time its wp_safe_remote_request, wp_safe_remote_get or wp_safe_remote_post functions who are the culprit. So this plugin is a quick fix.
* Author: saas786
* Version: 0.1
*/
add_filter( 'http_request_host_is_external', 'wplr_http_request_host_is_external' );
function wplr_http_request_host_is_external(){
@shabayekdes
shabayekdes / fix_github_https_repo.sh
Created December 2, 2021 22:08 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@shabayekdes
shabayekdes / laravel-permissions.md
Last active November 29, 2022 12:02 — forked from Daniyal-Javani/permissions
Set up File Permissions for Laravel

Local Development

sudo chown -R $USER:www-data .
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
@shabayekdes
shabayekdes / .env
Last active December 2, 2021 15:30
Laravel, Nginx, and MySQL with Docker Compose
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=laraveluser
DB_PASSWORD=your_laravel_db_password
@shabayekdes
shabayekdes / install.md
Last active December 2, 2021 11:44
Configure Git SSH Keys

Step 1: Create SSH directory in home

mkdir $HOME/.ssh

Step 2: Generate a new set of keys

ssh-keygen -t rsa -b 4096 -C "esmail.shabayek@gmail.com"
  • You will then be prompted to "Enter a file in which to save the key."

Advertisement :)

  • pica - high quality and fast image resize in browser.
  • babelfish - developer friendly i18n with plurals support and easy syntax.

You will like those projects!