Monthly Archives: January 2012

stat – display file or file system status

UNIX Command

$stat /usr/sbin/famd
  File: `/usr/sbin/famd'
  Size: 147504    	Blocks: 304        IO Block: 4096   regular file
Device: 801h/2049d	Inode: 7572257     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-01-24 00:00:54.000000000 +0530
Modify: 2010-08-03 15:32:44.000000000 +0530
Change: 2012-01-24 00:00:07.000000000 +0530
 Birth: -
$

UNIX Explanation

 Display file or file system status.

/etc/dpkg/dpkg.cfg

File

$ls -l /etc/dpkg/dpkg.cfg
-rw-r--r-- 1 root root 446 Sep 14  2010 /etc/dpkg/dpkg.cfg
$

Explanation

$file /etc/dpkg/dpkg.cfg
/etc/dpkg/dpkg.cfg: ASCII English text
$

Get The Hang

$cat /etc/dpkg/dpkg.cfg
# dpkg configuration file
#
# This file can contain default options for dpkg.  All command-line
# options are allowed.  Values can be specified by putting them after
# the option, separated by whitespace and/or an `=' sign.
#

# Do not enable debsig-verify by default; since the distribution is not using
# embedded signatures, debsig-verify would reject all packages.
no-debsig

# Log status changes and actions to a file.
log /var/log/dpkg.log
$

NTP Network Time Protocol

TOPIC

NETWORK TIME PROTOCOL

Explanation

NTP  stands  for Network  Time  Protocol,  and  it is  an  Internet
protocol used to  synchronize the clocks of computers  to some time
reference.  NTP   is  an  Internet   standard  protocol  originally
developed  by  Professor  David  L.  Mills  at  the  University  of
Delaware.

source: http://www.ntp.org/ntpfaq/NTP-s-def.htm#AEN1259

Get The Hang

$ntpdate in.pool.ntp.org
13 Jan 19:15:49 ntpdate[4295]: step time server 203.200.188.4 offset -1.325297 sec
$date
Fri Jan 13 19:16:01 IST 2012
$

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
>

sysctl interface

TOPIC

General Linux System Control Interface

Explanation

Sysctl is a  means of configuring certain aspects  of the kernel at
run-time, and the  /proc/sys/ directory is there so  that you don't
even need special tools to do it!

In  fact, there are  only four  things needed  to use  these config
facilities:


- a running Linux system
- root access
- common sense (this is especially hard to come by these days)
- knowledge of what all those values mean

Get The Hang

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#

$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
$