Articles

  • Setup Jekyll for Github Pages

    jekyll-github

    Introduction

    Jekyll is a simple static site generator that convert from Markdown source file to HTML pages. The result site is fast, portable and easy for servers like nginx to serve many users concurrently.

    Github Pages use jekyll to build site for user and repo pages. And the pages are hosted on github as a normal Git repository. So there is no differences between edit a source file and edit a post. The post is published when you push it to the upstream.

    This article introduces how to setup jekyll and the post-install steps like tweaks and adjustments.

  • Socket Programming - Advanced Topics

    Introduction

    This article covers some advanced topics about socket programming.

    setsockopt

    #include <sys/socket.h>
    int
    getsockopt(int socket, int level, int option_name,
        void *restrict option_value, socklen_t *restrict option_len);
    int
    setsockopt(int socket, int level, int option_name,
        const void *option_value, socklen_t option_len);
    

    getsockopt() and setsockopt() manipulate the options associated with a socket. Options may exist at multiple protocol levels; they are always present at the uppermost ``socket’’ level.

  • Apache deflate prob diagnose

    Configuration

    Apache 启用压缩,配置文件里一般是:

    AddOutputFilterByType DEFLATE application/javascript text/html text/javascript

    GZIP header format

    +---+---+---+---+---+---+---+---+---+---+
    |ID1|ID2|CM |FLG| MTIME |XFL|OS |(more-->)
    +---+---+---+---+---+---+---+---+---+---+
    
    • D1 (IDentification 1)
    • ID2 (IDentification 2)

    这两个字节具有固定值 ID1 = 31 (0x1f, \037), ID2 = 139 (0x8b, \213), 标识文件为gzip压缩包.

    • CM (Compression Method)

    文件使用的压缩方法. CM = 8 denotes the “deflate” 压缩方法</p>

  • Performance Tuning

    Abstract

    Performance does not come without a price. And the optimization process is more like a journey finding the balance between cost, security and performance.

    After the system is up and running, there is something need to tweak according the workload to achieve better performance.

    You could use sysctl -w key=value or write to the proc fs, after that, validate the system behaves as you expected, if yes, then you may write the configuration to /etc/sysctl.conf

  • Performance Tuning - Networking

    Abstract

    This article is one of the performance tuning serias. This one is intended to introduce networking tuning.

  • ELK (Elasticsearch Logstash Kibana) Stack

    Introduction

    The ELK stack consists of Elasticsearch, Logstash, and Kibana.

    This article will walk you through the install and setup a working ELK stack. As well as some basic performance tuning.

    Elasticsearch Features at

    • Real-time data and real-time analytics
    • Scalable, high-availability, multi-tenant
    • Full text search
    • Document orientation
  • NTP Server (Network Time Protocol)

    NTP Server

    Introduction

    Setting your servers’s clock and timezone properly is essential in ensuring the healthy operation of distrubted systems and maintain accurate log timestamps. This article will show you how to install and configure the NTP time synchronization service on an Red Hat Enterprise Linux 7.2 Server.

  • DNS Server

    DNS Server

    Introduction

    DNS(Domain Name System) is a basic facility in the Internet as well as some intranets.

    This article will show you how to setup and configure the BIND DNS Server. The environment used is Red Hat Enterprise Linux 7. So this article also applies to Fedora and CentOS, meantime the procedure would be look alike on other releases.

  • Securing SSH Server

    Securing SSH

    Introduction

    SSH(Secure Shell) provides a secure way of logging into a remote server. On many relases, the ssh service is ready to use without configuration. But it use a general settings for most circumstances.

    This article introduces some useful tips to securing a ssh service against attacks.

  • System Administration - FreeBSD

    FreeBSD

    Introduction

    FreeBSD is a high performance operating system that is suitable for a variety of server roles. This article will cover some common system administration tasks with a FreeBSD server.