Scheme

$scm
SCM version 5e5, Copyright (C) 1990-2006 Free Software Foundation.
SCM comes with ABSOLUTELY NO WARRANTY; for details type `(terms)'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `(terms)' for details.
;loading /usr/share/slib/require
;done loading /usr/share/slib/require.scm
;loading /usr/share/slib/require
;done loading /usr/share/slib/require.scm
;loading /usr/lib/scm/Link
;done loading /usr/lib/scm/Link.scm
;loading /usr/lib/scm/Transcen
;done loading /usr/lib/scm/Transcen.scm
> (+ 1 2 3)
6
> (- ( + 3 4) (- 4 5 ))
#
> 7
> -1
>
;WARNING: "/usr/lib/scm/Iedline.scm": unexpected ")"#
> (- ( + 3 4) (- 4 5 ))
8
>

What is sysctl in some Unix-like Operating systems ?

ABOUT sysctl

sysctl is a software utility of some Unix-like operating systems that reads and modifies the attributes of the system kernel such as its version number, maximum limits, and security settings. It is available both as a system call for compiled programs, and an administrator command for interactive use and scripting. Linux additionally exposes sysctl as a virtual file system.

RELATED SHELL EXPOSURE
[bash]
$pwd
/proc/sys/kernel
$cat hung_task_timeout_secs
120
$sudo sysctl kernel.hung_task_timeout_secs 121
[sudo] password for jeffrin:
kernel.hung_task_timeout_secs = 120
sysctl: cannot stat /proc/sys/121: No such file or directory
$sudo sysctl kernel.hung_task_timeout_secs="121"
kernel.hung_task_timeout_secs = 121
$cat hung_task_timeout_secs
121
$sudo sysctl kernel.hung_task_timeout_secs="120"
kernel.hung_task_timeout_secs = 120
$cat hung_task_timeout_secs
120
$

[/bash]

[bash collapse=”true”]
root@debian:~# cd /proc/sys
root@debian:/proc/sys# grep . kernel/*
kernel/acct:4 2 30
kernel/acpi_video_flags:0
kernel/auto_msgmni:1
kernel/blk_iopoll:1
kernel/bootloader_type:114
kernel/bootloader_version:2
kernel/cad_pid:1
kernel/compat-log:1
kernel/core_pattern:core
kernel/core_pipe_limit:0
kernel/core_uses_pid:0
kernel/ctrl-alt-del:0
kernel/dmesg_restrict:0
kernel/domainname:(none)
kernel/ftrace_dump_on_oops:0
kernel/hostname:debian
kernel/hung_task_check_count:4194304
kernel/hung_task_panic:0
kernel/hung_task_timeout_secs:120
kernel/hung_task_warnings:10
kernel/io_delay_type:0
grep: kernel/keys: Invalid argument
kernel/kptr_restrict:0
kernel/kstack_depth_to_print:12
kernel/max_lock_depth:1024
kernel/modprobe:/sbin/modprobe
kernel/modules_disabled:0
kernel/msgmax:8192
kernel/msgmnb:16384
kernel/msgmni:3893
kernel/ngroups_max:100536
kernel/nmi_watchdog:1
kernel/osrelease:3.1.0-1-amd64
kernel/ostype:Linux
kernel/overflowgid:100534
kernel/overflowuid:100534
kernel/panic:0
kernel/panic_on_io_nmi:0
kernel/panic_on_oops:0
kernel/panic_on_unrecovered_nmi:0
kernel/perf_event_max_sample_rate:100000
kernel/perf_event_mlock_kb:516
kernel/perf_event_paranoid:1
kernel/pid_max:32768
kernel/poweroff_cmd:/sbin/poweroff
kernel/print-fatal-signals:0
kernel/printk:4 4 1 7
kernel/printk_delay:0
kernel/printk_ratelimit:5
kernel/printk_ratelimit_burst:10
grep: kernel/pty: Invalid argument
grep: kernel/random: Invalid argument
kernel/randomize_va_space:2
kernel/real-root-dev:0
kernel/sched_autogroup_enabled:0
kernel/sched_child_runs_first:0
grep: kernel/sched_domain: Invalid argument
kernel/sched_latency_ns:6000000
kernel/sched_migration_cost:500000
kernel/sched_min_granularity_ns:750000
kernel/sched_nr_migrate:32
kernel/sched_rt_period_us:1000000
kernel/sched_rt_runtime_us:950000
kernel/sched_shares_window:10000000
kernel/sched_time_avg:1000
kernel/sched_tunable_scaling:1
kernel/sched_wakeup_granularity_ns:1000000
kernel/sem:250 32000 32 128
kernel/shmall:2097152
kernel/shmmax:33554432
kernel/shmmni:4096
kernel/shm_rmid_forced:0
kernel/softlockup_panic:0
kernel/sysrq:438
kernel/tainted:4097
kernel/threads-max:30982
kernel/timer_migration:1
kernel/unknown_nmi_panic:0
grep: kernel/usermodehelper: Invalid argument
kernel/version:#1 SMP Fri Dec 23 16:37:11 UTC 2011
kernel/watchdog:1
kernel/watchdog_thresh:10
root@debian:/proc/sys#

