chrt – manipulate real-time attributes of a process

A UNIX Command
$chrt -m
SCHED_OTHER min/max priority	: 0/0
SCHED_FIFO min/max priority	: 1/99
SCHED_RR min/max priority	: 1/99
SCHED_BATCH min/max priority	: 0/0
SCHED_IDLE min/max priority	: 0/0
$chrt -b  -p 0 4555
$chrt -p 4555
pid 4555's current scheduling policy: SCHED_BATCH
pid 4555's current scheduling priority: 0
$chrt -o  -p 0 4555
$chrt -p 4555
pid 4555's current scheduling policy: SCHED_OTHER
pid 4555's current scheduling priority: 0
$

UNIX Explanation
chrt   sets  or retrieves the real-time scheduling
attributes of an existing PID or runs COMMAND with
the given attributes.  Both policy (one of SCHED_OTHER,
SCHED_FIFO, SCHED_RR, SCHED_BATCH, or SCHED_IDLE)
and priority can be set and retrieved.

vdir – list directory contents

A UNIX Command
$vdir symmel/
total 20
drwxr-xr-x  2 jeffrin jeffrin 4096 Jul 27 01:11 Docs
-rw-r--r--  1 jeffrin jeffrin   88 Jul 25 00:57 kernel_start.asm
-rw-r--r--  1 jeffrin jeffrin   78 Jul 25 00:57 kernel_start.s
drwxr-xr-x 10 jeffrin jeffrin 4096 Jul 25 00:57 linux
drwxr-xr-x  2 jeffrin jeffrin 4096 Jul 26 23:55 loader
-rw-r--r--  1 jeffrin jeffrin    0 Jul 25 00:57 README
$ls symmel/
Docs  kernel_start.asm  kernel_start.s  linux  loader  README
$

UNIX Explanation
List information  about the FILEs  (the current directory
by  default).   Sort entries  alphabetically  if none  of
-cftuvSUX nor --sort.

write — send a message to another user

A UNIX Command
$bsd-write jeffrin 8
bsd-write: jeffrin is not logged in on 8
$bsd-write jeffrin tty8
bsd-write: jeffrin has messages disabled on tty8
$mesg y
$bsd-write jeffrin tty8
bsd-write: jeffrin has messages disabled on tty8
$w
 20:08:58 up 23 min,  3 users,  load average: 0.02, 0.15, 0.16
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     tty1                      19:46   22:18   0.35s  0.03s wpa_supplicant -iwlan0 -c /etc/wpa_
jeffrin  tty8     :0               19:53   23:20  58.84s  0.09s x-session-manager
jeffrin  pts/0    :0.0             20:01    0.00s  0.30s  0.00s w
$bsd-write jeffrin pts/0

Message from jeffrin@debian.BW on pts/0 at 20:09 ...
hey ... worked ?
hey ... worked ?
EOF
$

UNIX Explanation
If the  user you want  to write to  is logged in  on more
than  one terminal,  you  can specify  which terminal  to
write to  by specifying the  terminal name as  the second
operand to the write command.  Alternatively, you can let
write select one of the  terminals - it will pick the one
with the shortest idle time.  This is so that if the user
is logged  in at work and  also dialed up  from home, the
message will go to the right place.

skill, snice – send a signal or report process status

