Wednesday, October 26, 2016

How to Install a Private Git Server with CGIT Web Frontend on CentOS 7

Self-hosting a lightweight Git web interface like CGIT written in C provides near-instant page loads, minimal RAM footprint, and syntax-highlighted code browsing compared to heavyweight alternatives like GitLab.

Stack: CentOS 7 • CGIT • fcgiwrap • Nginx • highlight syntax engine

1. Installing Prerequisites and fcgiwrap

CGIT operates as a FastCGI binary. Install fcgiwrap to interface between Nginx and the CGIT binary:

yum install epel-release -y
yum install fcgi-devel highlight git autoconf automake libtool -y

cd /usr/src
git clone https://github.com/gnosek/fcgiwrap.git
cd fcgiwrap
autoreconf -i
./configure --prefix=/usr
make && make install

2. Compiling CGIT from Source

cd /usr/src
git clone https://git.zx2c4.com/cgit
cd cgit
git submodule init
git submodule update
make get-git
make && make install

3. Nginx FastCGI Integration

Configure Nginx to route CGIT requests to the fcgiwrap socket:

location / {
    fastcgi_pass unix:/var/run/fcgiwrap.sock;
    fastcgi_param SCRIPT_FILENAME /var/www/htdocs/cgit/cgit.cgi;
    fastcgi_param PATH_INFO $uri;
    fastcgi_param QUERY_STRING $args;
    fastcgi_param HTTP_HOST $server_name;
    include fastcgi_params;
}

Sunday, October 2, 2016

How to Build a Low-Latency HLS & RTMP Live Streaming Server on Linux (Nginx RTMP Module)

Setting up your own live video streaming infrastructure on a Linux VPS or dedicated server provides full control over bitrate, privacy, and latency without third-party platform restrictions. This complete guide walks through configuring an Nginx RTMP + HLS media server on CentOS 7, publishing from OBS Studio / FFmpeg, and embedding the stream in modern web browsers.

Architecture: Nginx with nginx-rtmp-module • HLS fragmenting (Apple HTTP Live Streaming) • Broadcaster: OBS / FFmpeg • Player: HTML5 HLS.js

Part 1: Compiling Nginx with RTMP Support (CentOS 7)

Install development packages and compile Nginx with the RTMP module:

yum install gcc-c++ pcre-devel zlib-devel openssl-devel git -y
cd /usr/src
git clone https://github.com/arut/nginx-rtmp-module.git
wget http://nginx.org/download/nginx-1.12.2.tar.gz
tar -zxf nginx-1.12.2.tar.gz
cd nginx-1.12.2

./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx   --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid   --with-http_ssl_module --with-http_v2_module   --add-module=/usr/src/nginx-rtmp-module

make && make install

Part 2: Configuring RTMP and HLS Ingestion

Add the RTMP server block to /etc/nginx/nginx.conf:

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            hls on;
            hls_path /var/www/hls;
            hls_fragment 3;
            hls_playlist_length 60;
            # Restrict streaming publishing to your IP:
            allow publish 127.0.0.1;
            allow publish YOUR.OFFICE.IP;
            deny publish all;
        }
    }
}

Configure HTTP delivery for the HLS .m3u8 playlists and .ts video segments in /etc/nginx/conf.d/stream.conf:

server {
    listen 80;
    server_name stream.example.com;

    location /hls {
        types {
            application/vnd.apple.mpegurl m3u8;
            video/mp2t ts;
        }
        root /var/www;
        add_header Cache-Control no-cache;
        add_header Access-Control-Allow-Origin *;
    }
}

Part 3: Broadcasting and Playback

In OBS Studio, set the Stream URL to rtmp://YOUR-SERVER-IP/live and choose a Stream Key (e.g. mystream). In your web page, point your HLS video player to http://YOUR-SERVER-IP/hls/mystream.m3u8 for instant, cross-browser live playback.

How Google Antigravity Solved the Mysterious NVIDIA Sleep Reboot on My Dell Inspiron 7567 (Ubuntu Linux)

If you run modern Ubuntu or Linux on a Dell Inspiron 15 Gaming (7567) or a similar 7th-gen Intel laptop paired with an NVIDIA GeForce GTX ...