Skip to content

Instantly share code, notes, and snippets.

View amanjuman's full-sized avatar
😉
Ill

Aman Juman amanjuman

😉
Ill
View GitHub Profile
@amanjuman
amanjuman / sources.list
Last active April 27, 2024 18:12
Debian Mirror
deb http://deb.debian.org/debian/ bookworm main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware
deb [arch=amd64 by-hash=yes signed-by=/usr/share/keyrings/3cx-archive-keyring.gpg] http://repo.3cx.com/debian/2001 bookworm main
@amanjuman
amanjuman / gwhitelist.sh
Created September 14, 2022 20:51 — forked from stevejenkins/gwhitelist.sh
Script for creating a Postfix whitelist for Gmail servers
#! /bin/sh
#
# Copyright (c) 2013 Mike Miller <[email protected]>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@amanjuman
amanjuman / DNS Prefetch domains
Created September 7, 2022 18:03
WP Rocket - Advanced Options Prefetch DNS requests examples
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//www.google.com
//www.googletagmanager.com
//google-analytics.com
//www.google-analytics.com
@amanjuman
amanjuman / ec2-mac-m1.md
Created September 4, 2022 19:22
Install VNC Viewer on EC2 based Mac M1

Install and start VNC on the EC2 Mac instance:

sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist

Update the password for ec2-user

sudo passwd ec2-user

@amanjuman
amanjuman / image-optimization.md
Last active August 26, 2022 11:41
Image Optimization Tools for Linux (Ubuntu 20.04) and WordPress EWWW Optimization

Install Required Tools

sudo apt-get install -y build-essential libjpeg-progs liblcms2-dev libpng-dev libmagickcore-6.q16-3-extra

Install Image Optimization Tools

sudo apt-get install -y jpegoptim optipng pngquant pngtools gifsicle webp && sudo npm install -g svgo

Add Image Tools Path to Openbase Dir if you use RunCloud or GridPan based System

:/usr/bin/jpegoptim:/usr/bin/optipng:/usr/bin/pngquant:/usr/bin/svgo:/usr/bin/gifsicle:/usr/bin/cwebp

@amanjuman
amanjuman / nginx.md
Last active June 2, 2022 21:35
Wordpress Blog as a sub-folder of domain using nginx reverse proxy

Add in WordPress Config File after "define( 'DB_COLLATE', '' );"

define('WP_SITEURL', '/blog');
define('WP_HOME', '/blog');
$_SERVER['REQUEST_URI'] = str_replace("/wp-admin/", "/blog/wp-admin/",  $_SERVER['REQUEST_URI']);

Add this after above line if your WordPress Blog is Non-SSL

if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
 $_SERVER['HTTPS']='on';
@amanjuman
amanjuman / wordpress-as-sub-rails-app.md
Created June 2, 2022 21:22 — forked from vuongpd95/wordpress-as-sub-rails-app.md
Setup wordpress as subdirectory (/blog) of an existing app
@amanjuman
amanjuman / wordpress-HTTP_X_FORWARDED_HOST
Last active October 8, 2022 17:41
WordPress Config for Server Behild Load Balancer or Argo Tunnel
// Define WordPress URLS
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/');
// HTTPS Forward (If orgin is HTTP Only)
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
$_SERVER['HTTPS'] = 'on';
// Dynamic Host Name
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
@amanjuman
amanjuman / runcloud-php-apcu
Created May 18, 2022 09:47
Installing the PHP-APCU for RunCloud Linux
## Install Tools
sudo apt install autoconf libpcre3-dev -y
## Define Module Name and Version
MODULE_NAME="apcu"
MODULE_VERSION="5.1.21"
## Download and Unzip Extensions
wget https://pecl.php.net/get/$MODULE_NAME-$MODULE_VERSION.tgz
tar -zxvf $MODULE_NAME-$MODULE_VERSION.tgz
Section: AUTH
zeptomail_login:
driver = plaintext
public_name = LOGIN
client_send = : emailapikey : XXAAAFAFAF
Section: POSTMAILCOUNT