Bash has built-in facilities to trim characters at the beginning and end of the value of a variable: $ myvar="AAAthis is a testAAA" $ echo ${myvar##*(A)} this is a testAAA $ echo ${myvar%%*(A)} AAAthis is a test I work as… Read More
How to install jq on CentOS?
jq is in the EPEL repo, so you need to do this: $ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm $ sudo yum -y install jq I work as a freelancer, so if you don’t want to do that kind of things… Read More
Magic SysRq cheatsheet
First of all, ensure Magic SysRq is enabled: $ cat /proc/sys/kernel/sysrq 0 means “disabled”, 1 means “everything enabled” and >1 is a bitmask of allowed keys. If you are using Ubuntu, you can modify the `/etc/sysctl.d/10-magic-sysrq.conf` file to set this… Read More