Posts by Category

Android

Track down the source of android toast

1 minute read

There are many ways to tell which app sends a toast, the most quickest way is to install third-party app such as Toast Source or Toaster, if you don’t want t...

Android procfs demystified – cpuinfo

2 minute read

From cpuinfo in procfs, we get a lot information about the cpu on board, how many cores, architecture etc, here is an example output of cpuinfo of RPI 3B+: `...

Analyzing Android with Battery Historian

3 minute read

Battery Historian is a tool for inspecting battery related issues, it works on android 5.0 and above, this can also be used for analyzing performance since b...

Control your Android devices with scrcpy

1 minute read

scrcpy is an open source project developed by Genymobile, it can be used to display and control of your android devices over adb connection. The following fe...

Android performance monitoring with bcc

4 minute read

Build kernel with bpf support In order to use bpf, kernel should be at least build with these options: +CONFIG_BPF=y +CONFIG_BPF_SYSCALL=y +CONFIG_BPF_EVENTS...

What I’ve learned from wa output

10 minute read

Workload-automation is a great tool for benchmark automation, it utilizes tools in sdk and android system, including aapt, pm, am etc through devlib, this po...

Find Out Who Deleted a File

1 minute read

Previously I wrote a post about how to use ftrace via trace-cmd, now here comes a real world example showing how to find who deleted a file in Android system.

Generate Call & Caller Graphs with Doxygen

less than 1 minute read

Installation Doxygen using dot from graphviz to generate graphs, install doxygen and its dependency: sudo apt install doxygen -y sudo apt-get install graphvi...

open source perf tools

1 minute read

Tools Description avocado Avocado is a next generation testing framework inspired by Autotest ...

Enable zram on Android

1 minute read

What is zram Kernel Documentation says it is Compressed RAM based block devices.

Back to top ↑

Miscelaneous

Build Hello World with Automake

2 minute read

There are lot of IDEs out there can build apps or libraries for you, but this is not the way I like, I prefer the command line, today I am gonna show you how...

Learning Resources

less than 1 minute read

This is a list of resources I used for expanding my knowledge on U-Boot, kernel and other stuff related embedded system.

Internet Connection Sharing with Armbian

3 minute read

I need to work while travelling in the following couple of months, so I need all my devices connected to the internet, N1 has a Ethernet port and wireless mo...

Markdown Cheatsheet

less than 1 minute read

Preserve white spaces In macOS, you need to press⌥ Opt+Space

Remove Git Commit from History

1 minute read

Occasionally, you may want to remove a commit from github/gitlab, for example, I pushed a commit to switched the jekyll theme from minima to minimal mistakes...

Play Armbian OS with Phicomm Box

5 minute read

Armbian is an operation system based on Debian and Ubuntu, created for ARM-based development boards, it also supports a wide variety of TV boxes, and a lot o...

A Proxy to Make Github Access Fly

less than 1 minute read

It is well known that, accessing github in China is a torture, cloning a github repository takes too much time, especially for big project like linux kernel,...

Using Gerrit on Ubuntu

2 minute read

Install Gerrit First download the latest version of gerrit from Gerrit Releases site:

Vim tips from zzapper

7 minute read

Best of Vim Tips zzapper 16 Years of Vi + 10+ years of Vim and still learning 31Aug18 : Last Update (Now in VIM Help Format :h helptags) ###These Tips are no...

Back to top ↑

Kernel

Using perf-tools in embedded linux

2 minute read

perf-tools is a collection of performance analysis tools based on perf events developed by Brendan Gregg, perf-tools are widely used on linux server and can ...

Monitoring Embedded Devices with Munin

3 minute read

Recently I was debugging a system hang problem on arm board, I reproduced this issue once, and noticed when this occurred, the interrupts on can interface is...

Bring Latest Linux Kernel to MINI2440

17 minute read

Poring Linux kernel to board is much easier than the age of version 2.6, I want to make an update my school projects, part of this procedure involves the ker...

Enable pstore for kernel oops/panic dumping

1 minute read

Debugging devices without serial console is big challenge especially for kernel panic issues, pstore (persistent store) writes kernel messages before system ...

Phicomm N1 Box High CPU Usage Due to IRQ-42

6 minute read

While playing Armbian with Phicomm N1 box, I found kernel thread irq/42-0.200908 have very high cpu usage thus cause the load average to around 2, this is a ...

Random Kernel Debugging Tips

3 minute read

All-zero address shown when do cat /proc/modules echo 0 > /proc/sys/kernel/kptr_restrict # or with sysctl sysctl kernel.kptr_restrict=0

Syzkaller: Coverage-guided Kernel Fuzzer

2 minute read

Syzkaller is a coverage-guided fuzzer for Linux kernel, it was mainly developed by Dmitry Vyukov, and with many other developers, it’s under active developme...

Kernel Debugging With Kgdb

10 minute read

In Kernel memory debugging techniques, we talked about using script decode_stacktrace.sh to translate addresses to lines, or if only interested in one entry ...

Debugging kernel with dynamic debug

5 minute read

Dynamic debug is a great feature for kernel debugging, kernel must be compiled with CONFIG_DYNAMIC_DEBUG option, if it was enabled, all pr_debug(), dev_dbg()...

Kernel memory debugging techniques

7 minute read

Linux kernel has many memory related debug tools to help kernel developers find out memory related issues, these tools are included in upstream kernel: Ke...

Back to top ↑

OpenWrt

Create OpenWrt Style of Patch with Quilt

less than 1 minute read

OpenWrt using its own format of patch file which can be created with quilt. Before creating patches for OpenWrt, we need to create a configuration file for q...

Back to top ↑

Productivity

Setup Build Environment with Vagrant

2 minute read

As a system engineer, I have to manage various build envrionmets, build all the projects against one Ubuntu version became imposssible, one change for one pr...

Sync Things with Syncthing

1 minute read

I use Syncthing to sync my notes from work desktop compute to vps server, so I can continue my work at home, syncthing is pretty easy to setup and use.

Taking Notes with Vim

6 minute read

I’ve been using Joplin for about 3 months, I love it, than any other note taking apps. Everything works fine until this Tuesday afternoon (around 3:20 PM to ...

Joplin: My New Note-taking Solution

3 minute read

Update: I switched to vim+git for note-taking this week because Joplin deleted a lot of my notes by accident, I put this post here for reference only, I m...

Quick File Transfer with QR code

less than 1 minute read

From time to time, I need to transfer files from computer to my android phone, install apk for example, I can use the app store if the app can be found there...

Turn vim into an IDE with spf13-vim

1 minute read

I’ve been using vim for a very long time, my vimrc file is based on Amix’s with minor modifications, I think it’s time to move forward embracing excellent pr...

Back to top ↑

Shell

fzf reports ‘parse error near `done’

