Mapping Left Alt to Ctrl for Windows Keyboard to Be Similar to macOS

Posted on

As a dedicated macOS user, I often find myself missing the convenience of having a Command key located near my thumb for common shortcuts when using Windows. In the standard Windows keyboard layout, the key that occupies the same position as the Command key on macOS is the Alt key. However, the equivalent key on
Read more

Why std::vector is the Optimal Choice for Data Structures for Performance in C++

Posted on

In C++ programming, data structures are essential for organizing and manipulating data. When it comes to storing and manipulating data, one data structure stands out above the rest – the std::vector. Efficient Memory Allocation One of the primary benefits of std::vector is its efficient memory allocation. std::vector uses contiguous memory allocation, which means that the
Read more

Release Notes For Linux v2.0

Posted on

This is the release notes for linux release v2.0 (source code: linux-2.0.tar.gz) with format adjusted by removing/replacing tabs/spaces/new lines/formatting marks. This notes document can give us an understanding of the early development of the Linux kernel. The original ASCII formatted version is at the end of this post. Intro This document contains a list of
Read more

Release Notes For Linux v1.0

Posted on

This is the release notes for linux release v1.0 (source code: linux-1.0.tar.gz) with format adjusted by removing/replacing tabs/spaces/new lines. This notes document can give us an understanding of the early development of the Linux kernel. The original ASCII formatted version is at the end of this post. CHANGES since 0.99 patchlevel 15: removed all the
Read more

Release Notes For Linux v0.95a

Posted on

This is the release notes for linux release v0.95a (source code: linux-0.95a.tar.gz) with format adjusted by removing/replacing tabs/spaces/new lines. This notes document can give us an understanding of the early development of the Linux kernel. The the formatted version of the referenced RELNOTES-0.95 can be found at Release Notes For Linux v0.95. The original ASCII
Read more

Generating RSA Private and Public Key Pair in Go Lang?

Posted on

How to generate a pair of RSA private and public key in Go lang? Go lang has a rich set of standard libraries. Using Go’s standard libraries, we can generate RSA private and Public keys. The Crypto standard libraries in Go lang Go lang standard libraries has a rich set of cryptography functions. Here are
Read more

Make Grub2 Boot Older Kernel Version in Ubuntu 20.04

Posted on

In a Linux system, we may have multiple kernels installed. Usually, it is the latest kernel configured to be the default one the system boot loader will use during automatic boot if there is no manual kernel choosing. In many cases, such as there is no driver ready yet for some devices in newer kernels,
Read more

How to enlarge root partition and filesystem size of cloud Linux VM at runtime without rebooting Linux

Posted on

It is common that the root disk space is not enough when running a Virtual Machine in the cloud such as Amazon Web Service (AWS). The cloud storage usually provides tools or facilities to enlarge a virtual disk size. However, to make the Linux recognize and and use the enlarged disks without rebooting the OS,
Read more

How to get the full path and directory of a Python script itself?

Posted on

In a Python script, how to get the full path and directory of the Python script itself? To get the path of the current file (the script itself), you can use __file__. To resolve any symbolic links in the path, you can use os.path.realpath(). Putting them together, you can do os.path.realpath(__file__) to get the full
Read more

How to exclude a package from a specific repository only in yum?

Posted on

This post https://www.systutorials.com/1661/making-dnf-yum-not-update-certain-packages/ introduces how to exclude a package from yum. But is it possible to exclude a package from a specific repository only? For example, a repository R1 I am using contains an updated version of gdb while I don’t want to use the gdb from it as I trust the version (although older)
Read more

`readlink -m` equivalent function in Python to get canonical file name

Posted on

readlink -m can get canonical file name by resolving every symlinks in every component of the given path recursively. In Python, the os.readlink() function does not do so. Any equivalent function in Python to the readlink -m command line? Specifically, it does: canonicalize by following every symlink in every component of the given name recursively,
Read more

What is the difference between work conserving I/O scheduler and non-work conserving I/O scheduler?

Posted on

What is the difference between work conserving I/O scheduler and non-work conserving I/O scheduler? In a work-conserving mode, the scheduler must choose one of the pending requests, if any, to dispatch, even if the pending requests are far away from the current disk head position. The rationale for non-work-conserving schedulers, such as the anticipatory scheduler
Read more

In Python, `os.makedirs()` with 0777 mode does not give others write permission

Posted on

In Python, os.makedirs() with 0777 mode can not give others write permission The code is as follows $ python Python 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. >>> import os >>> os.makedirs(“/tmp/test1/test2”, 0777) >>> The created dirs are not
Read more

How to get vCPU thread ID in QEMU/KVM host OS?

Posted on

In order to collect more information about CPU information internal guest OS, we usually need to get vCPU’s thread ID in host OS. Solution 1: Under directory ‘/sys/fs/cgroup/cpuset/machine’, you will find virtual_machine_name.libvirt-qemu directory. And under this directory, you will find all vCPU sub-directories and under these dirs, you will find vCPU thread IDs. For example
Read more

For QEMU/KVM, how to share data between host and guest

Posted on

General question for developers to access data between VM and VMM. As I know, paravirtualization solution is a good way to share data for VM and VMM since it has better performance. Please use Virtio 9p solution for QEMU/KVM. Note that you need to load 9p related modules for guest kernel. Add following in your
Read more

Cannot make directory ‘/var/run/screen/S-apache’: Permission denied

Posted on

Hello! Im trying to create a screen folder for the user apache, Not root. But it seems to fail, I have no idea on how to fix this issue. I only get the error: Cannot make directory ‘/var/run/screen/S-apache’: Permission denied Im using Cent OS 7 There may be various possible reasons. 2 common reasons: screen
Read more