Skip to content

Instantly share code, notes, and snippets.

View swadeshp's full-sized avatar

Swadesh Shanker Parasher swadeshp

View GitHub Profile
@taschmidt
taschmidt / pia.ps1
Last active December 6, 2023 03:17
PIA set qBittorrent port forward
# adapted from https://www.reddit.com/r/PrivateInternetAccess/comments/njwip9/qbittorrent_and_private_internet_access_pia_vpn/
# requires running "Install-Module PsIni"
Import-Module PsIni
# get qBittorrent process
$qbProc = Get-Process qbittorrent -ErrorAction SilentlyContinue
# if qBit is running, it's closed
if ($qbProc) {
├── api-v1
│ └── api
│ └── 1
│ └── upload
│ └── POST.php
├── api-v4
│ └── api
│ └── 4
│ ├── account
│ │ └── settings
@denji
denji / nginx-tuning.md
Last active April 26, 2024 11:21
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.

@hrwgc
hrwgc / validate.sh
Created November 13, 2013 19:57
bash wget - check if file exists at url before downloading
#!/bin/bash
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
}