less than 1 minute read

This is a long last issue that happens every time I open a new tab or open iTerm, I thought it was a issue of fzf, and it is not, actually, because reinstall...

Scheduling task with crontab

2 minute read

I think schduling a job with crontab should be easy for me, as I am a veteran linux user, the truth is I don’t know crontab, totally.

Automate FTP transfer with shell script

2 minute read

Android build process takes a very long time, especially on low end computers, after build complete, I wanna transfer the final image to ftp server for furth...

How to Debug Shell Scripts

1 minute read

In order to find out where the problem is with my script, I often use echo for debugging, print line number with echo ${LINENO}, but it is not a optimium way...

import code to empty git repo

less than 1 minute read

I am planning to make android pie runnning on our latest proudct, Continuous Integration team has initialized all the git project, inside citrix, but there i...

Back to top ↑

hassos

Manage Local Media with Jellyfin

4 minute read

Jellyfin is an open source local media management system, it is descended from Emby which is now goes commercial, it can fetch metadata from various website ...

Back to top ↑

U-Boot

Fix a Build Breakage on Inline Function

7 minute read

I’ve done a lot of work on u-boot-2010.09 for MINI2440 to make development process more comfortable, unfortunately, the archived u-boot images were deleted b...

U-Boot: Boot FIT Kernel Image

4 minute read

The way build ramdisk is not an option for me, load both uImage and ramdisk with U-Boot seems not a good way either, and as uImage is a legacy format, there ...

U-Boot: Understanding lowlevel_init

8 minute read

MINI2440 has two SDRAM chips on board, different version have different chipset, my SDRAM is EM63A165TS-6G from EtronTech, the pin and timing is compatible w...

U-Boot: Understanding Start.S

12 minute read

U-Boot is a universal bootloader for many architectures, the U-Boot image build against current version (u-boot-2020.10) cannot fit the size of stepping zone...

Debugging Mini2440 with OpenOCD

14 minute read

Bring board up for the first time, it usually involves debugging with JTAG, in this post I will be using OpenJTAG for mini2440, showing how to load program w...

Back to top ↑

Selfhosted

Make Selfhosted Services Public

6 minute read

If you are hosting services at home and want to be accessed from outside, there are couple of options: Cloudflare Tunnel frp nps ngrok

Build Famliy Album with PhotoPrism

5 minute read

After I uploaded my photos to nextcloud, I realized, nextcloud is probably not a good choice for hosting photos, so this time I try to manage these photos wi...

File Sharing with File Browser

1 minute read

Previously, I use cowtransfer to share files with our partners, thanks to cowtransfer-uploader, it is very convenient for automation, this changed recently, ...

NextCloud with Docker

7 minute read

Previously I deployed a nextcloud container in digitalocean droplet for my note synchronization. This time I want use nextcloud to hold all my documents and ...

Back to top ↑

Debug

Linux Tracing with Perfetto

1 minute read

Build perfetto git clone https://github.com/google/perfetto -b v43.1 git clone https://android.googlesource.com/platform/external/perfetto/ && cd per...

Analyzing Linux C Code with Facebook Infer

less than 1 minute read

