Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View nbhatti's full-sized avatar

Muhammad Naseer Bhatti nbhatti

View GitHub Profile
@nbhatti
nbhatti / dd.sh
Last active January 17, 2024 20:58 — forked from BlueSkyXN/dd.sh
InstallNET.sh
#!/bin/bash
##
## License: GPL
## It can reinstall Debian, Ubuntu, Kali, AlpineLinux, CentOS, AlmaLinux, RockyLinux, Fedora and Windows OS via network automatically without any other external measures and manual operations.
## Default root password: LeitboGi0ro
## Written By MoeClub.org
## Blog: https://moeclub.org
## Modified By 秋水逸冰
## Blog: https://teddysun.com/
## Modified By VPS收割者
@nbhatti
nbhatti / FreeNAS.md
Created January 23, 2022 18:46 — forked from jacobblock/FreeNAS.md
Ultimate FreeNAS Setup

FreeNAS

I started using FreeNAS in August 2013. It is fantastic piece of software and I have been really impressed by the upgrades just in the few months I've been using it. It looks like they recently went to a plugin system as of version 9 to make installing software easier for end users. I've ran into several issues related to plugins and user + group permissions so I decided to just use the available FreeBSD port system. After fiddling for a few days (now turned into months) I believe I have created something helpful for the community and anyone interested in picking up the port system. The sandbox nature of FreeNAS's jail system is especially helpful for playing around without having any consequence on your core system.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.

ToC

@nbhatti
nbhatti / my.cnf
Created December 5, 2021 01:54 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated November 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.
#
@nbhatti
nbhatti / vyos.sh
Created August 14, 2019 09:22 — forked from kvaps/vyos.sh
#!/bin/vbash
# CONFIG
wan=dhcp
lan=192.168.1.1
lan_segment=192.168.1.0
vpn_segment=192.168.5.0
domain=apertoire.org
lease_start=192.168.1.200
lease_stop=192.168.1.245
@nbhatti
nbhatti / nginx-tuning.md
Created February 22, 2019 00:58 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@nbhatti
nbhatti / del_cluster.sh
Created January 29, 2019 21:32 — forked from ianchen06/del_cluster.sh
delete proxmox cluster
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
#/bin/sh
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
# edit through sqlite, check, delete, verify
@nbhatti
nbhatti / set_gre_tunnel.sh
Created October 4, 2018 16:13 — forked from zhouqt/set_gre_tunnel.sh
Script for create gre tunnel between 2 linux hosts.
#!/bin/sh
# Run this script on inside/outside host:
# * (outside, do NAT job) set_gre_tunnel.sh out inside 1.1.1.1
# * (inside) set_gre_tunnel.sh in outside 1.1.1.2
function verify_variant() {
var=$1
msg=$2
if [ x$var != x"" ]; then
@nbhatti
nbhatti / autopgsqlbackup
Created June 19, 2018 07:27 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
# mar/10/2018 06:15:33 by RouterOS 6.41
#
# model = 2011UiAS
# serial number = 771E067263D6
/interface bridge
add name=bridge1-MGMT
/interface ethernet
set [ find default-name=ether1 ] disabled=yes
set [ find default-name=ether2 ] rx-flow-control=on tx-flow-control=on
set [ find default-name=ether3 ] disabled=yes