Category: TIPS

Yocto: Introduction

The Yocto Project Overview and Concepts Manual introduces the tools and ideas used to build custom Linux systems for embedded devices. It’s a guide to the overall model, rather than a step-by-step tutorial or a reference for every setting.

  • What Yocto is for: It lets teams assemble tailored Linux images for different hardware, choosing the software and system behavior they need. The approach supports reuse, customization, and relatively reproducible builds.
  • How customization is organized: Build instructions and settings are grouped into layers. Separate layers can handle hardware support (BSP), distribution policy, or application software. Keeping them modular makes changes easier to reuse and maintain.
  • What drives a build: BitBake reads recipes and configuration, works out task dependencies, and runs the build. A recipe describes how to fetch, patch, configure, compile, and package software. OE-Core provides a shared base of recipes and classes.
  • What a build produces: The system fetches sources, applies patches, builds and packages software, performs checks, then creates a filesystem image and optionally an SDK for application development.
  • What Poky is: Poky is the Yocto Project’s reference distribution and a useful starting point for learning and customization. The manual cautions that it is not a ready-to-ship product distribution.
  • How development fits together: Typically, you build on a Linux host and run the result on target hardware or an emulator. The manual also discusses Git workflows, licensing, cross-development toolchains, and tools such as devtool, eSDK, and Toaster.
  • What to expect: Yocto offers fine control over system contents, but has a steep learning curve and can take a long time to build initially. The shared-state cache can avoid rebuilding unchanged components and speed up later builds.

Mental model: configuration selects the target and policies; layers provide the metadata; recipes describe software; BitBake runs the tasks; the result is an image and optionally an SDK.

The manual has three main parts: an introduction to Yocto, an overview of the development environment, and a deeper explanation of build concepts. For hands-on steps, it points readers to the Quick Build guide and the Development Tasks Manual.

Practical AI: Prediction

Prediction is when AI uses past information to estimate what may happen next.

Examples:

A weather app predicts rain.

A shopping app predicts what you may buy.

In simple words, prediction helps AI answer:

“Based on what happened before, what is likely to happen next?”

Apply it today

Use prediction to plan your time better.

Before starting your day, list 3 tasks and predict how long each one will take:

TaskMy predictionActual time
Reply to emails30 min
Review document45 min
Learn AI concept20 min

At the end of the day, fill in the actual time.

After a few days, you will see patterns like:

“I usually underestimate email time.”

Then you can plan more realistically.

Try this prompt

“Here are my tasks and the time I predicted for each: [task, prection,actual, email,20,20,chat,20.,30,learning,30,20, email,20,40,chat,20.,20,learning,30,00,email,20,10,chat,20.,40,learning,30,20]. Help me estimate realistic timings and suggest a better daily plan.”

Response

I read this as three rounds of email, chat, and learning, with times in minutes. Assuming “00” means zero, your totals were 210 minutes predicted and 200 minutes actual.

TaskPredictedActualWhat to plan
Email (3 sessions)60 min70 min25 min per session
Chat (3 sessions)60 min90 min30 min per session
Learning (3 sessions)90 min40 min20 min per session

Email ran a little over estimate, while chat took half again as long as planned. Learning’s actuals were 20, 0, and 20 minutes; if that zero means a canceled or untracked session, 20 minutes is a better estimate for a session you complete.

Suggested plan: Set aside about 3 hours 45 minutes of focused work, plus short transitions. For example: repeat this cycle three times—25 min email, 30 min chat, 20 min learning—with 5-minute gaps between tasks. That’s about 4 hours 25 minutes total, including the gaps. Put learning in a time of day when you can focus, and use the extra time as a buffer if email or chat runs long.

Prediction is useful because it helps you make better decisions before the day becomes busy.

MYANMAR ANNOUNCES COMPULSORY MILITARY SERVICE FOR BURMESE YOUTH

On February 10, 2024, Myanmar’s junta announced that the 2010 People’s Military Service Law would be enforced. The law requires that:

  • Men aged 18 to 35 serve for up to two years
  • Women aged 18 to 27 serve for up to two years
  • Specialists such as doctors aged up to 45 serve for three years
  • “Professional” men and women can be conscripted up to the ages of 45 and 35 respectively

WHY CHINA CAN’T INVADE TAIWAN

china holding drills .

Invading Taiwan Is Still Too Risky

