Linux Command & Tools

[tmux] installation – tarball and configuration

Previously, I was a screen user, it helped me to open multiple sessions and windows to manage lots of Linux servers. But, its window split feature is not pretty friendly, so, that’s why I started using tmux. Info tmux gitrepo – https://github.com/tmux/tmux tmux packages – https://github.com/tmux/tmux/releases ( you may download favorite version here …

Linux Command & Tools

OpenSSl Useful Commands

Check SSL Certificate dates # check site $ echo | openssl s_client -servername localhost -connect localhost:443 2>/dev/null | openssl x509 -noout -dates # check file $  sudo openssl x509 -dates -noout -in ./server.crt $  sudo openssl x509 -dates -noout -in ./server.pem Check SSL Certificate expired # result 0 : not expired # …

Linux Command & Tools

[Linux Bash Shell] custom bind keys

Shell short keys : https://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands https://ss64.com/bash/syntax-keyboard.html We can use bind command to set the short keys in Bash environment. dump short keys : $ bind -p set short keys from file $ bind -f {key map file} set short key directly $ bind '"\C-p": shell-backward-kill-word' How to know the key code …

Linux Command & Tools

[Linux Commands] How to listen a port via command line to handle http request

NC $ while true; do echo 'HTTP/1.1 200 OK' | nc -l 8080; sleep 0.5; done GET / HTTP/1.1 User-Agent: curl/7.33.0 Host: localhost:8080 Accept: */* $ curl http://localhost:8080 -v * Rebuilt URL to: http://localhost:8080/ * About to connect() to localhost port 8080 (#0) * Trying 127.0.0.1… * Adding handle: conn: …

Linux Command & Tools

[Linux][Commands] Compression Tools

tar tar is the most common compression tool in Unix-like system. Here, I list some common options and usage that used in my routine work. Options: -c: create tar archive -C: specify the directory to extract tar archive -v: verbose -j: filter the archive through bzip2  ( tar.bz or tbz ) -J: filter …

Linux Command & Tools

[Linux Commands] System Tools – Simple Disk R/W Performance Tests

Basic Concept Disk Cache Hierarchy Simple Disk R/W Performance Tests This section, I’ll use “hdparm” to do Disk read performance tests and “dd” to test Disk write performance. Both tools are single-threaded and use sequential-read/write to do test, that is hard to fulfill real-life. Anyway we also can use them to …

Linux Command & Tools

[Linux Commands] System Tools –  Advanced Disk R/W Performance Tests

Basic Concept Disk Cache Hierarchy Simple Disk R/W Performance Tests Advanced Disk R/W Performance Tests by FIO FIO (flexible IO tester) is developed by “Jens Axboe” and he is the maintainer of the Linux kernel’s block layer. FIO is a powerful I/O performance benchmarking tool, it can be used to measure random IOPS …

Concept

[Linux][System Concept] – Disk Cache Hierarchy

Disk Cache Hierarchy Page Cache (Operating System Cache) Linux kernels up to version 2.2 had both a Page Cache & a Buffer Cache. As of the 2.4 kernel, these two caches have been combined. Today, there is only one cache, the Page Cache. You may use free command to see the …

Linux Command & Tools

[Linux Commands] System Tools – How to know the disk type ? HDD or SSD

The simple way to identify the Disk type is to check the info from sysfs. We can check the value of  /sys/block/{disk}/queue/rotational . ( why this file ? ) 0: HDD 1: SSD We also can use lsblk command to get this rotational info from sysfs. $ lsblk -o "NAME,MAJ:MIN,RM,SIZE,TYPE,MOUNTPOINT,ROTA" NAME MAJ:MIN …

Linux Command & Tools

[Linux Commands] Tune “Reversed Block Count” of partition on ext2/ext3/ext4 filesystem

tune2fs command is used to adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems. More common use cases: View filesystem parameters, ex: Block Size Reserved block count convert ext2 filesystem to ext3 for adding Journaling feature with -j parameter. convert ext3 filesystem to ext4 with -O extents,uninit_bg,dir_index parameters. This site describe the detail about …