Skip to content

Instantly share code, notes, and snippets.

Avatar

nbhatti

  • yLinx
View GitHub Profile
View 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 Feb 22, 2019 — forked from denji/nginx-tuning.md
NGINX tuning for best performance
View nginx-tuning.md

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 Jan 29, 2019 — forked from ianchen06/del_cluster.sh
delete proxmox cluster
View del_cluster.sh
# 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 Oct 4, 2018 — forked from zhouqt/set_gre_tunnel.sh
Script for create gre tunnel between 2 linux hosts.
View set_gre_tunnel.sh
#!/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 Jun 19, 2018 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
View autopgsqlbackup
#!/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
View mikrotik.conf
# 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
View OS X macOS Install ISO Creator
#!/bin/bash
################################
# OS X Install ISO Creater #
# #
# Author: shela #
################################
#######################################
# Declarations
View gist:6bdaec34dea6da984d2d2773c6a99777
TokuDB disk free space more than 10 percent of total file system space
TokuDB time of environment creation Thu Apr 13 20:15:02 2017
TokuDB time of engine startup Mon Apr 17 14:24:08 2017
TokuDB time now Thu Apr 20 16:29:03 2017
TokuDB db opens 6574
TokuDB db closes 6551
TokuDB num open dbs now 23
TokuDB max open dbs 25
TokuDB period, in ms, that recovery log is automatically fsynced 0
TokuDB dictionary inserts 5996397
View gist:f428b5e731bfc9b1695db89027483125
=====================================
2017-04-20 16:28:26 0x7fbde8678700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 53 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 256677 srv_active, 0 srv_shutdown, 9916 srv_idle
srv_master_thread log flush and writes: 266553
You can’t perform that action at this time.