Build infer ```sh sudo apt install libstdc++-12-dev linux-libc-dev:i386 gcc-multilib sudo ln -sf /usr/include/x86_64-linux-gnu/asm /usr/include/asm git clone...

Back to top ↑

cheatsheet

git cheatsheet

less than 1 minute read

Create a tag git tag -a v1.0 -m "milestone: v1" git push --tags

Back to top ↑

IoT

Blink Sketch on ESP8266

5 minute read

Making blink LED working with Arduino on ESP8266 is incredibly easy, with just a few clicks, of course you need to install Arduino IDE first, download the la...

Run MicroPython on ESP8266

4 minute read

MicroPython is a python implementation aimed to be running on MCUs such as ESP8266/ESP32, stm32 etc, all the ports can be found here, the following will only...

Build NodeMCU Firmware for ESP8266

3 minute read

NodeMCU is one of the most popular firmware for ESP8266 and ESP32 wifi SoCs, the firmware is written in c and has Lua interpreter builtin which is based on L...

Run Zephyr RTOS on ESP32

3 minute read

IoT gains too much attention these years, there are various RTOS are claimed to IoT OS, Zephyr OS is one of them, it is originated from WindRiver and is a pr...

Back to top ↑

Linux

Build Flutter App for Embedded Linux

2 minute read

Flutter SDK git clone https://github.com/sony/flutter-elinux.git sudo mv flutter-elinux /opt/ export PATH=$PATH:/opt/flutter-elinux/bin:/opt/flutter-elinux/f...

Create Toolchain with Crosstool-NG

less than 1 minute read

Preparation sudo apt install -y flex help2man libtool-bin bison libncurses5-dev wget -c http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.26.0.tar...

Back to top ↑

git

Using Git Like a Pro – aliases

1 minute read

Aliases are created through the use of the git config command, and will be saved to $HOME/.gitconfig, use below two commands to see a list of aliases:

Shell - batch revert and push to gerrit

less than 1 minute read

This post illustrates how to revert a commit in many branches, say 100 for example, and then push to gerrit server with reviewers added.

Back to top ↑

CI/CD

Setup Jenkins with Docker

2 minute read

Jenkins is one of the most popular continuous integration solution, I use it both for work and personal project, it provides webUI interface, to save to conf...

Back to top ↑

Ubuntu

Fixing Authentication Error on Login

less than 1 minute read

This issue happens when I trying to using some app, and cannot failed to install it’s dependancies, commplaining about python3, so I uninstalled python3, apt...

Back to top ↑

raspberry

Phicomm R1 Smart Speaker Revived

4 minute read

Wireless Configuration Most smart devices such as speakers, sockets, air conditioners are headless embedded devices, these devices need to be connected to th...

Back to top ↑

reading-note

Reading Notes on BPF Performance Tools

116 minute read

Ch 1 Introduction Ch 2 Technology Background Ch 3 Performance Analysis Ch 4 BCC Ch 5 bpftrace Ch 6 CPUs Ch 7 Memory Ch 8 File Systems Ch 9...

Reading Notes on Systems Performance

102 minute read

Ch 1 Introduction Ch 2 Methodology Ch 3 Operating Systems Ch 4 Observability Tools Ch 5 Applications Ch 6 CPUs Ch 7 Memory Ch 8 File Systems...

Back to top ↑

Yocto

Back to top ↑

toolchain

Build Toolchain for MIPS

less than 1 minute read

There are many ways to create a toolchain, the most easiest way to do this might be with buildroot, always grab the latest long term support release from off...

Back to top ↑

System

Execute Shell Script on Boot

1 minute read

I have built a rootfs with buildroot, rootfs is squashfs with overlayfs support for ease of writting configuration files such as dropbear that needs write pe...

Embedded Linux Process Supervision

1 minute read

For making a real world product, robustness is very important, some process may crash occasionally, this is possible even if the system is passed all kinds o...

Back to top ↑

Python

Back to top ↑

wordcloud

Back to top ↑

MacOS

Random MacOS Tips

less than 1 minute read

Disable subtitles in VLC by default Go to VLC ➜ Preferences ➜ Subtitles / OSD, enter none in the text box labeled Preferred subtitle language, this works fo...

Back to top ↑

Docker

Back to top ↑

Assembly

Back to top ↑

JTAG

Turn Your Raspberry Pi into a JTAG Adapter

3 minute read

I have several Raspberry Pis in hand, they are all not being used for a very long time because of the poor performance of the MMC controller, but it doesn’t ...

Back to top ↑

Resolution

Back to top ↑

debug

Wireless debugging with esplink

4 minute read

Serial console is always an very important tool when doing low level development such as kernel or bootloader, the most commonly used are the USB to serial c...

Back to top ↑

RTOS

Run Zephyr RTOS on ESP32

3 minute read

IoT gains too much attention these years, there are various RTOS are claimed to IoT OS, Zephyr OS is one of them, it is originated from WindRiver and is a pr...

Back to top ↑

kernel

Back to top ↑

memleak

Back to top ↑

Linker

Run clang 15 executable on legacy device

1 minute read

For a suspected memory leak issue on a legacy device running OpenWrt build with gcc-8, I need a toolchain with leak sanitizer support, so I try to generate o...

Back to top ↑