Skip to content

Instantly share code, notes, and snippets.

View skmezanul's full-sized avatar

SK Mezanul Haque skmezanul

View GitHub Profile
@prochor666
prochor666 / install.sh
Last active June 11, 2024 14:46
Create & run python/wsgi app on Ispconfig 3 / Debian
#!/bin/bash
# place thi s file into the web dir
# install Flask foundation + dependencies
cd ..
git clone https://github.com/JackStouffer/Flask-Foundation.git web
cd web
make deps
wget https://gist.github.com/prochor666/a367a9ebd7cf67f04668/raw/6516a8dd3c90c808c5f2c81f67481a4fd48126f6/manage.wsgi
@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active September 11, 2024 17:10
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@markhowellsmead
markhowellsmead / .htaccess
Last active December 27, 2024 13:59
Detect browser language and redirect to appropriate language version of the website
# Redirect visitors who request the root domain path (e.g. www.mywebsite.ch) to the appropriate language version
# Fallback to English version if no matching browser language defined
# Based on language version being at e.g. www.mywebsite.ch/de/
# This has no effect on any subpaths of the website, and therefore has no effect on e.g. WordPress admin.
# Using a 302 temporary redirect header stops the redirection from being cached in the browser.
# language is ES-MX (Mexico)
RewriteCond %{HTTP:Accept-Language} ^es-mx [NC]
RewriteRule ^$ /mx/ [L,R=302]
{"lastUpload":"2019-10-06T18:32:39.184Z","extensionVersion":"v3.4.3"}
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@QROkes
QROkes / nginx.conf
Last active September 26, 2023 16:41
NGINX Configuration for WordPress Multisite + Domain Mapping with HTTPS
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com subsite.com www.subsite.com another.com www.another.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
@bh-ref
bh-ref / RemoveOptions.php
Last active December 28, 2021 21:06
Remove/Delete Product Attribute Options in Magento 2
<?php
namespace Vendor\ModuleName\Options;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory;
class RemoveOptions
{
@amio
amio / rm-ite.sh
Last active March 14, 2020 13:52
Remove ''www.it-ebooks.info" from pdf.
#!/bin/bash
source_dir=$1;
find "$1" -type f -name "*.pdf" -print0|while read -d $'\0' file;
do
if [ `strings "$file"|grep -c "www.it-ebooks.info"` -gt 0 ];
then
echo "$file";
cp "$file" /tmp/1.pdf;
script=$(cat <<'EOF'
use strict;
@ajskelton
ajskelton / WP Customizer - Select
Last active May 14, 2024 04:54
Add a Select field to the WordPress Customizer.
$wp_customize->add_setting( 'themeslug_select_setting_id', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'themeslug_sanitize_select',
'default' => 'value1',
) );
$wp_customize->add_control( 'themeslug_select_setting_id', array(
'type' => 'select',
'section' => 'custom_section', // Add a default or your own section
'label' => __( 'Custom Select Option' ),
@skipshean
skipshean / remove-wc-sidebar-divi
Created December 21, 2016 02:38
Remove the sidebar in Divi theme WooCommerce pages
/*=====[ Divi Theme hide sidebar on WooCommerce product and shop pages ]=====*/
.woocommerce-page #left-area {
padding-right: 0 !important;
width: 100%;
}
.woocommerce-page #sidebar {
display: none;
}
.woocommerce-page #main-content .container::before {