Skip to content

Instantly share code, notes, and snippets.

View zhanglongqi's full-sized avatar

Zhang LongQi zhanglongqi

View GitHub Profile

Generic howto for Allwinner devices

Legacy or current kernel ?

Many Armbian images come in two flavours : Legacy (using an older kernel version) and current (up-to-date LTS kernel). Depending on kernel version, the procedure to enable/disable features is not the same.

  • Legacy kernel (5.4.x): DT (Device Tree) overlays
  • Current kernel (5.10.x) : DT (Device Tree) overlays

Note: Support for older kernel versiones (like 3.4.x or 3.10.x) has been dropped.

@zhanglongqi
zhanglongqi / AAA-auto-starter-for-motionmark
Last active December 30, 2022 01:51
auto-starter-for-motionmark
AAA-auto-starter-for-motionmark
@zhanglongqi
zhanglongqi / clone_disk_telnet_dd.md
Last active June 10, 2021 08:10
Clone disk partition using dd over telnet with bzip compression
@zhanglongqi
zhanglongqi / openvpn_ccd.py
Last active March 4, 2021 01:37
Assign Static IP Addresses for OpenVPN Clients in Batch
def main(prefix: str, start: int, ip: int, total: int):
for t in range(total):
with open(f'{prefix}{start+t:04}', 'w') as f:
f.write(f'ifconfig-push 10.8.0.{ip+t} 255.255.0.0')
f.write('\n')
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
@zhanglongqi
zhanglongqi / xz.markdown
Created February 18, 2021 09:23 — forked from fabiomontefuscolo/xz.markdown
XZ and tricks

XZ

  1. Compress a file (filename.sql will be replaced by filename.sql.xz)
xz filename.sql
  1. Uncompress file (filename.sql.xz will be replaced by filename.sql)
@zhanglongqi
zhanglongqi / readme.md
Last active December 10, 2020 12:41
Linux App on HiDPI

Code composer studio on HiDPI

Adjust the icon by adding -Dswt.autoScale=200 to ccstudio.ini

Audacity

export GDK_SCALE=2

export GDK_DPI_SCALE=0.5

@zhanglongqi
zhanglongqi / readme.md
Last active December 1, 2020 09:29
Make 8723bu works on kernel 4.19

The board I am using is Beaglebone Black Enhanced, kernel: 4.19.94-ti-r57, wifi model 0bda:b720

If you are using kernel 5.4 then just use rtl8xxxu instead of 8723bu.

$ modinfo 8723bu
filename:       /lib/modules/4.19.94-ti-r57/kernel/drivers/net/wireless/8723bu.ko
version:        v4.3.6.11_12942.20141204_BTCOEX20140507-4E40
author:         Realtek Semiconductor Corp.
@zhanglongqi
zhanglongqi / openwrt.md
Created November 9, 2020 07:29
openwrt on ubuntu 18.04

For issue like

awk: include/scan.awk: line 21: function asort never defined

We can solve it by

sudo apt-get install gawk

@zhanglongqi
zhanglongqi / .clang-format
Last active February 18, 2020 13:56 — forked from kristopherjohnson/.clang-format
Script that runs clang-format on files in a set of directories
---
Language: Cpp
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true

disable autostarted services

sudo systemctl disable bonescript-autorun.service bonescript.socket node-red.socket nginx.service cloud9.socket

share internet from host by USB

on BBB