Linux Engineering Utility Cheatsheet

A quick compilation of useful commands and configurations I frequently use in my daily operations. Working with Patches To generate a patch from a single file or directory: diff -Naur [from-file] [to-file] > [YourFileName.patch] -N: Treat absent files as empty. -a: Treat all files as text. -u: Unified output format (best for readability). -r: Recursive directory comparison. Version Control Cleanup Removing all .svn directories recursively: rm -rf `find . -type d -name .svn` Removing Git Metadata: In a Git repository, simply deleting the root .git directory is usually sufficient to remove history and configuration. ...

February 4, 2013 · 1 min · 133 words · Fran Kuo

Ubuntu Transition: Dash vs. Bash

To accelerate boot times, Ubuntu moved to using Dash (/bin/dash) as the default system shell (/bin/sh), replacing the more feature-rich but slower Bash. You can verify this linkage by checking /bin/sh -> /bin/dash. While this is great for system performance, it can cause unexpected failures in shell scripts designed specifically with “Bashisms” (features unique to Bash). If you need to revert the default shell back to Bash for compatibility reasons, you can execute the following command: ...

September 25, 2007 · 1 min · 125 words · Fran Kuo

Practical Daemon Implementation in Embedded Linux

For anyone working with Linux, the concept of a “Daemon” (or service) is fundamental. Daemons are background processes that operate independently of any active user session. I recently deep-dived into this topic via Devin Watson’s Linux Daemon Writing HOWTO, which provides a fantastic primer and a clear template. Building on that foundation, I refactored several processes in my current project to run as persistent background services. Below is a code snippet demonstrating the core structural requirements for a Linux daemon: ...

September 19, 2007 · 2 min · 282 words · Fran Kuo

Reflections on Patch Files and Embedded Systems Development

Recently, I was assigned to work on a streaming server project. On our development platform, we utilize a combination of patch files and shell scripts to manage source code. We start with the upstream source, apply modifications via patch commands, and then compile the results into the necessary shared libraries or executables. Initially, I didn’t give much thought to why we adopted this specific workflow, but lately, I’ve begun to appreciate the profound advantages of this approach. ...

September 19, 2007 · 2 min · 254 words · Fran Kuo