China officially ended its live-fire military exercises around Taiwan this week, but its Taiwan Affairs Office has issued a white paper emphasizing “peaceful reunification” with the self-ruled island—while reserving the right to use force. It looks like dramatic escalation in response to U.S. House Speaker Nancy Pelosi’s visit to Taiwan can be ruled out, even as aggressive Chinese intrusions across the median line in the Taiwan Strait become the new normal.

In the aftermath of Pelosi’s visit, it’s worth considering just why China doesn’t invade Taiwan, despite near-constant threats to do so. There are a few factors that keep things from kicking off in the Taiwan Strait.

First, there is China’s hope that Taiwan will return to the mainland without war. Polls in Taiwan make that seem like a fantasy: Just 2 percent of Taiwanese identify solely as Chinese, a figure that has fallen from 25 percent a decade ago, thanks to generational change and Beijing’s aggression and crackdowns on human rights. Most of the Taiwanese public holds negative views of the Chinese Communist Party (CCP), and Beijing’s destruction of legal freedoms in Hong Kong turned the “one-country, two systems” principle into a joke.

But it’s possible that Chinese leaders have convinced themselves Taiwan’s return might happen: The white paper paints the Taiwanese public as deceived by the ruling Democratic Progressive Party and the West, and China’s ambassador to Australia has said the polls are misleading. Chinese officials lie about their own system so regularly, they assume that others do the same. Furthermore, the Taiwan Affairs Office also can’t be honest even internally about its own failure to woo Taiwanese to the idea of reunification, because it would expose itself.

Perhaps more likely: The CCP leadership thinks it may be able to force Taiwan to surrender through coercion and subversion rather than outright war. The CCP has spent a lot of time and money building ties with groups in Taiwan, from the once-ruling Kuomintang to organized crime. As I argued last week, Chinese leaders also hold out for the possibility of U.S. collapse, leaving Taiwan without its main protector.

Even if Beijing rules out peaceful reunification, the risks that would accompany an invasion are very high. There is no guarantee of Chinese success if it invades Taiwan, even without direct U.S. intervention. China hasn’t fought an actual war for 43 years, since its failed invasion of Vietnam in 1979; although it has invested heavily in its military, it has had no opportunity to test its doctrine or technologies.

Despite Chinese claims that an invasion would be quick and easy, it would be an amphibious attack of an unprecedented scale against a Taiwanese opponent that has prepared for the scenario for decades—even if it faces its own morale and logistical problems.

Then there are the geopolitical risks of an invasion, most importantly the possibility of full-scale war with the United States. On the one hand, a faction within Chinese military academia genuinely believes invading Taiwan could demonstrate superior will and push the United States out of the Asia-Pacific region. There are certainly questions about how willing Washington would be to go to war and if it could defend Taiwan.

On the other, no one in Beijing wants to suffer a humiliating defeat at the hands of the world’s most powerful military—or for the world to end in nuclear flames.

Putting the United States aside, an invasion of Taiwan would destroy China’s claims that it is a peaceful power—and with them Beijing’s relations with Tokyo, which has strong ties to Taipei. At least at first, a conquered Taiwan could not be sealed off from the world like Tibet or Xinjiang, where atrocities can remain somewhat hidden. Even if China cut off Taiwan’s internet, the island is high-tech enough to get out images of war or occupation that would damage China’s reputation.

Relatedly, an invasion could be followed by an economic recession at home. Southern China’s economy is entangled with Taiwanese suppliers and capital, which would be ruined by a war. Technology firms such as Taiwan Semiconductor Manufacturing Co. have scorched-earth plans in place for their factories in the event of an invasion, and talent would flee wherever possible. The West’s financial muscle exerted over Russia’s war in Ukraine has also caused concern in Beijing, even though extensive sanctions on China would cause much more damage to the global economy.

Finally—and perhaps most potent—is the political risk of invading Taiwan.

Global AI spending forecasts

📊 AI Spending Growth Forecast

  • Global spending on artificial intelligence is projected to reach an estimated $2.53 trillion in 2026 and $3.33 trillion in 2027, according to research firm Gartner. (Yahoo Finance)

💡 What’s Driving the Growth

  • AI infrastructure investments (like data centers and servers) make up a large part of the projected spending — roughly $1.36 trillion in 2026 and about $1.75 trillion in 2027. (Yahoo Finance)
  • Spending will also include software, AI models, data science tools, and services. (Yahoo Finance)

