Skip to content

Instantly share code, notes, and snippets.

View philipz's full-sized avatar

philipz philipz

View GitHub Profile
@philipz
philipz / nginx-tuning.md
Created September 27, 2021 01: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.

@philipz
philipz / git.bat
Created December 14, 2018 15:38 — forked from victor-perez/git.bat
Use WSL git inside VS Code from Windows 10 17046
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::this also support calls that contains a absolute windows path
::check of one of the params contain a absolute windows path
echo.%* | findstr /r /c:"[a-z]:[\\/]" > nul
if %errorlevel% == 1 (
::if not just git with the given parameters
call :git %*
@philipz
philipz / Install MSOffice on Ubuntu.md
Created October 30, 2018 06:14 — forked from raelgc/Install MSOffice on Ubuntu.md
Install MSOffice on Ubuntu

Install Microsoft Office 2010 on Ubuntu

Requirements

We'll install MSOffice using the PlayOnLinux wizard. Additionally, MSOffice requires samba and winbind to properly work.

So, if not installed, install them:

sudo apt-get install playonlinux samba winbind
@philipz
philipz / installing_cuda_on_azure_nc_tesla_k80_ubuntu.md
Created February 5, 2018 05:15 — forked from bzamecnik/installing_cuda_on_azure_nc_tesla_k80_ubuntu.md
Installing NVIDIA CUDA on Azure NC with Tesla K80 and Ubuntu 16.04
@philipz
philipz / Dockerfile-etcd
Created September 26, 2017 02:20 — forked from Slach/Dockerfile-etcd
yandex clickhouse run over CoreOS ZETCD as Zookeeper server
FROM golang:alpine
MAINTAINER Eugene Klimov <bloodjazman@gmail.com>
RUN apk --no-cache add git && \
mkdir -p /zetcd && \
GOPATH=/zetcd go get github.com/coreos/zetcd/cmd/zetcd && \
apk del git && \
cp -v /zetcd/bin/zetcd /bin/zetcd && \
rm -rf /zetcd
@philipz
philipz / pom.xml
Created June 20, 2017 03:03 — forked from rodrik/pom.xml
Sample pom.xml file to enable spring-boot on WAS 8.5.5 running jdk1.6
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.rodrik</groupId>
<artifactId>spring-boot-was</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<java.version>1.6</java.version>
</properties>
@philipz
philipz / ffmpeg-minimalist-build-nvenc-static.md
Created May 16, 2017 12:13
This gist will show you how to build a minimalist, statically-linked ffmpeg binary under the ~/bin subdirectory on your home on Ubuntu 16.04LTS.

Minimalist static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

First, prepare for the build and create the work space directory:

cd ~/

I have run an nginx container...
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6d67de07731d nginx "nginx -g 'daemon ..." 40 minutes ago Up 40 minutes 80/tcp, 443/tcp epic_goldberg
I want to use Debian for debug:
docker run -it --pid=container:6d67de07731d --net=container:6d67de07731d --cap-add sys_admin debian
I can see the nginx process:
@philipz
philipz / GoPro RTMP streaming with FFmpeg
Created May 20, 2016 05:27 — forked from laurieainley/GoPro RTMP streaming with FFmpeg
Live streaming from a GoPro Hero3 camera to RTMP server using FFmpeg
Basic Requirements:
Computer with wired and wireless connection
FFmpeg installation: http://www.ffmpeg.org/
GoPro Hero 3+: http://gopro.com/
RTMP server e.g. FMS (http://www.adobe.com/products/adobe-media-server-family.html) or CDN ingest point
Overview:
GoPro Hero3 cameras produce HLS streams which are consumed by control apps and their removeable monitor.
@philipz
philipz / 0_reuse_code.js
Created November 3, 2015 00:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console