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 …
Author Archives: jeffrin
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. …
Continue reading “Hacking with an arbitrary precision calculator”
Ultimate Survival Alaska – Competitors :30
[youtube https://www.youtube.com/watch?v=2Z0l5mJ9ls8?rel=0&w=560&h=315]
Introducing The Linux Foundation Certification Program
[youtube https://www.youtube.com/watch?v=Y29qZ71Kicg?rel=0&w=560&h=315]
Example for an Array with processing language
/** * Array. * * An array is a list of data. Each piece of data in an array * is identified by an index number representing its position in * the array. Arrays are zero based, which means that the first * element in the array is [0], the second element is [1], and …
Continue reading “Example for an Array with processing language”
Hacking with GNU grep . ( grep ‘[1-9]\$’ price.list )
$emacs price.list $grep ‘[1-9]$’ price.list 1 2 3 4 45 46 78 $54 $cat price.list 1 2 3 4 45 46 78 $54 54$ 31$ 21$ $grep ‘[1-9]’ price.list 1 2 3 4 45 46 78 $54 54$ 31$ 21$ $grep ‘[1-9]\$’ price.list 54$ 31$ 21$ $
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 …
Continue reading “A program to solve project euler problem 11”
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 …
Continue reading “Hacking with the quote command on Bash shell”
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 …
Continue reading “Hacking with walking a process tree with pstree”
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 …
Continue reading “Hacking with a command to look into cpu related hardware information”