sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'| package main | |
| // This is a basic example of running an nsqd instance embedded. It creates | |
| // and runs an nsqd with all of the default options, and then produces | |
| // and consumes a single message. You are probably better off running a | |
| // standalone instance, but embedding it can simplify deployment and is | |
| // useful in testing. | |
| // See https://github.com/nsqio/nsq/blob/master/nsqd/options.go and | |
| // https://github.com/nsqio/nsq/blob/master/apps/nsqd/nsqd.go for |
| #! /bin/bash | |
| # | |
| # Diffusion youtube avec ffmpeg | |
| # Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée. | |
| VBR="2500k" # Bitrate de la vidéo en sortie | |
| FPS="30" # FPS de la vidéo en sortie | |
| QUAL="medium" # Preset de qualité FFMPEG | |
| YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube |
This gist assumes you are migrating an existing site for www.example.com — ideally WordPress — to a new server — ideally Ubuntu Server 16.04 LTS — and wish to enable HTTP/2 (backwards compatibile with HTTP/1.1) with always-on HTTPS, caching, compression, and more. Although these instructions are geared towards WordPress, they should be trivially extensible to other PHP frameworks, other FastCGI backends, and even non-FastCGI backends (using proxy in lieu of fastcgi in the terminal Caddyfile stanza).
Quickstart: Use your own naked and canonical domain names instead of example.com and www.example.com and customize the Caddyfile and VCL provided in this gist to your preferences!
These instructions target Varnish Cache 4.1, PHP-FPM 7.0, and Caddy 0.10. (I'm using MariaDB 10.1 as well, but that's not relevant to this guide.)
| title | tags | authors | |||||
|---|---|---|---|---|---|---|---|
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily |
|
|
| #!/bin/bash | |
| REPO=NAME_HERE | |
| # Dir paths on remote server | |
| # These are associated with branches within a git project | |
| LIVE_BRANCH="master" | |
| LIVE="git@host:/var/www/live/" | |
| STAGE_BRANCH="develop" | |
| STAGE="git@host:/var/www/stage/" |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |