Skip to content

Instantly share code, notes, and snippets.

zlib usage

以下是zlib的官方示例,这里对代码进行一些说明。

/* zpipe.c: example of proper use of zlib's inflate() and deflate()
   Not copyrighted -- provided to the public domain
   Version 1.4  11 December 2005  Mark Adler */

/* Version history:

Configure transparent proxy for router in IPv6 only network

Environment:

Router: ASUS ac66u_b1

OS: asus merlin 384.3

Shadowsocks: shadowsocks-libev 3.1(can support udp relay)

Use docker behind proxy

When I run docker run hello-world, I get error message "docker: Error response from daemon: Get https://registry-1.docker.io/v2/: x509: certificate has expired or is not yet valid.". Here is the solution to this problem.

  1. Create a systemd drop-in directory for the docker service:

    $ mkdir -p /etc/systemd/system/docker.service.d

Enable bbr on Ubuntu 16.04

  1. Make sure kernel version is 4.9 or newer:

    uname -r

    Install Hardware Enablement Stack (HWE) to update kernel automaticly:

@xterat
xterat / Run-Crail-on-Ubuntu-16.04.md
Last active February 5, 2018 02:47
Run Crail on Ubuntu 16.04

Run crail on Ubuntu 16.04

  1. Set HugePages_Total by:

    sudo bash -c "echo 81920 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages"

    Verify it by cat /proc/meminfo.

@xterat
xterat / Compile-Hadoop-2.8.md
Last active October 8, 2018 12:08
Compile Hadoop-2.8

Compile Hadoop-2.8 on Ubuntu 16.04

  1. Install some dependencies:

    sudo apt -y install gcc*
    sudo apt -y install cmake
    sudo apt -y install glibc-headers
    sudo apt -y install gcc-c++
    sudo apt -y install zip-devel
@xterat
xterat / configure-fio-for-hdfs.md
Created January 23, 2018 03:05
Configure fio to support hdfs.

Configure fio to support hdfs

  1. Configure some environments:

    1. $JAVA_HOME:

      export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"
@xterat
xterat / Hadoop_culster_setup.md
Created September 25, 2017 02:16
Including {Local Mode, Pseudo-Distributed Mode, Fully-Distributed Mode}

搭建 Hadoop 集群过程记录

开发环境:Ubuntu 16.04 server

Hadoop 版本:Apache Hadoop 3.0.0-alpha4

openjdk 版本:1.8.0_131

单节点模式(Local Mode)

@xterat
xterat / meaning_of_registers.md
Last active March 11, 2018 12:14
Meanings of registers in intel IA-32
EAX - Accumulator Register
EBX - Base Register
ECX - Counter Register
EDX - Data Register
ESI - Source Index
EDI - Destination Index
EBP - Base Pointer
ESP - Stack Pointer