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
Tag: Perl
Add Inline Comments for Multi-line Command in Bash Script
Posted onIn Bash script, it is common that multiple small commands run together connected by pipes (|) and the whole command is quite long. For clarity, we may write the command in multiple lines. How to add comments for these long multi-line commands? In Bash, the content after # in a line is the comment. Using
Read more
How to Match Multiple Lines using Regex in Perl One-liners
Posted onPerl one-liners with perl’s regular expression statement can be a very powerful text processing tools used as commands in a terminal or a script. By default, the input to the perl one-liner with -p or -n options is passed line by line. However, when we want to match multiple lines, it gets us some trouble.
Read more
How to Install Hyperledger Fabric 2.0 in Ubuntu 18.04
Posted onHyperledger Fabric is a consortium blockchain system. It’s performance is relatively good and its modular architecture enables it to be usable in many scenarios. Hyperledger Fabric itself has rich documents and samples of test networks. For beginners, deploying a new network for trying and testing still consumes quite some time. In this post, we will
Read more
Grep 2 Lines using `grep` Command in Linux
Posted ongrep 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 Wine 32-bit on CentOS 8
Posted onSince 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 print a line to STDERR and STDOUT in Perl?
Posted onIn Perl, how to print a string as a line to STDOUT? That is, the string and the newline character, nicely? And similarly, how to print the line to STDERR? In Perl, to nicely print a new line to STDOUT, you can use the “say” feature which “Just like print, but implicitly appends a newline”:
Read more
How to get the epoch timestamp in Perl?
Posted onIn Perl, how to get the epoch timestamp, the number of seconds passed since the epoch? In Perl, to get the epoch time, call the time function: my $ts = time Example: $ perl -e ‘print time . “n”‘ 1491473202
How to install Tex Live on CentOS 7 Linux?
Posted onThe LaTex packages in CentOS 7 Linux is not sufficient enough. I would like to Install Tex Live such as Tex Live 2016. How could I install it on CentOS 7? The best way I found is to use the texlive offical installation tool to install the full packages for texlive 2016. It will take
Read more
How to grep a tab on Linux?
Posted onHow to grep a tab on Linux? Including ‘t’ seems not working. grep can grep tabs. The problem is likely the tab is not passed to grep. If you are using Bash, you can use ANSI-C quoting to pass the “tab” to grep: $ grep $’t’ file.txt Or, use Perl-style regex (only for GNU grep)
Read more
How to do diff like `git diff –word-diff` without git on Linux?
Posted onThe result of git by git diff –word-diff is great. But how to do diff like git diff –word-diff without git on Linux? The plain diff command on Linux seems not accept options like –word-diff. The wdiff is for word-diff: wdiff program is a front end to diff for comparing files on a word per
Read more
How to sort a file by hexadecimal numbers on Linux using sort command?
Posted onThe sort command has a -n option to sort a file by numbers. However, it does not work with hexadecimal numbers. For example, this file: 400000000 __crt0 400000039 __newr0 400001B14 get_my_task_id 400001C14 get_new_task_id 400001582 input_char 40000166E input_q 400001A5D input_q_exit 400002002 main 4000000DB output_char 400001134 output_char_str 40000100C output_id 40000018F output_q 400000614 output_q_digits 400000B7E output_q_hex 400000D3E output_q_hex_j1
Read more
How to install .deb packages on Fedora?
Posted onI come across some closed source software that only provides .deb packages. Fedora manages packages with rpm/yum. How to install the .deb packages on Fedora? Alien is a tool to convert .deb package to .rpm package: http://joeyh.name/code/alien/ In latest Fedora, the tool alien is in Fedora’s repository. You can use dnf to install the package.
Read more
Which Checksum Tool on Linux is Faster?
Posted onIt is common practice to calculate the checksums for files to check its integrity. For large files, the checksum computation is slow. Now I am wondering why it is so slow and whether choosing another tool will be better. In this post, I try three common tools md5sum, sha1sum and crc32 to compute checksums on
Read more
Unified Linux Login and Home Using OpenLDAP and NFS
Posted onIn this post, how to unified Linux login and home directory using OpenLDAP and NFS/automount will be introduced. 0. System environment This solution is tested on Fedora 12 systems and CentOS 5. LDAP and NFS server: IP: 10.0.0.2 OS: Fedora 12 x86_64 ldap base dn: “dc=lgcpu1″ Clients: IP: 10.0.0.1/24 OS: Fedora 12 x86_64 1. LDAP
Read more