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 / 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 / index.html
Created November 27, 2018 08:09
YouTube API - Multiple Videos on One Page
<div class="video-item">
<iframe id="video0" src="//www.youtube.com/embed/4DMGfbje7NY?enablejsapi=1&html5=1" frameborder="0" allowfullscreen></iframe>
<button class="play">Play</button>
<button class="stop">Stop</button>
</div>
<div class="video-item">
<iframe id="video1" src="//www.youtube.com/embed/nJl-qVoEEJI?enablejsapi=1&html5=1" frameborder="0" allowfullscreen></iframe>
<button class="play">Play</button>
<button class="stop">Stop</button>
@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 / .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
@bajpangosh
bajpangosh / Ubuntu and www:data permissions in amazon AWS EC2
Last active September 20, 2022 06:30
Ubuntu and www:data permissions in amazon AWS EC2
Every time I have to go to terminal, ssh and do this to change the permissions between Joomla (www-data) and FileZilla (ubuntu)
sudo chown -R www-data.www-data /var/www/html (Joomla)
sudo chown -R ubuntu /var/www/html (File Zilla)
How do I set it so that I don't have to change this every time?
Solution
Add the ubuntu user to the www-data group
#!/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 / 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 / Flarum+Cloudflare Full SSL - Nginx Configuration
Created June 19, 2017 04:50
Flarum+Cloudflare Full SSL - Nginx Configuration
# HTTPS Server
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
root /var/www/html;
index index.html index.htm index.php;
server_name example.com;
ssl_certificate /etc/nginx/ssl/example.com.crt;
ssl_certificate_key /etc/nginx/ssl/example.com.key;
@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;
}