pstree display a tree of processes

commandline session

$pstree -A jeffrin
at-spi2-registr---{at-spi2-registr}

dbus-daemon

dbus-daemon

dbus-launch

dbus-launch

dconf-service---2*[{dconf-service}]

gconfd-2

gnome-session-+-at-spi-bus-laun-+-dbus-daemon
              |                 `-3*[{at-spi-bus-laun}]
              |-bluetooth-apple---{bluetooth-apple}
              |-gdu-notificatio
              |-gnome-fallback----2*[{gnome-fallback-}]
              |-gnome-panel-+-chrome-+-chrome
              |             |        |-chrome-sandbox---chrome-+-chrome-+-chrome---11*[{c+
              |             |        |                         |        `-3*[chrome---3*[+
              |             |        |                         `-nacl_helper_boo
              |             |        `-31*[{chrome}]
              |             |-gnome-terminal-+-bash---pstree
              |             |                |-bash
              |             |                |-gnome-pty-helpe
              |             |                `-3*[{gnome-terminal}]
              |             `-3*[{gnome-panel}]
              |-gnome-screensav---2*[{gnome-screensav}]
              |-gnome-settings--+-sh
              |                 `-3*[{gnome-settings-}]
              |-gnome-sound-app---{gnome-sound-app}
              |-metacity---3*[{metacity}]
              |-nm-applet---3*[{nm-applet}]
              |-notification-da---{notification-da}
              |-polkit-gnome-au---{polkit-gnome-au}
              |-ssh-agent
              |-tracker-miner-f---3*[{tracker-miner-f}]
              |-tracker-store---6*[{tracker-store}]
              `-3*[{gnome-session}]

gnome-keyring-d---6*[{gnome-keyring-d}]

goa-daemon---{goa-daemon}

gsd-printer---{gsd-printer}

gvfs-afc-volume---{gvfs-afc-volume}

gvfs-gdu-volume

gvfs-gphoto2-vo

gvfsd

gvfsd-metadata

mission-control---2*[{mission-control}]

pulseaudio---2*[{pulseaudio}]
$

true and false notes

A UNIX Command

$true
$echo $?
0
$false
$echo $?
1
$

$ ./true --version >&-
./true: write error: Bad file number
$ ./true --version > /dev/full
./true: write error: No space left on device


UNIX Explanation

true - do nothing, successfully
exit with a status code indicating success.
false - do nothing, unsuccessfully
exit with a status code indicating failure.

Related Source Code Exposition

int
main (int argc, char **argv)
{

  if (argc == 2)
    {
      initialize_main (&argc, &argv);
      set_program_name (argv[0]);
      setlocale (LC_ALL, "");
      bindtextdomain (PACKAGE, LOCALEDIR);
      textdomain (PACKAGE);

      atexit (close_stdout);

      if (STREQ (argv[1], "--help"))
        usage (EXIT_STATUS);

      if (STREQ (argv[1], "--version"))
        version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS,
                     (char *) NULL);
    }

  exit (EXIT_STATUS);
}
 

Source Code Highlight

Recognize --help or --version only if it's the only
command-line argument.

Featured Image

Related Knowledge

`true' does  nothing except return  an exit status  of 0,
meaning "success".  It  can be used as a  place holder in
shell  scripts  where  a  successful command  is  needed,
although the  shell built-in  command `:' (colon)  may do
the same thing faster.   In most modern shells, `true' is
a built-in command,  so when you use `true'  in a script,
you're probably  using the built-in command,  not the one
documented here.

Note,  however, that it  is possible  to cause  `true' to
exit   with  nonzero   status:  with   the   `--help'  or
`--version'  option,  and  with standard  output  already
closed or redirected to a  file that evokes an I/O error.
For example, using a Bourne-compatible shell:

This version of `true' is implemented as a C program, and
is  thus  more secure  and  faster  than  a shell  script
implementation, and  may safely be used as  a dummy shell
for the purpose of disabling accounts.

source : info coreutils ‘true invocation’

dig DNS lookup utility

commandline session

$dig

; <> DiG 9.8.4-rpz2+rl005.12-P1 <>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44167
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;.				IN	NS

;; ANSWER SECTION:
.			17373	IN	NS	a.root-servers.net.
.			17373	IN	NS	b.root-servers.net.
.			17373	IN	NS	c.root-servers.net.
.			17373	IN	NS	d.root-servers.net.
.			17373	IN	NS	e.root-servers.net.
.			17373	IN	NS	f.root-servers.net.
.			17373	IN	NS	g.root-servers.net.
.			17373	IN	NS	h.root-servers.net.
.			17373	IN	NS	i.root-servers.net.
.			17373	IN	NS	j.root-servers.net.
.			17373	IN	NS	k.root-servers.net.
.			17373	IN	NS	l.root-servers.net.
.			17373	IN	NS	m.root-servers.net.

;; Query time: 53 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu Jun 20 20:40:07 2013
;; MSG SIZE  rcvd: 228

$

$dig a.root-servers.net

; <> DiG 9.8.4-rpz2+rl005.12-P1 <> a.root-servers.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27425
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;a.root-servers.net.		IN	A

;; ANSWER SECTION:
a.root-servers.net.	14389	IN	A	198.41.0.4

;; Query time: 41 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu Jun 20 20:43:28 2013
;; MSG SIZE  rcvd: 52

$

http://pluto.infoclub.in/wp-content/uploads/2013/06/dig.c

mv command GNU bash

commandline session

$> 1
$echo hello > 1
$cat 1
hello
$ls
1
$mv 1 2
$ls
2
$cat 2
hello
$

http://pluto.infoclub.in/wp-content/uploads/2013/06/mv.c

code section

  while ((c = getopt_long (argc, argv, "bfint:uvS:T", long_options, NULL))
         != -1)
    {
      switch (c)
        {
        case 'b':
          make_backups = true;
          if (optarg)
            version_control_string = optarg;
          break;
        case 'f':
          x.interactive = I_ALWAYS_YES;
          break;
        case 'i':
          x.interactive = I_ASK_USER;
          break;
        case 'n':
          x.interactive = I_ALWAYS_NO;
          break;
        case STRIP_TRAILING_SLASHES_OPTION:
          remove_trailing_slashes = true;
          break;
        case 't':
          if (target_directory)
            error (EXIT_FAILURE, 0, _("multiple target directories specified"));
          else
            {
              struct stat st;
              if (stat (optarg, &st) != 0)
                error (EXIT_FAILURE, errno, _("accessing %s"), quote (optarg));
              if (! S_ISDIR (st.st_mode))
                error (EXIT_FAILURE, 0, _("target %s is not a directory"),
                       quote (optarg));
            }
          target_directory = optarg;
          break;
        case 'T':
          no_target_directory = true;
          break;
        case 'u':
          x.update = true;
          break;
        case 'v':
          x.verbose = true;
          break;
        case 'S':
          make_backups = true;
          backup_suffix_string = optarg;
          break;
         case_GETOPT_HELP_CHAR;
         case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
        default:
          usage (EXIT_FAILURE);
        }
    }

http://stackoverflow.com/questions/10606250/macros-like-case-getopt-help-char-risky

cp command GNU bash

commandline session

$> 1
$echo hello > 2
$cat 1
$
$cat 2
hello
$cp -b 2
cp: missing destination file operand after ‘2’
Try 'cp --help' for more information.
$cp -b 2 2b
$ls
1  2  2b
$cat 2b
hello
$cp -x 2b 2c
$ls
1  2  2b  2c
$cat 2c
hello
$cp -x 2b /proc/
cp: cannot create regular file ‘/proc/2b’: Permission denied
$sudo cp -x 2b /proc/
cp: cannot create regular file ‘/proc/2b’: Permission denied
$cp -s 2c 2d
$ls -l
total 12
-rw-r--r-- 1 jeffrin jeffrin 0 Jun  1 22:28 1
-rw-r--r-- 1 jeffrin jeffrin 6 Jun  1 22:28 2
-rw-r--r-- 1 jeffrin jeffrin 6 Jun  1 22:28 2b
-rw-r--r-- 1 jeffrin jeffrin 6 Jun  1 22:29 2c
lrwxrwxrwx 1 jeffrin jeffrin 2 Jun  1 22:31 2d -> 2c
$

http://pluto.infoclub.in/wp-content/uploads/2013/06/cp.c
http://stackoverflow.com/questions/5740042/enum-use-in-a-c-program

Scatter Plot using R

ABOUT SCATTER PLOT

A scatter plot (also called a scatterplot, scatter graph, scatter chart, scattergram, or scatter diagram)
[3] is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically
two variables for a set of data. If the points are color-coded, one additional variable can be displayed.
The data are displayed as a collection of points, each having the value of one variable determining the
position on the horizontal axis and the value of the other variable determining the position on the
vertical axis.[4]

ABOUT R

R is a programming language and free software environment for statistical computing and graphics
supported by the R Foundation for Statistical Computing.[6] The R language is widely used among
statisticians and data miners for developing statistical software[7] and data analysis.[8] Polls, data
mining surveys, and studies of scholarly literature databases show substantial increases in popularity in
recent years.[9] As of January 2019, R ranks 12th in the TIOBE index, a measure of popularity of
programming languages.[10]

A GNU package,[11] source code for the R software environment is written primarily in C, Fortran and R
itself,[12] and is freely available under the GNU General Public License. Pre-compiled binary versions
are provided for various operating systems. Although R has a command line interface, there are several
graphical user interfaces, such as RStudio, an integrated development environment.[13][14]

TYPICAL SHELL SESSION RELATED
[code lang=”r”]
> plot(1,2,3)
Error in plot.xy(xy, type, …) : invalid plot type
> plot(12,45,55,67))
Error: unexpected ‘)’ in "plot(12,45,55,67))"
> plot(12,45,55,67)
Error in plot.window(…) : invalid ‘xlim’ value
> plot(12)
> png(file="basic.png")
> plot(12)
> dev.off()
null device
1
> plot(12,32)
> plot(12,55,99)
Error in plot.xy(xy, type, …) : invalid plot type
> plot(12,b,55)
Error in xy.coords(x, y, xlabel, ylabel, log) : object ‘b’ not found
>
[/code]

LINKS
http://www.mathsisfun.com/data/scatter-xy-plots.html
http://www.biomedware.com/files/documentation/spacestat/Statistics/Regression/Regression_line.htm
<!– basic –>
https://en.wikipedia.org/wiki/Scatter_plot
https://en.wikipedia.org/wiki/R_(programming_language)

objdump tinkering

commandline session

root>objdump -f nouveau.ko

nouveau.ko:     file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000

root>objdump -a nouveau.ko

nouveau.ko:     file format elf64-x86-64
nouveau.ko

root>objdump -p nouveau.ko

nouveau.ko:     file format elf64-x86-64

root>objdump -g nouveau.ko

nouveau.ko:     file format elf64-x86-64

root>

http://www.beautifulwork.org/wp-content/uploads/2013/05/objdump.c