Mokhan - mokhan.ca - mokhan.ca
General Information:
Latest News:
daemon 25 Aug 2013 | 09:01 pm
A daemon is a process that runs in the background as a system process. In ruby we can use Process.daemon to put a process into the background. "ri Process.daemon" says: Detach the process from contr...
file locks 25 Aug 2013 | 08:40 pm
flock(2) says: flock - apply or remove an advisory lock on an open file A common convention in the unix work is to use file locks as a way to manage exclusive access to a resource. An example of thi...
signals 24 Aug 2013 | 11:11 am
man 7 signal says: Each signal has a current disposition, which determines how the process behaves when it is delivered the signal. When a process receives a signal, the process can react in differe...
socketpair 19 Aug 2013 | 12:51 am
A socket pair is a pair of already connected sockets. This is very useful for two way inter process communication (IPC). man 2 socket says: socket - create an endpoint for communication socket() cre...
pipes 18 Aug 2013 | 10:28 pm
ri IO.pipe tells me: Creates a pair of pipe endpoints (connected to each other) and returns them as a two-element array of IO objects: [ read_io, write_io ]. Essentially what this does is create two...
fork+exec 18 Aug 2013 | 07:11 pm
man 3 exec says: The exec() family of functions replaces the current process image with a new process image. What this means is when you fork a process then run exec with a command. The new forked p...
fork 14 Aug 2013 | 07:07 am
The man page on my systems describes the fork call like this: fork() creates a new process by duplicated the calling process. The new process, referred to as the child, is an exact duplicate of the c...
unix-fu 14 Aug 2013 | 06:18 am
Today I completed the second day of Jesse Storimers 2 day Unix-Fu Workshop. This is an online class that focuses on teaching unix from the perspective of a ruby programmer. This was a fantastic introd...
insertion sort 13 Jul 2013 | 02:22 am
This is another simple sorting algorithm, that inspects one elment at a time and finds the proper insertion point for it. It's advantage is that everything on the left side of the list is always sorte...
merge sort 13 Jul 2013 | 02:07 am
This is another divide and conquer sorting algorithm. worst case: O(n log n) steps dive the unsorted list into sublists, until each list contains a single item. repeatedly merge the sublists until...