Skip to content

Instantly share code, notes, and snippets.

@folkevil
folkevil / nginx-tuning.md
Created August 6, 2021 02:23 — forked from denji/nginx-tuning.md
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.

@folkevil
folkevil / ScreenRecorder.cs
Created August 23, 2019 02:34 — forked from DashW/ScreenRecorder.cs
ScreenRecorder - High Performance Unity Video Capture Script
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
class BitmapEncoder
{
public static void WriteBitmap(Stream stream, int width, int height, byte[] imageData)
@folkevil
folkevil / a.md
Created August 3, 2018 04:52 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.

@folkevil
folkevil / index.html
Created January 26, 2018 20:36 — forked from user01/index.html
three.js webgl - Video Cube UV Mapping
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - Video Cube UV Mapping</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
font-family: Monospace;
@folkevil
folkevil / gist:7ff3558e0268c3d7c56a0dff410367c6
Created February 14, 2017 04:00 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@folkevil
folkevil / v.bat
Last active December 6, 2016 02:56
youtube-dl bat file to download and extract audio as mp3
#usage: save gist file as v.bat and place it in youtube-dl.exe file. Copy youtube url and use comd -> v + Ctrl+V -> enter
@ECHO OFF
chcp 65001 > NUL
youtube-dl.exe --extract-audio --audio-format mp3 %*
@folkevil
folkevil / latest-ffmpeg-centos6.sh
Created November 18, 2016 09:10 — forked from mustafaturan/latest-ffmpeg-centos6.sh
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
@folkevil
folkevil / bongo.sh
Created August 29, 2016 10:20 — forked from nhoening/bongo.sh
Allowing to pass a query for exporting specific data. Added a LIMIT option to limit the number of returned results. Added a debug switch to see errors.
#!/bin/bash
LOADING=false
DEBUG=/dev/null
usage()
{
cat << EOF
usage: $0 [options] <DBNAME>
@folkevil
folkevil / laravel-mongodb-sentinel
Created July 19, 2016 06:36 — forked from Bodom78/laravel-mongodb-sentinel
Use the Sentinel 2.x authentication package with Laravel 5.1 and MongoDB
Work in Progress: More testing to be done.
At a glance Authentication, Activation, Throttle, Groups & Permissions seem to
be working.
Downside: Copy and modify files.
Upside: Not really much work to get it up and running.
Assumes you have Laravel 5.1, jenssegers/laravel-mongodb + session addon set up
and your app is namespaced to App/
@folkevil
folkevil / install.sh
Created October 15, 2015 08:40
thumbor on CentOS6 with GraphicsMagick, opencv and python2.7
#!/bin/bash
WORK_DIR=/usr/src/louvre
INSTALL_DIR=/opt/louvre
export LD_LIBRARY_PATH=/opt/louvre/lib
export PATH=/opt/louvre/bin:$PATH
if [ ! -d ${INSTALL_DIR} ]; then
mkdir ${INSTALL_DIR}