RSS

Posts in 2020

  • Linux SO_BINDTODEVICE and mac IP_BOUND_IF to bind socket to a network interface

    September 18, 2020 in Linux

    Use Linux SO_BINDTODEVICE and mac IP_BOUND_IF / IPV6_BOUND_IF to bind socket to a network interface

    SO_BINDTODEVICE on Linux In Linux, SO_BINDTODEVICE can be used to bind a socket to network interface. e.g. #include <sys/types.h>#include <sys/socket.h> const char *interface_name = "eth0"; setsockopt(socket_fd, SOL_SOCKET, …

    Read more

Posts in 2019

  • core_name_format No such file or directory

    September 16, 2019 in Linux

    Troubleshooting setting kernel.core_name_format="core.%e.%p.%s.%t" in /etc/sysctl.conf caused error: sysctl: cannot stat /proc/sys/kernel/core_name_format: No such file or directory

    What is core dump The default action of certain signals is to cause a process to terminate and produce a core dump file, a disk file containing an image of the process’s memory at the time of termination. This image can be used in a debugger …

    Read more

  • tcp_tw_recycle No such file or directory

    September 15, 2019 in Linux

    Troubleshooting setting net.ipv4.tcp_tw_recycle = 0 in /etc/sysctl.conf caused error: sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recycle: No such file or directory

    What is net.ipv4.tcp_tw_recycle Per Linux kernel document networking/ip-sysctl.txt: tcp_tw_recycle - BOOLEAN Enable fast recycling TIME-WAIT sockets. Default value is 0. It should not be changed without advice/request of technical experts. This …

    Read more

  • Huge improve TCP performance by BBR

    September 10, 2019 in Linux

    Huge improve Linux network performance by change TCP congestion control to BBR (Bottleneck Bandwidth and RTT).

    What is BBR BBR is Bottleneck Bandwidth and RTT. BBR congestion control computes the sending rate based on the delivery rate (throughput) estimated from ACKs. BBR was contributed to Linux kernel 4.9 since 2016 by Google. BBR has significantly …

    Read more

  • Secure Squid Proxy Server

    August 25, 2019 in Linux

    Install and quick configure squid to make it securely

    Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Installation Install on Mac with brew $ brew install squid ==> …

    Read more

  • Configure Debian startup services

    March 02, 2019 in Linux

    Configure debian start up services by sysv-rc-conf.

    I used to use chkconfig to configure which service to run at system start up. With my Raspberry Pi running based on Debian distribution, there is no chkconfig 😔. The replacement for Debian is sysv-rc-conf: Run-level configuration for SysV like init …

    Read more