A UNIX Command
$skill
Usage:   skill [signal to send] [options] process selection criteria
Example: skill -KILL -v pts/*

The default signal is TERM. Use -l or -L to list available signals.
Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0.
Alternate signals may be specified in three ways: -SIGKILL -KILL -9

General options:
-f  fast mode            This is not currently useful.
-i  interactive use      You will be asked to approve each action.
-v  verbose output       Display information about selected processes.
-w  warnings enabled     This is not currently useful.
-n  no action            This only displays the process ID.

Selection criteria can be: terminal, user, pid, command.
The options below may be used to ensure correct interpretation.
-t  The next argument is a terminal (tty or pty).
-u  The next argument is a username.
-p  The next argument is a process ID number.
-c  The next argument is a command name.
$skill -l
HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT
CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH POLL PWR SYS
$ps aux | grep xine
jeffrin   2844  2.9  1.4 661236 29460 pts/3    Sl   20:44   0:00 xine
jeffrin   2866  0.0  0.0 112944   816 pts/1    S+   20:44   0:00 grep xine
$skill 2844
$ps aux | grep xine
jeffrin   2869  0.0  0.0 112944   820 pts/1    S+   20:44   0:00 grep xine
$

UNIX Explanation
The default  signal for  skill is TERM.  Use -l or  -L to
list  available  signals.   Particularly  useful  signals
include  HUP, INT,  KILL, STOP,  CONT, and  0.  Alternate
signals  may  be specified  in  three  ways: -9  -SIGKILL
-KILL.

parameter tcp_retries1

A UNIX Parameter
$cat /proc/sys/net/ipv4/tcp_retries1
3
$echo 4 > /proc/sys/net/ipv4/tcp_r

Parameter Definition
This value influences the  time, after which TCP decides,
that  something  is   wrong  due  to  unacknowledged  RTO
retransmissions,  and  reports   this  suspicion  to  the
network   layer.   RFC   1122  recommends   at   least  3
retransmissions, which is the default.

Parameter Code Internals


snippet 1
{
.procname = "tcp_retries1",
.data = &sysctl_tcp_retries1,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra2 = &tcp_retr1_max
},

snippet 2
if (retransmits_timed_out(sk, sysctl_tcp_retries1, 0, 0)) {
/* Black hole detection */
tcp_mtu_probing(icsk, sk);

dst_negative_advice(sk);
}


Related From Research Paper
In this paper we have investigated TCP behavior in a 802.11b wireless Infrastructure network by means of experiments in a wireless network testbed. We have compared results obtained with similar experiments done in NS2 simulator. We conclude that TCP ACK skipping indeed improves TCP performance in real-life wireless LANs. Although the original goal was to explore the simultaneous-send problem reported in [1], several other insights were also obtained. The NS2 simulations showed the simultaneous-send problem manifest when MAC retries were disabled. However we were unable to reproduce the NO MAC retries case. Unlike in the NS2 simulator, various status indicators cannot be tracked in real experimentation. Instead the simultaneous-send phenomenon was observed using standalone network sniffers.
source: Experimental Evaluation of the TCP Simultaneous-Send Problem in 802.11 Wireless Local Area Networks Sumathi Gopal WINLAB, Rutgers University 73, Brett Road Piscataway, NJ 08854-8048 001 609 720 1202 sumathi@winlab.rutgers.edu Dipankar Raychaudhuri WINLAB, Rutgers University 73, Brett Road Piscataway, NJ 08854-8048 001 732 445 0877 ray@winlab.rutgers.edu

hcitool – configure Bluetooth connections

A UNIX Command
$hcitool
hcitool - HCI Tool ver 4.89
Usage:
	hcitool [options]  [command parameters]
Options:
	--help	Display help
	-i dev	HCI device
Commands:
	dev 	Display local devices
	inq 	Inquire remote devices
	scan	Scan for remote devices
	name	Get name from remote device
	info	Get information from remote device
	spinq	Start periodic inquiry
	epinq	Exit periodic inquiry
	cmd 	Submit arbitrary HCI commands
	con 	Display active connections
	cc  	Create connection to remote device
	dc  	Disconnect from remote device
	sr  	Switch master/slave role
	cpt 	Change connection packet type
	rssi	Display connection RSSI
	lq  	Display link quality
	tpl 	Display transmit power level
	afh 	Display AFH channel map
	lp  	Set/display link policy settings
	lst 	Set/display link supervision timeout
	auth	Request authentication
	enc 	Set connection encryption
	key 	Change connection link key
	clkoff	Read clock offset
	clock	Read local or remote clock
	lescan	Start LE scan
	lecc	Create a LE Connection
	ledc	Disconnect a LE Connection

For more information on the usage of each command use:
	hcitool  --help

