Skip to content

Instantly share code, notes, and snippets.

View doniz's full-sized avatar

Donatas Navidonskis doniz

View GitHub Profile
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 13, 2025 15:10
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@v0lkan
v0lkan / nginx.conf
Last active April 15, 2025 11:53
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@peterhellberg
peterhellberg / gateway_deploy.rb
Created December 17, 2014 16:24
Capistrano deploy via gateway host
set :user, 'username'
set :gateway, 'example.com'
set :ssh_options, {
user: fetch(:user),
forward_agent: false,
proxy: Net::SSH::Proxy::Command.new(
"ssh -l #{fetch(:user)} #{fetch(:gateway)} -W %h:%p"
)
}
@StanAngeloff
StanAngeloff / Makefile
Last active October 11, 2022 19:37
Generate RabbitMQ self-signed certificate authority, server and client certificates.
# See http://www.rabbitmq.com/ssl.html
#
# (c) Stan Angeloff / http://www.gnu.org/licenses/agpl-3.0.html
SHELL := /bin/bash
HOSTNAME ?= $(shell hostname)
PASSPHRASE ?= $(shell cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
PASSPHRASE_FILE = $(HOSTNAME)/.passphrase
@smichaelsen
smichaelsen / check_regex.php
Last active January 25, 2025 05:35
PHP: Check if string is valid regular expression
<?php
function isRegularExpression($string) {
set_error_handler(function() {}, E_WARNING);
$isRegularExpression = preg_match($string, "") !== FALSE;
restore_error_handler();
return isRegularExpression;
}
@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active August 15, 2024 15:16
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@Im0rtality
Im0rtality / README.md
Last active March 17, 2023 14:36
PHP CLI Debugging in Vagrant using Xdebug and PHPStorm

In host:

  1. Go to PHPStorm Settings > Project settings > PHP > Servers
  2. Add server with following parameters:
    • Name: vagrant (same as serverName= in debug script)
    • Host, port: set vagrant box IP and port
    • Debugger: Xdebug
    • [v] Use path mappings
    • Map your project root in host to relative dir in guest
  • Hit OK
@denji
denji / nginx-tuning.md
Last active May 13, 2025 13:10
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.

@tazjel
tazjel / gae_remote_api_helper.py
Created January 10, 2014 11:19 — forked from jdiaz5513/gae_remote_api_helper.py
A script for Google App Engine remote_api shell that automatically creates a connection and drops you to the shell. I created this script for people who use the remote_api shell a lot; it saves me a lot of time. The best part is, it works with alternative Python shells like iPython!
#!/usr/bin/python2
"""
This script automates the task of connecting to a running App Engine server,
whether it's a local dev_appserver or a live app.
If PyQt4 is installed, it will ask for credentials inside a dialog box
instead of prompting in the terminal. This is good for shells that do
not support getpass (iPython).
It will automatically add an import path for a local virtualenv in the app