Grep 2 Lines using `grep` Command in Linux

Posted on

grep is excellent to match patterns from STDOUT/text files in command line or scripts. It’s handy. Sometimes, our problem is more complex than finding a keyword from a file. On a first thought, it may sound impossible using grep for such complex problems. But grep can be quite powerful than we thought. Today, let’s check
Read more

How to Install Go 1.13.x on Ubuntu 18.04

Posted on

In Ubuntu 18.04 LTS, the default Go lang version is 1.10. For compatibility reason, the Ubuntu LTS will usually keep the major release version numbers for packages. However, many applications, such as Hyperledger Fabric 2.0, require a newer version of Go. In this post, let’s take a look at how to install a system level
Read more

GCC May “Save” You Some Recursive Functions Calls: an Analysis of a Function Call Stack Length Example

Posted on

We know compilers like gcc can do lots smart optimization to make the program run faster. Regarding functions call optimization, gcc can do tail-call elimination to save the cost of allocating a new stack frame, and tail recursion elimination to turn a recursive function to non-recursive iterative one. gcc can even transform some recursive functions
Read more

Bash Learning Materials

Posted on

Bash (GNU Bourne-Again SHell) the default shell for many Linux distributions. It is very common for scripting languages in Linux. Bash is easy and straightforward for writing small tools. However, as most tools, it has its grammars that could easily cause bugs if they are not used correctly. Here I summarize a list of good
Read more

How to Install Wine 32-bit on CentOS 8

Posted on

Since version 7, RHEL and CentOS only have 64 bit versions. For some reasons, it’s better to run many Windows applications under 32 bit wine. Like How to Install Wine 32-bit on CentOS 7, this post introduce how to install 32-bit Wine on CentOS 8. Most of the mechanisms are similar yet there are differences.
Read more

How to Convert Integers to Strings and Strings to Integers in PHP

Posted on

Conversion from integer to string and from string to integer are common operations in most applications such as C++. PHP has its uniqueness in language and standard library design. In this post, we will check methods to convert integers to strings and vice versa. Convert string to int in PHP You can cast a string
Read more

Synchronizing Thunderbird Calendar and Address Book with Office365 Exchange Online using ActiveSync

Posted on

Thunderbird is a nice email client available on Linux and Windows. With the Lightning plugin, Thunderbird can support calendar functions well. Exchange is a widely used email and calendar/address book service software. Office 365 provide the cloud version of Exchange named Office 365 Exchange Online. Although Exchange Online provide IMAP for synchronizing emails, it provides
Read more

How to Make iPhone with iOS 13 Faster

Posted on

After the recent iOS upgrading to version 13, many older iPhones such as iPhone 8 turn to be running slower, although there are many new features. New features and functions use more CPU/GPU/memory and the iOS may run slower. But are there any methods to make it run faster? After quite some research and testing,
Read more

How to Change Windows User Name on Windows 10 Using Computer Management

Posted on

The Windows user name can be changed according to the user’s needs and requirement. The Windows 10 Windows Settings tool interface keeps changing after updates. It is a little hard to find out the tool to do the user name changing. One way to change Windows user name is to do it through the Computer
Read more

How to Statically Link OCaml Programs

Posted on

Static linking is preferred for some cases although it has its own various problems. Static building/linking is not always possible for some languages on some platform. For OCaml, the answer to this question is yes. In this post, we will introduce 2 methods to statically linking OCaml: static linking with runtime glibc required and static
Read more

How to limit shared AWS EC2 accounts’ access to view and start all VMs yet stop only certain VMs

Posted on

If a team with many accounts share and manages the virtual machines under that same AWS accounts, it is a common practice to limit AWS EC2 accounts’ access to view or start all VMs yet stop only certain VMs. For example, one account has 50 VMs tagged “prod” while 25 VMs tagged “dev”. The developers
Read more

How to do screen recording on Wayland in Linux?

Posted on

How to do screen recording on Wayland in Linux? Many screen recorders do not work on the new Wayland. Using Green Recorder You may try Green Recorder which supports Wayland. Note: Green Recorder is no longer under development by the original author (Please check the project README for more details). It still works well for
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

Do big data stream processing in the stream way

Posted on

Reading: Years in Big Data. Months with Apache Flink. 5 Early Observations With Stream Processing: https://data-artisans.com/blog/early-observations-apache-flink. The article suggest adopting the right solution, Flink, for big data processing. Flink is interesting and built for stream processing. The broader view and take away may be to solve problems using the right solution. We saw many painful
Read more

How to synchronize Google Drive and Google Docs files in Ubuntu/Debian/Mint Linux using Insync

Posted on

Google Drive is a nice cloud storage service. It provides a suite of nice online document spreadsheet and slide editors Google Docs, Google Sheets and Google Slides. The collaborative editing and full history tracking features of Google Docs are excellent. Google Drive gives 16GB free storage which is pretty much larger compared to other free
Read more

How to install GNOME 3 in Ubuntu MATE 18.04?

Posted on

How to install the GNOME 3 (gnome-shell) desktop environment in Ubuntu MATE 18.04? To install gnome3 to Ubuntu, install these packages sudo apt install gnome-session gdm3 ubuntu-desktop During installation, the installation tools will let you choose the default display manager. You may choose gdm3. Then reboot you Ubuntu Linux and gdm3 will be shown. Click
Read more

Installing Zlib from Source Code in Ubuntu Linux

Posted on

Zlib is a popular open-source compression library used by many software applications to compress and decompress data. While it can be installed in Ubuntu using the apt package manager, you may need to install it from the source code if the version available in the Ubuntu repositories is outdated or if you need to customize
Read more

Thunderbird Addons to Make Thunderbird Easier to Use

Posted on

Thunderbird is powerful and feature rich. But different users have different needs and it is not feasible to include all features into the base software, where a plugin system shines. Thunderbird, similar to Firefox from Mozilla, supports addons/plugins and has a large ecosystems. Here, we will introduce several addons to Thunderbird that make Thunderbird easier
Read more