UNIX Explanation
hcitool  is used to  configure Bluetooth  connections and
send  some special  command to  Bluetooth devices.  If no
command is  given, or if  the option -h is  used, hcitool
prints some usage information and exits.

basename – strip directory and suffix from filenames

A UNIX Command
$basename
basename: missing operand
Try `basename --help' for more information.
$basename /usr/bin/
bin
$basename /usr/
usr
$
$basename /usr/bin/less
less
$basename /usr/include/ma
malloc.h  math.h
$basename /usr/include/math.h
math.h
$basename /usr/include/math.h .
math.h
$basename /usr/include/math.h .h
math
$basename /usr/lib/libgccpp.so.1
libgccpp.so.1
$basename /usr/lib/libgccpp.so.1 .1
libgccpp.so
$

UNIX Explanation
`basename' removes any leading directory components from NAME.
Synopsis:

     basename NAME [SUFFIX]

If SUFFIX  is specified  and is identical  to the  end of
NAME, it is  removed from NAME as well.   Note that since
trailing  slashes are removed  prior to  suffix matching,
SUFFIX   will  do   nothing  if   it   contains  slashes.
`basename' prints the result on standard output.

Together, `basename' and `dirname' are designed such that
if `ls  "$name"' succeeds, then the  command sequence `cd
"$(dirname  "$name")";  ls  "$(basename "$name")"'  will,
too.   This  works   for  everything  except  file  names
containing a trailing newline.

POSIX allows the implementation  to define the results if
NAME  is  empty  or   `//'.   In  the  former  case,  GNU
`basename' returns the empty string.  In the latter case,
the result is `//' on platforms where // is distinct from
/, and `/' on platforms where there is no difference.


grog – guess options for groff command

A UNIX Command
$groff /usr/share/man/man7/pipe.7 | more
%!PS-Adobe-3.0
%%Creator: groff version 1.21
%%CreationDate: Fri Jul 15 18:18:46 2011
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
%%DocumentSuppliedResources: procset grops 1.21 0
%%Pages: 1
%%PageOrder: Ascend
%%DocumentMedia: Default 595 842 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.21 0
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{

$grog /usr/share/man/man7/pipe.7 | more
groff -man /usr/share/man/man7/pipe.7 
$groff -man /usr/share/man/man7/pipe.7 | more
%!PS-Adobe-3.0
%%Creator: groff version 1.21
%%CreationDate: Fri Jul 15 18:22:07 2011
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
%%DocumentSuppliedResources: procset grops 1.21 0
%%Pages: 2
%%PageOrder: Ascend
%%DocumentMedia: Default 595 842 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.21 0
%!PS-Adobe-3.0 Resource-ProcSet

UNIX Explanation
grog reads  the input (file names or  standard input) and
guesses  which  of the  groff(1)  options  are needed  to
perform   the  input   with  the   groff   program.   The
corresponding groff command is outp

gold – The GNU ELF linker

In software engineering, gold is a linker for ELF files. It became an official GNU package and
was added to binutils in March 2008[1] [2] and first released in binutils version 2.19. gold
was developed by Ian Lance Taylor and a small team at Google.[3] The motivation for writing
gold was to make a linker that is faster than the GNU linker,[3] especially for large
applications coded in C++. 

[bash]
$gcc -fuse-ld=gold hello.c
$./a.out
hello world
$./a.out
hello world
$./a.out
hello world
$./a.out
hello world
$time ./a.out
hello world

real 0m0.002s
user 0m0.002s
sys 0m0.001s
$gcc hello.c
$time ./a.out
hello world

real 0m0.002s
user 0m0.000s
sys 0m0.002s
$gcc -fuse-ld=gol hello.c
gcc: error: unrecognized command line option ‘-fuse-ld=gol’; did you mean ‘-fuse-ld=gold’?
$

[/bash]
LINKS
https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
https://stackoverflow.com/questions/3476093/replacing-ld-with-gold-any-experience
https://en.wikipedia.org/wiki/Gold_(linker)