Skip to content

Instantly share code, notes, and snippets.

View bajpangosh's full-sized avatar
🛰️
Working from Moon

Bajpan Gosh bajpangosh

🛰️
Working from Moon
View GitHub Profile
@bajpangosh
bajpangosh / install_imagick.sh
Created June 16, 2024 12:18
a bash script that will install the ImageMagick library and the imagick extension for PHP 7.4 by default, with an option for the user to choose PHP 8.3. This script will handle the installation through PECL and ensure the correct permissions are set for the library.
Sure, here's a bash script that will install the ImageMagick library and the imagick extension for PHP 7.4 by default, with an option for the user to choose PHP 8.3. This script will handle the installation through PECL and ensure the correct permissions are set for the library.
```bash
#!/bin/bash
# Function to install imagick for a specified PHP version
install_imagick() {
PHP_VERSION=$1
PHP_BIN="/usr/local/lsws/lsphp${PHP_VERSION}/bin"
PHP_INI="/usr/local/lsws/lsphp${PHP_VERSION}/etc/php.ini"
@bajpangosh
bajpangosh / CapRover.sh
Created May 3, 2024 18:10
CapRover Installation Script for Ubuntu 20.04, This gist contains a bash script for installing CapRover on Ubuntu 20.04. The script includes steps for Docker installation, domain verification, and CapRover setup. Each step is echoed for user readability. Please ensure to read and agree to the terms and conditions before running the script. Enjoy…
#!/bin/bash
# Update system packages
echo "Updating system packages..."
sudo apt update
# Install curl if not installed
echo "Installing curl..."
sudo apt install curl
@bajpangosh
bajpangosh / .sh
Created November 19, 2022 10:51
Setting Up Docker on Ubuntu 20.04 Focal (Arm64) Oracle Free
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
clear
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
lscpu
sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
clear
apt-cache policy docker-ce
sudo apt-get -y install docker-ce
#!/bin/bash
if [[ "$EUID" -ne 0 ]]; then
echo "Sorry, you need to run this as root"
exit
fi
while [[ -z $action ]]; do
clear
@bajpangosh
bajpangosh / port.sh
Last active November 4, 2023 09:28
port open
#!/bin/bash
# GET ALL USER INPUT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 7080 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 8080 -j ACCEPT
sudo netfilter-persistent save
@bajpangosh
bajpangosh / gist:cdf5fc3e4274cb6f2373c2063dc9cdd2
Created December 14, 2020 14:49
MySQL/MariaDB configuration file. 2020
MySQL/MariaDB configuration file.
sudo nano /etc/mysql/mysql.conf.d/mysql.cnf
on MariaDB server, the file may live below
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
@bajpangosh
bajpangosh / To remove the badge completely
Created May 9, 2020 02:08
To remove the badge completely
.grecaptcha-badge {
display: none;
}
@bajpangosh
bajpangosh / Wordpress installation in subfolder
Last active May 8, 2020 16:26
Wordpress installation in subfolder
location /new {
try_files $uri $uri/ /new/index.php?$args /new/index.php?q=$uri&$args;
}
@bajpangosh
bajpangosh / nginx.conf
Created April 28, 2019 16:29
Ghost Cloudflare Nginx Config
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.verifiedbyme.xyz;
# SSL
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
# reverse proxy
@bajpangosh
bajpangosh / Nginx Rewrites for Rank Math Sitemaps
Created March 13, 2019 05:47
Nginx Rewrites for Rank Math Sitemaps
# START Nginx Rewrites for Rank Math Sitemaps
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
# END Nginx Rewrites for Rank Math Sitemaps