Skip to content

Instantly share code, notes, and snippets.

View rileypeterson's full-sized avatar

rileypeterson

View GitHub Profile
@nitred
nitred / ssh_utils.md
Last active March 15, 2024 19:01
SSH Tunneling (port forwarding + reverse port forwarding + SOCK5)

About

SSH tunneling and port forwarding snippets and utils

Table of Contents

  • SOCK5 tunnel everything: Link
  • Local port forwarding: Link
  • Remote port forwarding: Link
@utdrmac
utdrmac / make_employees.py
Last active February 7, 2024 16:58
Multi-Threaded MySQL in Python
#!/usr/bin/python
import os, sys
import random
import time
import string
import mysql.connector
import threading
from mysql.connector import errorcode
@jsheedy
jsheedy / pg_copy_from.py
Last active January 23, 2023 17:52
benchmark for postgres inserts using copy_from and IteratorFile from https://gist.github.com/jsheedy/ed81cdf18190183b3b7d
import time
import psycopg2
from iter_file import IteratorFile
conn = psycopg2.connect(host="localhost", database="test")
# args = [(1,2), (3,4), (5,6)]
args = [(i,i+1) for i in range(1,1*10**4,2)]
@TakayoshiMiyamoto
TakayoshiMiyamoto / settings.sh
Last active December 30, 2021 06:31
Vagrant, Ubuntu14.04, uWSGI, Nginx, Python3.5, Flask, MariaDB first settings.
# Versions:
# Vagrant: 1.8.1
# Ubuntu: 14.04
# uWSGI: 2.0.12
# Nginx: 1.8.1
# Python: 2.7.6, 3.5.1
# Flask: 0.10.1
# MariaDB: 5.5.46
# My computer: MacOSⅩ 10.10.5 (Yosemite)
# VM: VirtualBox 5.0.14
@squarism
squarism / iterm2.md
Last active May 22, 2024 12:52
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@denji
denji / nginx-tuning.md
Last active May 24, 2024 10:14
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.