[/bash]

RELATED LINKS
https://en.wikipedia.org/wiki/Sysctl
http://man7.org/linux/man-pages/man8/sysctl.8.html
https://www.linuxjournal.com/article/2365
https://dl.acm.org/citation.cfm?id=326974
https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt

$convmv -t ascii Y_WD.mp3

$convmv -t ascii Y_WD.mp3
Your Perl version has fleas #37757 #49830
Starting a dry run without changes...
No changes to your files done. Use --notest to finally rename the files.
$convmv -t symbol Y_WD.mp3
Your Perl version has fleas #37757 #49830
Starting a dry run without changes...
symbol doesn't cover all needed characters for: "./Y_WD.mp3"
To prevent damage to your files, we won't continue.
First fix errors or correct options!
$convmv -t ascii Y_WD.mp3
Your Perl version has fleas #37757 #49830
Starting a dry run without changes...
No changes to your files done. Use --notest to finally rename the files.
$convmv --notest -t ascii Y_WD.mp3
Your Perl version has fleas #37757 #49830
Ready!
$

Related Link.
http://en.wikipedia.org/wiki/Character_encoding

$sudo iwatch -c "uname -r" -e all_events /etc/

jeffrin@debian:~$ mplayer romeo_must_die_.ogg
$sudo iwatch -c "uname -r"  -e all_events  /etc/
.
.
.
.
[ 8/Jan/2012 17:19:11] IN_OPEN /etc//locale.alias
[ 8/Jan/2012 17:19:11] * Command: uname -r
3.1.0-1-amd64
[ 8/Jan/2012 17:19:11] IN_ACCESS /etc//locale.alias
[ 8/Jan/2012 17:19:11] * Command: uname -r
3.1.0-1-amd64
[ 8/Jan/2012 17:19:11] IN_CLOSE_NOWRITE /etc//locale.alias
[ 8/Jan/2012 17:19:11] * Command: uname -r
3.1.0-1-amd64
[ 8/Jan/2012 17:19:11] IN_OPEN /etc//ld.so.cache
[ 8/Jan/2012 17:19:11] * Command: uname -r
3.1.0-1-amd64
[ 8/Jan/2012 17:19:11] IN_CLOSE_NOWRITE /etc//ld.so.cache
[ 8/Jan/2012 17:19:11] * Command: uname -r
3.1.0-1-amd64

$sudo iwatch -e all_events /usr/lib/