📈 Market Context & Interpretation

  • Some analysts view the continued surge in AI investments as a sign that companies are building long-term technological foundations.
  • Others caution that we may be entering a “trough of disillusionment” where early hype gives way to more cautious spending — similar to past tech trends. (Yahoo Finance)

🧠 What It Means

  • Businesses and tech leaders are pouring capital into AI on a massive scale, focusing especially on infrastructure that supports advanced computing and machine learning.
  • The growth trend suggests AI is becoming a core enterprise and IT priority globally, not just a niche technology. (gartner.com)

ASLR (Address Space Layout Randomization)

ASLR (Address Space Layout Randomization) is a security feature that randomizes the memory addresses used by key data areas of a process — such as the stack, heap, libraries, and executable code.

🔍 Purpose:

To make it harder for attackers to predict memory locations during an exploit (e.g., buffer overflow, return-oriented programming).

Without ASLR, attackers can rely on fixed addresses to inject or jump to malicious code.
With ASLR, every reboot or process restart changes memory layout, invalidating most static exploits.

How ASLR Works

Memory RegionWhat’s RandomizedExample
Executable baseProgram’s load address/bin/bash loads at different addresses each run
StackStack start addressPrevents predictable stack-smashing offsets
HeapHeap baseStops heap spraying reliability
Shared librarieslibc, etc.Mapped at different offsets each run

ASLR Compliance Meaning

Being ASLR compliant means:

  1. The OS supports ASLR, and
  2. The application, driver, or firmware image is built and linked to use ASLR.

In other words:

The binary and its runtime environment both must support and not disable ASLR.

Windows

  • ASLR is enabled system-wide via /DYNAMICBASE linker flag.
  • You can verify by running:

dumpbin /headers myapp.exe | find "Dynamic base"

→ If Dynamic base is listed → ASLR enabled.

Policies: Controlled via Exploit Protection or Group Policy.

Windows 10+ also support Force ASLR for all executables.

Linux

  • Controlled via /proc/sys/kernel/randomize_va_space
    • Value Meaning
    • 0 ASLR disabled
    • 1 Conservative randomization
    • 2 Full randomization

With value 1, Linux randomizes these user-space memory areas:

Memory areaRandomized with value 1?Notes
mmap base addressYesAffects shared libraries and memory mappings created with mmap()
Shared librariesYesBecause shared libraries are usually loaded through mmap()
StackYesMain thread stack location is randomized
VDSO pageYesKernel-provided virtual syscall page is randomized
Heap / brk areaUsually NoFull heap randomization needs value 2

randomize_va_space = 1
stack + mmap/libs + VDSO randomized

randomize_va_space = 2
stack + mmap/libs + VDSO + heap/brk randomized

What is the connectx-7 command to read the transceiver data?

To read transceiver (optics) data such as vendor name, part number, wavelength, or temperature from an NVIDIA ConnectX-7 Ethernet adapter, you can use the mlxlink or mlxconfig tools from the Mellanox/NVIDIA MLNX_OFED or NVIDIA Networking tools package.

🔹 1. Using mlxlink (preferred for transceiver info)

sudo mlxlink -d --port --show_media_info

sudo mlxlink -d /dev/mst/mt4125_pciconf0 --port 1 --show_media_info

This shows detailed optics/transceiver information:

  • Transceiver type (QSFP56, OSFP, etc.)
  • Vendor name and part number
  • Serial number
  • Connector type
  • Supported speeds
  • Module temperature, voltage, TX/RX power, etc.

To list available devices:

mst status

🔹 2. Using ethtool (basic optics data for Ethernet interfaces)

sudo ethtool -m

sudo ethtool -m ens5f0

Outputs (if supported):

  • Vendor, serial, wavelength
  • RX/TX bias, power, temperature

Note: Some ConnectX-7 drivers (esp. for OSFP/QSFP-DD) restrict access via ethtool, so mlxlink gives fuller info.

🔹 3. Using mlxconfig (for configuration and EEPROM access)
sudo mlxconfig -d q

sudo mlxconfig -d -e

mlxconfig is mostly for configuration (e.g., link speed, PCIe settings), not optics monitoring — use mlxlink for that purpose.

🔹 4. Example Output Snippet

MediaInfo:

Module: 400GBASE-DR4
Vendor: FINISAR CORP
Vendor PN: FTL410QE2C
Serial Number: FTL1234A0001
Temp: 36.23°C
Voltage: 3.31V
TX Power: 1.72 dBm
RX Power: 2.01 dBm