Blog
-
Cut and move Runs via python-docx
I want to cut and paste a run in one same document, but python-docx(1.1.0) don't have the function.
Here are some related page, but it doesn't solve the problem: How do I copy the contents of a word document? Copy paragraphs elements from one document to another
So I carefully read the source code and found that:
- You can process OXML object via
paragraph._pandrun._r, also call(paragraph/run)._element - If you add a
run._rto an otherparagraph._p, it will be automatically removed from the origin paragraph
- You can process OXML object via
-
How to Update ID Information for Railway e-Card on 12306
Recently encountered the situation where Railway e-Card reached one year and required updating Bank of China's real-name information
Although 12306 prompts for card upgrade, it's actually unnecessary.
Reference: Railway e-Card Activation Error: Operation Failed, System Error, Reserved
Search for "BOC Customer Verification" in WeChat mini-programs (this mini-program's sole function), then update ID information using ID card photos.
-
Code as Operating System (UpgradeAll 2 Development Plan)
As I use more electronic products spanning Linux desktops/servers and Android, I've realized there are limits to backup/restore OS configurations - the fundamental limitation being that it neither understands nor can understand the meaning of data.
Whether it's DNS hosts or software database caches, they're all just "files" in its eyes.
The Past
This led to the idea of "code as infrastructure," exemplified by Ansible and Terraform. However, their interpretation of "code" contains significant flaws. With software code, most side effects disappear when the software stops running, and the remaining side effects can be covered by test code.
-
Manually Flashing Any Android ROM
With Fastboot and payload_dumper, we can flash any ROM we need at any time.
In this article, I'll share my experience successfully flashing third-party ROMs (like crDroid OS) on Redmi K40 via Fastboot. After referencing some threads on XDA forums, I found a simple method to avoid errors during flashing.
Recently, during an update, I encountered the error:
"Error applying update: 7 (ErrorCode:: kInstallDeviceOpenError )Updater process ended with ERROR: 1 Error installing zip file"Considering OTA packages for A/B partitions don't contain updater-script files at all, referring to Google's "Building OTA Packages" documentation, you could modify
pre-device,pre-build-incremental,pre-build, etc. But trust me, it's completely useless.Through research, I found this article: Flash fastboot rom / unbrick any xiaomi phone without any flashtool.
-
Random Thoughts, Excerpts
-
Sharing dom4j Proguard Rules Configuration
Preface
Users reported that UpgradeAll's F-Droid configuration couldn't be parsed. Checking logs revealed dom4j-related errors. However, debugging couldn't reproduce the issue - it only occurred in release builds with obfuscation.
Troubleshooting
-
Displaying Only Dotfiles with exa
exa is a replacement for the ls command, designed to provide a more user-friendly and colorful interface, similar to what bat aims to achieve.
Background
After briefly trying exa, I decided to alias it to replace ls for a trial period. Then I discovered that the
ls -al --ignore="[^.]*"command couldn't be directly replaced since exa doesn't have an ignore parameter. -
Pipewire: Send Audio to Multiple Devices
Today I wanted to listen to music with a friend. After connecting their Bluetooth headphones to my computer, I noticed the KDE interface only allows setting one audio output port. Remembering my previous experience with Steam Link, I decided to use Pipewire to achieve this functionality.
References:
- Find audio devices
$ pw-link -o Midi-Bridge:Midi Through:(capture_0) Midi Through Port-0 v4l2_input.pci-0000_00_14.0-usb-0_6_1.0:out_0 alsa_output.pci-0000_00_1f.3.analog-stereo:monitor_FL alsa_output.pci-0000_00_1f.3.analog-stereo:monitor_FR alsa_input.pci-0000_00_1f.3.analog-stereo:capture_FL alsa_input.pci-0000_00_1f.3.analog-stereo:capture_FR easyeffects_sink:monitor_FL easyeffects_sink:monitor_FR easyeffects_source:capture_FL easyeffects_source:capture_FR ee_soe_output_level:output_FL ee_soe_output_level:output_FR ee_soe_spectrum:output_FL ee_soe_spectrum:output_FR ee_soe_equalizer:output_FL ee_soe_equalizer:output_FR ee_soe_convolver:output_FL ee_soe_convolver:output_FR ee_sie_output_level:output_FL ee_sie_output_level:output_FR ee_sie_spectrum:output_FL ee_sie_spectrum:output_FR Audacious:output_FL Audacious:output_FR steam:output_FL steam:output_FR bluez_output.84_AB_26_A6_8A_6A.a2dp-sink:monitor_FL bluez_output.84_AB_26_A6_8A_6A.a2dp-sink:monitor_FR -
DP-3T: A Privacy-Preserving "Health Code"
People always choose and believe in explanations and solutions that align with intuition, which leads to mediocrity.
DP-3T, a privacy-preserving contact tracing software, is like a health code.
The health code, designed from an omniscient perspective to "protect" everyone, almost inevitably leads to Big Brother scenarios.
-
Steam for Linux no sound when streaming
When I use Steam Link to play my game which is running in my ArchLinux PC, I find steam only catch microphone and ignore the sound output of PC. (Fixed on my ArchLinux PC at 2022-09-15)
Github Issue: [Remote Play] No sound when streaming #6606