$sudo iwatch -e all_events  /usr/lib/
[ 7/Jan/2012 19:00:25] IN_OPEN /usr/lib//libmagic.so.1.0.0
[ 7/Jan/2012 19:00:25] IN_ACCESS /usr/lib//libmagic.so.1.0.0
[ 7/Jan/2012 19:00:25] IN_OPEN /usr/lib//libz.so.1.2.3.4
[ 7/Jan/2012 19:00:25] IN_ACCESS /usr/lib//libz.so.1.2.3.4
[ 7/Jan/2012 19:00:25] IN_CLOSE_NOWRITE /usr/lib//libz.so.1.2.3.4
[ 7/Jan/2012 19:00:25] IN_CLOSE_NOWRITE /usr/lib//libmagic.so.1.0.0

 

jeffrin@debian:~$ file hello-world.asp
hello-world.asp: HTML document, ASCII text
jeffrin@debian:~$

Related Link.
http://en.wikipedia.org/wiki/Inotify

/etc/localtime .

File

$ls -l /etc/localtime
-rw-r--r-- 1 root root 2100 Jan  5 21:49 /etc/localtime
$

Explanation

$file /etc/localtime
/etc/localtime: timezone data, version 2, 4 gmt time flags, 4 std time flags, no leap seconds, 4 transition times, 4 abbreviation chars
$

Get The Hang

$hexdump /etc/localtime
0000000 5a54 6669 0032 0000 0000 0000 0000 0000
0000010 0000 0000 0000 0400 0000 0400 0000 0000
0000020 0000 0400 0000 0400 0000 0d00 dbca b086
0000030 05cc 1871 95cc a832 74d2 9812 0201 0203
0000040 0000 d052 0000 0000 685b 0400 0000 584d
0000050 0900 0000 685b 0901 4d48 0054 5542 5452
0000060 4900 5453 0000 0000 0000 0000 5400 695a
0000070 3266 0000 0000 0000 0000 0000 0000 0000
0000080 0000 0000 0005 0000 0005 0000 0000 0000
0000090 0005 0000 0005 0000 ff11 ffff 56ff 91b6
00000a0 ff28 ffff caff 86db ffb0 ffff ccff 7105
00000b0 ff18 ffff ccff 3295 ffa8 ffff d2ff 1274
00000c0 0198 0302 0304 0000 d852 0000 0000 d052
00000d0 0400 0000 685b 0800 0000 584d 0d00 0000
00000e0 685b 0d01 4d4c 0054 4d48 0054 5542 5452
00000f0 4900 5453 0000 0000 0000 0000 0000 0a00
0000100 5349 2d54 3a35 3033 000a
0000109
$

file command Ver 0.0001

UNIX Command

$file vmlinuz-3.1.0-1-amd64
vmlinuz-3.1.0-1-amd64: Linux kernel x86 boot executable bzImage, version 3.1.0-1-amd64 (unknown@Debian) #1 SMP Tue Nov 29 13:47:12 UTC 2, RO-rootFS, swap_dev 0x2, Normal VGA
$

UNIX Explanation

file tests each  argument in an attempt to  classify it.  There are
three  sets of tests,  performed in  this order:  filesystem tests,
magic  tests, and  language tests.   The first  test  that succeeds
causes the file type to be printed.

Theory Drop . magic number

A constant numerical  or text value used to  identify a file format
or protocol.

source : http://en.wikipedia.org/wiki/Magic_number_(programming)

Tools

