Hacking with listing local system locks

ABOUT lslocks lslocks lists information about all the currently held file locks in a Linux system. File locking is a mechanism that restricts access to a computer file by allowing only one user or process access at any specific time. Systems implement locking to prevent the classic interceding update scenario (see race condition). [bash] $lslocks …

Hacking with an arbitrary precision calculator

dc is a reverse-polish desk calculator which supports unlimited preci‐ sion arithmetic. It also allows you to define and call macros. Nor‐ mally dc reads from the standard input; if any command arguments are given to it, they are filenames, and dc reads and executes the contents of the files before reading from standard input. …

A program to solve project euler problem 11

[python] # This program is copied from http://code.jasonbhill.com/python/project-euler-problem-11/ # Largest product in a grid # https://projecteuler.net/problem=11 import time start = time.time() L = [] L.append("08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08") L.append("49 49 99 40 17 81 18 57 60 87 17 …

Hacking with the quote command on Bash shell

ABOUT Quoting Quoting is used to remove the special meaning of certain characters or words to the shell. Quoting can be used to disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion. Each of the shell metacharacters (*note Definitions::) has special meaning to the …

Hacking with walking a process tree with pstree

pstree is a small, command line (i.e., all-text mode) program that displays the processes (i.e., executing instances of programs) on the system in the form of a tree diagram. It differs from the much more commonly used (and more complex) ps program in a number of respects, including that the latter shows the processes in …

Hacking with a command to look into cpu related hardware information

lscpu gathers CPU architecture information like number of CPUs, threads, cores, sockets,NUMA nodes, information about CPU caches, CPU family, model, bogoMIPS, byte order and stepping from sysfs and /proc/cpuinfo, and prints it in a human-readable format. It supports both online and offline CPUs. It can also print out in a parsable format, including how different …