Skip to content

Instantly share code, notes, and snippets.

View sumonst21's full-sized avatar
💭
I may be slow to respond.

Md. Sumon Islam sumonst21

💭
I may be slow to respond.
View GitHub Profile
@sumonst21
sumonst21 / setup-percona-server.sh
Created November 23, 2022 23:56 — forked from till/setup-percona-server.sh
A small shell script to install percona-server (and -client).
#!/bin/sh
############################
# Author: Till Klampaeckel #
# License: New BSD License #
############################
version=$1
if [ "x$version" = "x" ]; then
echo "Usage: ./$0 5.0|5.1"
@sumonst21
sumonst21 / plex-meta-resize.php
Created October 18, 2022 00:12 — forked from Fursje/plex-meta-resize.php
Resize plex metadata images
<?php
$a = new img_resize();
$a->run();
class img_resize {
public $img_files = array();
public $img_path = "";
public $bad_files = array();
@sumonst21
sumonst21 / cloudflare-family-dns-over-tls.md
Last active October 15, 2022 02:12
How to set up Cloudflare Family DNS over TLS

How to set up Cloudflare Family DNS over TLS

1.1.1.1 for Families supports DoT if we have an accommodating client like a compatible DoT router. In simpler terms, DNS over TLS or DoT is an IELF standard that offers full-stream encryption between a DNS server and a DNS client.

Furthermore, DoT permits us to encrypt our DNS queries, thereby protecting us from malicious attacks, spoofing, and so on.

In order to use DoT with Cloudflare Families, we can use the following URLs:

  • Block malware and adult content
    • 1.1.1.3
  • 1.0.0.3
@sumonst21
sumonst21 / build-tools.md
Created October 15, 2022 00:47 — forked from callumacrae/build-tools.md
Build tools written in JavaScript

Simple Steps for Creating Friendly URL’s with PHP & HTACCESS

You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.

Making Clean URL’s for Single Article Page

I’m going to transform URL from sitename.com/single.php in a single article page? url = article-name to sitename.com/article-name. To do this, we need to change the pattern of the URL and the Orignal URL, and everything is the same. That’s rules that start with RewriteRule and the flags.

In URL Pattern, we will search for various phrases by using \w and in conjunction with +. Here is the full URL Pattern for Single Article Clean URL Pages – ^([-\w]+)$

@sumonst21
sumonst21 / cloud_rain.html
Created October 14, 2022 00:27
Site Unavailable
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8"/>
<title>Site Unavailable</title>
<link rel="stylesheet" type="text/css" href="systempages.css" media="screen, handheld" />
</head>
<body>
<div id="wrapper">
<img src="https://user-images.githubusercontent.com/7096865/195735470-ff1f22ef-695e-4abf-ac13-2353c548f734.png" alt="" />
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# If you don't use filenames to version, lower the CSS and JS to something like
@sumonst21
sumonst21 / regform-notemplate.php
Created October 3, 2022 20:00 — forked from mhawksey/regform-notemplate.php
Embedding and customising a Google Form (with dynamic parallel session selection)
<?php
$formKey = "blahblahblah"; // ENTER YOUR OWN VALUE - you can find your formkey by going to your live form in the spreadsheet and copying the value from the url
$redirectUrl = "http://www.yoursite.com/thank-you/"; // ENTER YOUR OWN VALUE - the url you want to direct people to after they fill in the form
$dataUrl = "https://spreadsheets0.google.com/spreadsheet/pub?blahblahblah&single=true&gid=1&output=csv"; // ENTER YOUR OWN VALUE - for parallel sessions you need to publish the public sheet via the share settings. This url is not published in the live webpage source
// function to get external webpages/data
function getData($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@sumonst21
sumonst21 / php_form_submit.md
Created October 3, 2022 13:08 — forked from jesperorb/php_form_submit.md
PHP form submitting with fetch + async/await

PHP Form submitting

If we have the following structure in our application:

  • 📁 application_folder_name
    • 📄 index.php
    • 📄 handle_form.php
    • 📄 main.js

And we fill our index.php with the following content just to get a basic website with a form working. You should be able to run this through a php-server of your choice.

@sumonst21
sumonst21 / clutch.php
Created October 3, 2022 13:08 — forked from kn0ll/clutch.php
an asynchronous http library for php.
<?php
namespace clutch;
class Request {
/**
* The url of the request
* @var string
*/
public $url;