1. GNU core utilities
http://savannah.gnu.org/projects/coreutils
2. Miscellaneous system utilities
http://userweb.kernel.org/~kzak/util-linux/
3. utilities for making and checking MS-DOS FAT filesystems
http://www.daniel-baumann.ch/software/dosfstools/
4. Undelete utility for the ext2 file system
http://e2undel.sourceforge.net
5. utilities for manipulating files in an ext2/ext3 filesystem
http://home.earthlink.net/~k_sheff/sw/e2tools/index.html
6. Determines file type using “magic” numbers
http://www.darwinsys.com/file/
7. filesystem activity monitoring tool
http://mytty.org/fspy
8. realtime filesystem monitoring program using inotify
http://iwatch.sourceforge.net/
9. Utilities for manipulating filesystem extended attributes
http://savannah.nongnu.org/projects/attr/
10. filename encoding conversion tool
http://www.j3e.de/linux/convmv/
11. Tool to help recover deleted files on ext3 filesystems
http://code.google.com/p/ext3grep/
12. The GNU Image Manipulation Program
http://www.gimp.org
13. A Scheme language interpreter
http://groups.csail.mit.edu/mac/ftpdir/scm/scm-5e7.zip
14. MPlayer’s Movie Encoder
http://www.mplayerhq.hu/
15. audio/video encoder, streaming server & audio/video file converter
http://ffmpeg.mplayerhq.hu/
16. Interactive Colorful IP LAN Monitor
http://iptraf.seul.org/
17. An utility for Directing compilation.
http://www.gnu.org/software/make/
18. GNU C compiler
http://gcc.gnu.org/
19. command-line network traffic analyzer
http://www.tcpdump.org/
20. interactive processes viewer
http://htop.sourceforge.net
21. FAT16/FAT32 filesystem resizer
http://sf.net/projects/fatresize
22. Guess PC disk partition table, find lost partitions
http://home.pages.de/~michab/gpart/
23. File Alteration Monitor
http://oss.sgi.com/projects/fam/
24. command-line utility that reports when files have been altered
http://fileschanged.sourceforge.net/

ls ( -L option )

UNIX Command

$ls -l vmlinuz
lrwxrwxrwx 1 root root 26 Dec  1 02:44 vmlinuz -> boot/vmlinuz-3.1.0-1-amd64
$ls -lL vmlinuz
-rw-r--r-- 1 root root 2725680 Nov 29 19:49 vmlinuz
$

 

UNIX Explanation

 -L, --dereference
when showing file information for a symbolic link, show information for the file the link references rather than for the link itself.

 

Theory Drop

In  computing, a symbolic  link (also  symlink or  soft link)  is a
special type of  file that contains a reference  to another file or
directory  in the form  of an  absolute or  relative path  and that
affects pathname resolution.[1] Symbolic links were already present
by  1978  in mini-computer  operating  systems  from  DEC and  Data
General's   RDOS.   Today  they   are   supported   by  the   POSIX
operating-system standard, most Unix-like operating systems such as
FreeBSD,  GNU/Linux,  and Mac  OS  X,  and  also Windows  operating
systems  such as Windows  Vista, Windows  7 and  to some  degree in
Windows 2000 and Windows  XP.  Symbolic links operate transparently
for most operations: programs which read or write to files named by
a symbolic link will behave  as if operating directly on the target
file.  However,  programs  that   need  to  handle  symbolic  links
specially (e.g., backup utilities) may identify and manipulate them
directly.

source : http://en.wikipedia.org/wiki/Symbolic_link

stackable filesystems . Wrapfs filesystem .

Classroom.

Wrapfs  is  a   full-fledged  stackable  null-layer  (or  loopback)
filesystem   that  simply   passes  all   operations   and  objects
(unmodified)  between  the VFS  and  the  lower filesystem.  Wrapfs
itself, however, is  not easy to write for one  main reason; it has
to  treat  the  lower filesystem  as  if  it  were the  VFS,  while
appearing to the  real Linux VFS as a  lower-level filesystem. This
dual  role requires  careful handling  of locks,  reference counts,
allocated  memory and  so on.  Luckily, someone  already  wrote and
maintains Wrapfs. Therefore, Wrapfs serves as an excellent template
for you to modify and add new functionality.

source : http://www.linuxjournal.com/article/6485

Get The Hang

int wrapfs_unlink(struct inode *dir,
                  struct dentry *dentry)
{
  int err = 0;
  struct inode *lower_dir;
  struct dentry *lower_dentry;
  lower_dir = get_lower_inode(dir);
  lower_dentry = get_lower_dentry(dentry);
  /* pre-call code can go here */
  err = lower_dir->i_op->unlink(lower_dir,
                                lower_dentry);
  /* post-call code can go here */
  return err;
}

source : http://www.linuxjournal.com/article/6485