Posts in 2019

  • tcp_tw_recycle No such file or directory

    Last Update: 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

    Last Update: in Linux

    BBR improve Linux server response time. 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

  • Upgrade Debian Jessie to Buster, Bullseye without re-image

    Last Update: in Raspberry Pi

    Upgrade existing Debian Jessie to Buster, Bullseye without re-image on Raspberry Pi, there is no data loss during upgrade with in-place upgrade.

    How to do in-place upgrade without data loss I have a old Raspberry Pi 3 running for many years, it still running on jessie and everything goes well, except I want to install some software which does not exist on jessie. Since jessie, there are two …

    Read more

  • Secure Squid Proxy Server

    Last Update: 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

  • OAuth2 101

    Last Update: in OAuth2

    Introduction to OAuth 2 and OAuth 2.1 Protocol Detailed Grant Flow Diagrams, Security Consideration and Best Practice.

    What is OAuth2 OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices. This specification and its extensions are being developed …

    Read more

  • Setup a Git Server over SSH

    in Git

    Setting up a Git service running over SSH.

    Plan server Like GitHub, I want to have git url like, so I can clone as: $ git clone Create git user To do this, I need create a user named git on my Linux server: $ sudo useradd -m …

    Read more

  • Git quick reference

    Last Update: in Git

    Git quick reference for daily work

    Why Git Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. help git help outline the most common use git commands. $ git help usage: …

    Read more

  • npm publish

    in npm

    Tips on contributing packages to npm registry by npm publish, how to reduce package size, how to use scoped package, how to debug package locally etc.

    Reduce package size Use files field in package.json to specific installed files The optional files field is an array of file patterns that describes the entries to be included when your package is installed as a dependency. File patterns follow a …

    Read more

  • Configure Debian startup services

    in Linux

    Configure debian start up services with 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

Posts in 2018

  • Integrate with Django admin site

    in CAS

    Integrate django-cas-ng with Django admin site authentication

    Problem I’m using django-cas-ng framework to authenticate users. The main problem is that the admin page still uses the default login view. Methods used this far: 1.- Using env var From docs: CAS_ADMIN_PREFIX: The URL prefix of the Django …

    Read more