Skip to content

Instantly share code, notes, and snippets.

View phpcodertop's full-sized avatar
🏠
Available for remote work

Ahmed Maher Halima phpcodertop

🏠
Available for remote work
View GitHub Profile
@phpcodertop
phpcodertop / gist:94e725bfa78aed5ddf5cb6a44342f864
Created September 12, 2022 16:54
Laravel Fix permissions
sudo find /var/www/html -type f -exec chmod 644 {} \;
sudo find /var/www/html -type d -exec chmod 755 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
@phpcodertop
phpcodertop / Cpanel recommended configurations and tweaks after instllation
Last active May 10, 2023 22:26
Cpanel recommended configurations and tweaks after installation
@phpcodertop
phpcodertop / fix-wordpress-permissions.sh
Created October 31, 2020 00:19 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
To isolate the layer in which the issue is occurring, information concerning kernel, firewall and network interface states will help in resolving the issue at hand.
You should be able to leverage the Web Console for the droplet to evaluate the details of the following commands.
First, we would recommend reviewing the contents of your interface configuration file.
From here you can ensure that there is an entry for your public interface and that it contains correct information including your public IPv4 address, gateway, netmask, etc.
If needed, you can reference the information made available to you on the 'Networking' page of your Droplet or under your web console screen to ensure this information is correct.
cat /etc/netplan/50-cloud-init.yaml
Next, you will need to ensure that your network managing service is able to pick up on these details and bring up your public interface.
@phpcodertop
phpcodertop / drop-all-db-tables.sh
Created September 20, 2019 22:55
Drop all tables using shell script
#!/bin/bash
MUSER="$1"
MPASS="$2"
MDB="$3"
# Detect paths
MYSQL=$(which mysql)
AWK=$(which awk)
GREP=$(which grep)
<?php
require 'vendor/autoload.php';
use Mailgun\Mailgun;
$base64Image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeUAAAFaCAMAAAAXcrXwAAACplBMVEUAAAD/zJn//zP/ZjMAAAAAZv+ZzJn/mZnMzMxmmZnMZmaZZsx+fn7U1NT//wAqKioqKgfT0yn//fMqEQjTVCkqGBgJBgJ+MhgiIiIZIhkIBg0AVNP//35+fhjU1ADTfn7//5kAMn5/fwBLZUuqqqra2tozMzMiERETFBR+qX7p6el+ZUt+S0vTqn8RGRgqIhlmZmZUVFQZESIVEQx/VapUfn7//yb2xZOioqIVCAMjHBWMjIxmMzP0YTD19TBxcXGrVVUVFQPq6i4jIwZVRDPpu4zbr4P//8zrXS5MM2ZbW1v//w+xsbGqiGbb2ysBBAwzTU0jDQb//yuLuouZmZn//2ZwWUPpi4sPCA5wLBXGnneePx9dSjfbVyuNcVUMEQz1k5NMTA4AWOAAECo5LCJubhIAYfRUVBAAQ6kKDAr//6uqqiGUOx2Dr4PFxSYxJx2LixsAXesATMAAH08hLiY+IiKbmx40FAqigmFYMjK6SiWMNxtMHg51nHVBV0HHTyf39wBXg4MAFjgzMwCSYcLNpHtAYWGbfF3//+aGWbOTkxwbGxs6Ogvbg4OnZGSsRCIbDw5kQoVMTEw0IkW9Xl7jWi1eJRIANom9vSVUIRDb2wB3T58AJmA1RzUiFi5PLCzMzCgADCBCGgy+vr7//7yMXbtejY0UDRyRwpFZO3dVVQAAPJgALG9ELVqjoyBOdXVbeltxQ0NiOjotPS1kZA+YW1ugT0/p6QBVcVX//1Tj4y1CQgzDdXVjhWMtRER+Pz9NPi4yGxsaGgT//6N6o3qLU1MkNjb/5MsAR7P/1KlrR4///4eDg4Oyamo8KFGMRkZJJCRbWxGsrAAsHTw9Hh7MzABwOTmysiOiogD/9Os
@phpcodertop
phpcodertop / 10-commandments-of-egoless-programming.md
Created August 7, 2018 19:27 — forked from gdumitrescu/10-commandments-of-egoless-programming.md
The Ten Commandments of Egoless Programming (Source: On Being A Senior Engineer)

The Ten Commandments of Egoless Programming

  1. Understand and accept that you will make mistakes.
  2. You are not your code.
  3. No matter how much "karate" you know, someone else will always know more.
  4. Don't rewrite code without consultation.
  5. Treat people who know less than you with respect, deference, and patience.
  6. The only constant in the world is change. Be open to it and accept it with a smile.
  7. The only true authority stems from knowledge, not from position.
  8. Fight for what you believe, but gracefully accept defeat.
Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
@phpcodertop
phpcodertop / analytics.conf
Created July 7, 2018 19:55 — forked from jirutka/analytics.conf
Add Google Analytics tracking code to HTML via nginx
#
# Add Google Analytics tracking code to HTML response
#
# Usage:
# set $tracking_id 'UA-12345678-9';
# include incl/analytics.conf;
#
# It needs nginx compiled with option --with-http_sub_module.
# Uses optimized GA code from: http://mathiasbynens.be/notes/async-analytics-snippet
#
This file has been truncated, but you can view the full file.
!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=93)}([function(e,t,n){"use strict";function i(e){function t(){l.add(e,"ps--focus")}function n(){l.remove(e,"ps--focus")}var i=this;i.settings=a.clone(c),i.containerWidth=null,i.containerHeight=null,i.contentWidth=null,i.contentHeight=null,i.isRtl="rtl"===u.css(e,"direction"),i.isNegativeScroll=function(){var t=e.scrollLeft,n=null;return e.scrollLeft=-1,n=e.scrollLeft<0,e.scrollLeft=t,n}(),i.negativeScrollAdjustment=i.isNegativeScroll?e.scrollWidth-e.clientWidth:0,i.event=new d,i.ownerDocument=e.ownerDocument||document,i.scrollbarXRail=u