Skip to content

Instantly share code, notes, and snippets.

View naqirizvi's full-sized avatar
🎯
Focusing

Naqi naqirizvi

🎯
Focusing
View GitHub Profile
@naqirizvi
naqirizvi / nginx.conf
Last active April 17, 2020 20:56 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx

Keybase proof

I hereby claim:

  • I am naqirizvi on github.
  • I am naqir (https://keybase.io/naqir) on keybase.
  • I have a public key ASB96FFFFxcbGOqgLiD6aijTu6bnMV30ORhcwjxH0cKfngo

To claim this, I am signing this object:

@naqirizvi
naqirizvi / gettoken.sh
Created September 14, 2022 13:30 — forked from eruffaldi/gettoken.sh
Google OAuth 2.0 full example bash script.
#!/bin/bash
#1) on https://console.developers.google.com/ register project and associate API from library
# OUTPUT: client_id,client_secret
client_id="..."
client_secret="...."
#2) get authorization code at the following link using web browser
# OUTPUT: code
scope="https://www.googleapis.com/auth/drive"
@naqirizvi
naqirizvi / my.cnf
Created September 26, 2022 07:24 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@naqirizvi
naqirizvi / app-size.py
Created March 17, 2023 08:09 — forked from ruledio/app-size.py
Cloudways Disk Space Details/Quota Per Application
import subprocess
proc = subprocess.Popen("du -sh ./applications/* | sort -hr", shell=True, stdout=subprocess.PIPE)
for line in iter(proc.stdout.readline,''):
line = line.split()
size = line[0]
app_dir = line[1]
app_name = app_dir[15:]
app_conf = "/home/master/applications/%s/conf/server.apache" % (app_name)