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 / Django Nginx Config
Last active February 26, 2024 07:58
Django Nginx Config
server
{
# Listen
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
# Directory & Server Naming
server_name exapmle.com www.exapmle.com;
@amanjuman
amanjuman / Camera App Config
Last active June 8, 2020 22:21
Camera App Config
server
{
listen 12008;
listen [::]:12008;
server_name exapmle.com;
# HTTP to HTTPS redirection
if ($scheme != "https")
{
return 301 https://$host$request_uri;
@amanjuman
amanjuman / pgadmin4 Nginx Reverse Config
Created June 11, 2020 09:35
pgadmin4 Nginx Reverse Config
server
{
# Listen
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
# Directory & Server Naming
server_name subdomain.example.com;
@amanjuman
amanjuman / Magento 2.x Nginx Config
Last active August 29, 2020 14:23
Magento 2.x Nginx Config
upstream fastcgi_backend
{
server unix:/run/php/php7.2-fpm.sock;
}
server
{
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
@amanjuman
amanjuman / ShadowsocksR Ubuntu Setup
Created July 8, 2020 08:11
ShadowsocksR Ubuntu Setup
sudo apt-get update && sudo apt-get upgrade -y
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh && chmod +x shadowsocksR.sh
./shadowsocksR.sh 2>&1 | tee shadowsocksR.log
nano /etc/shadowsocks.json
{
"server":"0.0.0.0",
"server_ipv6":"[::]",
"port_password": {
"1001": "user1",
@amanjuman
amanjuman / nginx-cors.conf
Last active August 22, 2020 12:26
Nginx configuration for adding cross-origin resource sharing (CORS)
server
{
# Listen
listen 80;
listen [::]:80;
#listen 443 ssl http2;
#listen [::]:443 ssl http2;
# Directory & Server Naming
root /var/www/yourdomain.com;
@amanjuman
amanjuman / Magento 2.4 Complete
Created August 30, 2020 08:26
Magento 2.4 Complete
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository "deb [arch=amd64,arm64,ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu $(lsb_release -cs) main"
sudo add-apt-repository ppa:ondrej/php -y
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y
sudo apt-get install openjdk-11-jre openjdk-11-jdk elasticsearch
sudo apt install wget curl zip unzip nginx-full mariadb-server python-certbot-nginx php7.4-fpm php7.4-common php7.4-mysql php7.4-gmp php7.4-curl php7.4-intl php7.4-mbstring php7.4-xmlrpc php7.4-gd php7.4-xml php7.4-cli php7.4-zip php7.4-soap php7.4-bcmath -y
@amanjuman
amanjuman / Complete Magento 2.3 LEMP on Ubuntu 18.04
Last active April 10, 2021 19:44
Complete Magento 2.3 LEMP on Ubuntu 18.04
## MariaDB Source
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository "deb [arch=amd64,arm64,ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu $(lsb_release -cs) main"
## PHP, Nginx and Lets Encrypt Source
nginx=stable
add-apt-repository ppa:nginx/$nginx
sudo add-apt-repository ppa:ondrej/php -y
sudo add-apt-repository ppa:certbot/certbot -y
@amanjuman
amanjuman / nginx.conf
Created September 1, 2020 21:46 — forked from amitsaha/nginx.conf
nginx conf + geoip2
# blog post: https://echorand.me/nginx-and-geoip2.html
worker_processes auto;
daemon off;
error_log /dev/stdout warn;
include /etc/nginx/modules/*.conf;
load_module modules/ngx_http_geoip2_module.so;
events {
}
@amanjuman
amanjuman / WireGuard Complete Installation
Last active April 6, 2024 22:51
WireGuard Complete Installation
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y
## For Regular Linux Server/PC
sudo apt install software-properties-common && sudo apt install linux-headers-$(uname -r)
## Raspberry Pi
sudo apt install raspberrypi-kernel-headers libelf-dev libmnl-dev build-essential git -y
## Install WireGuard and WireGuard Tools
sudo apt install wireguard wireguard-tools resolvconf -y
wg genkey | sudo tee /etc/wireguard/privatekey | wg pubkey | sudo tee /etc/wireguard/publickey