Skip to content

Instantly share code, notes, and snippets.

View salehi's full-sized avatar

SS Salehi salehi

View GitHub Profile
@salehi
salehi / php.ini
Created March 1, 2020 12:18
tunning
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@salehi
salehi / keybase.md
Created December 11, 2019 22:47
Prove

Keybase proof

I hereby claim:

  • I am salehi on github.
  • I am s4l3h1 (https://keybase.io/s4l3h1) on keybase.
  • I have a public key ASAOyGfGVIPZh-oiGvYehIXxjgbGUErd36Uj8ISiJDWr_wo

To claim this, I am signing this object:

@salehi
salehi / gist:a0ae6d6ae9fcdae759895f69eb8bf143
Created September 18, 2019 21:20 — forked from trey/gist:5373343
Free Marvel #1s
15-Love #1
5 Ronin #1 (of 5)
A + X #1
A-Babies vs. X-Babies #1
AVX: Consequences #1 (of 5)
AVX: VS. #1 (of 6)
Age of Apocalypse #1
Age of Apocalypse: Sinister Bloodlines
Age of X Universe #1 (of 2)
Age of X: Alpha #1
@salehi
salehi / ipa_cert_checker.py
Created September 15, 2019 20:26 — forked from ronsims2/README.md
A script that will confirm if a specified IPA file was signed with the specified certificate.
import subprocess
import sys
import zipfile
import bs4
import base64
if len(sys.argv) != 3:
print('Invalid number of arguments.')
exit(1)
ffmpeg -i death_valley.mp4 -c:a copy -vf "subtitles=en.vtt:force_style='FontName=Arial Bold,FontSize=22,PrimaryColour=&H0009FAFD,OutlineColour=&H00000000'" -f segment -segment_time 30 -segment_format_options movflags=+faststart out%03d.mp4
docker run -it --rm --name certbot -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" certbot/certbot certonly --agree-tos -m [email protected] -d *.snapp.market --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges=dns-01
@salehi
salehi / read-access.sql
Last active February 19, 2019 08:52 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@salehi
salehi / docker-compose.yml
Last active December 23, 2018 12:01
Rocket Chat docker-compose
version: '3.7'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./certs:/etc/nginx/certs
#!/usr/bin/perl
# ----------------------------------------------------------------------
#
# Technique to speed up a subsequent "swapoff" command.
# Opens /proc/$pid/mem, then seeks and reads.
#
# Example:
# perl deswapify.pl
# swapoff --all
@salehi
salehi / nginx-tuning.md
Created May 29, 2018 07:16 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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.