w
: show who is logged on and what they are doingwho
: show who is logged ontty
: show current users pseudo terminalps -ft pts/1
: get process id for the pseudo terminalpkill
: signal process based on name and other attributes
#!/bin/bash | |
# Purpose: Exports the Cloudflare ELS log file and transforms the format to be consumed by goaccess. | |
# Developed by Tom Kaminski <tom@mobilenations.com> | |
# Requires the following tools: | |
# wget | |
# jq - https://stedolan.github.io/jq/ | |
# goaccess - https://goaccess.io/ |
#!/bin/sh | |
sleep 5 | |
ffmpeg -re -f mjpeg -r 10 -i "http://localhost/?action=stream" -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -acodec aac -ab 1k -strict experimental -s 640x360 -vcodec h264 -pix_fmt yuv420p -g 20 -vb 500k -preset ultrafast -crf 31 -r 10 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx" 2> /home/pi/ffmpeg.log |
alias subs=subs | |
function subs() { | |
movie="${1}" | |
filename="${1%.*}" | |
mappings=`ffprobe -loglevel error -select_streams s -show_entries stream=index:stream_tags=language -of csv=p=0 "${movie}"` | |
OLDIFS=$IFS | |
IFS=, | |
( while read idx lang | |
do |
I recently implemented Nginx HTTP content caching on our WordPress web servers to improve page load speeds and eliminate redundant, unneeded server-side page rendering. Caching the pages was relatively straightforward, but clearing the cache required a custom workaround.
Nginx comes in two versions: free and “Nginx Plus” at $2,500/year. The free version of Nginx does not offer the needed cache-clearing features of Nginx Plus, and I wasn’t comfortable paying $20,000 for 8 instances without trying to build my own solution.
Our Nginx servers run as an HTTP proxy for multiple PHP/MySQL-backed WordPress sites. The goal was to cache the dynamic PHP HTML responses in Nginx and serve the HTML pages from Nginx to avoid redundant, CPU-intensive PHP renders.
The example below shows how PHP response caching is configured for a site (other nginx configuration details are excluded for brevity). A cache named cachedemo-prod
is defined to store cached HTML f
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off; | |
server { | |
listen 443 ssl http2 default_server; | |
listen [::]:443 ssl http2 default_server; | |
server_name example.com; | |
location /api/ { | |
# Rate Limiting | |
limit_req zone=reqlimit burst=20; # Max burst of request |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
<VirtualHost *:80> | |
DocumentRoot "/home/dev/server/project/dist/" | |
ServerName vuejs.project.local | |
<Directory /home/dev/server/project/dist/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride all | |
Require all granted | |
Order allow,deny | |
allow from all |
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
- Domain filtering
- Referrer filtering
- Embed buster