Skip to content

Instantly share code, notes, and snippets.

View MohamedMohsenX2's full-sized avatar

Mohamed Mohsen MohamedMohsenX2

View GitHub Profile
@MohamedMohsenX2
MohamedMohsenX2 / WP Security README.md
Created July 31, 2017 03:11 — forked from ericrasch/WP Security README.md
Hardening & Improving WordPress Security
@MohamedMohsenX2
MohamedMohsenX2 / gist:465640ed98d118c55d06d4f11243043f
Created January 28, 2018 13:28 — forked from ashokarun/gist:fef83b5949057187c1723597247155b6
Script to kill all MySQL processes for database user
#!/bin/bash
#Author : Arunlal A
#Website: https://www.crybit.com
echo -n "Enter databse user name: "
read THEUSER
skill -9 -u $THEUSER ; for i in `mysqladmin processlist | grep $THEUSER | awk '{print $2}'` ; do mysqladmin kill $i ; done ; echo "$THEUSER has been killed!"
@MohamedMohsenX2
MohamedMohsenX2 / gist:38a658a75c3d1c485e7fd43e3d955e60
Created January 28, 2018 13:28 — forked from ashokarun/gist:7a5f697d3f71f243372b6526fccc810a
To backup all the databases in the server as separate individual sql files
#!/bin/bash
#Author : Arunlal A
#Website: https://www.crybit.com
echo "Staring database backup process..."
for db in `echo 'show databases;' |mysql |grep -Ev "Database|information_schema|performance_schema"`; do mysqldump $db | gzip > /backup/$db.sql.gz ;done
echo "Done! Check /backup/ directory for your SQL files."
#!/bin/sh
echo "This script is useful for only commonly using CMSs like WP, Joomla, Drupal, Magento, Drupal etc with known configuration location. If nothing listing and you are getting db conntction error check configuration manually.. Thanks by Arunlal"
echo "" > details.txt
echo "Please enter the cPanel username: "
read username
grep -irl ${username}_ /home/$username/*{wp-config,configuration,config,global.inc,db-config,config.properties,configure,mysql.class,Settings}.php /home/$username/*/{wp-config,configuration,config,global.inc,db-config,config.properties,configure,mysql.class,Settings}.php /home/$username/*/*/{wp-config,configuration,config,global.inc,db-config,config.properties,configure,mysql.class,Settings}.php 2>/dev/null grep -v -E "mail|error_log|sql|html|var">> ${username}confs.txt
var=`cat ${username}confs.txt`
if [ -n "$var" ]; then
for i in `cat ${username}confs.txt`; do echo $i >> details.txt; grep -E "DB_USER|user|username|DB_PASSWORD|secret|password" $i |grep -v -E "cookies|generate"

OVH (Soyoustart) - Install Proxomox 4.4 over Debian 8 + ZFS

Prepare your bare server

Select template

  1. Install template - Debian 8.7 stable (Jessie) (6.4)
  2. Select [ x ] Custom installation
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@MohamedMohsenX2
MohamedMohsenX2 / README.md
Created April 26, 2018 20:02 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

OP: @leonardofed founder @ plainflow.


@MohamedMohsenX2
MohamedMohsenX2 / wp-secure.conf
Created July 22, 2018 14:05 — forked from ethanpil/wp-secure.conf
Wordpress Security for NginX
# wp-secure.conf
#
#
# This file includes common security considerations for wordpress using nginx.
#
# The goal is to block actions which are usually dangerous to wordpress.
# Additionally, we block direct access to PHP files and folders which should not
# be accessed directly from a browser.
#
# Also have included exceptions for plugins that are known to require this access.
@MohamedMohsenX2
MohamedMohsenX2 / ipv6_proxmox_online.net.md
Created July 31, 2018 01:52 — forked from DonSYS91/ipv6_proxmox_online.net.md
Configuring IPv6 block from Online.net On Proxmox Host and Guests

Configuring IPv6 block from Online.net On Proxmox Host and Guests

Following the documentation on online.net would get IPv6 to work only in a simple system installation but won't get IPv6 to work with virtualization environment (Exp. Proxmox) as It's missing some IPv6 forwards and proxies on sysctl.conf.

On Proxmox Host (Or Debian if single Debian Installation)

Enable IPv6 on the System:

  • Change Module Options to Enable IPv6:
@MohamedMohsenX2
MohamedMohsenX2 / nginx-vhost-proxprox.conf
Created July 31, 2018 01:56 — forked from sergey-dryabzhinsky/nginx-vhost-proxprox.conf
Nginx virtual host config for Proxmox. To hide pveproxy on 8006 port behind. With working VNC passthrough.
###
# Nginx vhost file to hide Proxmox pveproxy
# For 3.4+ version, maybe older too.
#
# Do not forget to create file
# /etc/default/pveproxy:
# ALLOW_FROM="127.0.0.1"
# DENY_FROM="all"
# POLICY="allow"
#