UNIT TESTING trueprint

commandline session $ls acconfig.h bootstrap config.cache config.log configure.in INSTALL Makefile.in replace stamp-h1.in aclocal.m4 ChangeLog config.h config.status COPYING Makefile NEWS src stamp-h2.in AUTHORS config config.h.in configure doc Makefile.am README stamp-h tests $make check Makefile:122: warning: overriding commands for target `config.h’ Makefile:103: warning: ignoring old commands for target `config.h’ Makefile:132: warning: overriding commands for target `config.h.in’ Makefile:113: …

TEE . read from standard input and write to standard output and files

commandline session $stat version.c File: `version.c’ Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: 801h/2049d Inode: 5415089 Links: 1 Access: (0644/-rw-r–r–) Uid: ( 1000/ jeffrin) Gid: ( 1000/ jeffrin) Access: 2013-01-07 19:05:13.000000000 +0530 Modify: 2013-01-07 21:55:50.000000000 +0530 Change: 2013-01-07 21:55:50.000000000 +0530 Birth: – $stat version.c | tee newversion.c File: `version.c’ Size: 0 …

TCPDUMP . PRINT LESS PROTOCOL INFORMATION . OUTPUT LINES SHORTER

$sudo /usr/sbin/tcpdump -q tcpdump: WARNING: eth0: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 100535 bytes ^C 0 packets captured 0 packets received by filter 0 packets dropped by kernel $sudo /usr/sbin/tcpdump -q -i wlan0 tcpdump: verbose output suppressed, …

UPGRADE A PACKAGE AND IT'S DEPENDENCIES USING APT-GET

root@debian:~# apt-get install $(apt-cache depends gnome-session | grep Depends | sed “s/.*ends: //” | tr ‘n’ ‘ ‘) Reading package lists… Done Building dependency tree Reading state information… Done gnome-session-bin is already the newest version. gnome-session-bin set to manually installed. gnome-session-common is already the newest version. gnome-session-common set to manually installed. The following extra packages …

GDB BACKTRACE GOOGLE CHROME SEGFAULT

$gdb /opt/google/chrome/google-chrome core GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type “show copying” and “show warranty” for details. This GDB was …

google chrome HANGUP .BACKTRACE

commandline session (gdb) bt #0  0x00007fd461dbeac3 in *__GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=100) at ../sysdeps/unix/sysv/linux/poll.c:87 #1  0x00007fd46643f4d4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #2  0x00007fd46643f5f4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #3  0x00007fd468940c00 in ?? () #4  0x00007fd468918832 in ?? () #5  0x00007fd4686349ff in ?? () #6  0x00007fd46a2e8811 in ?? () #7  0x00007fd46a2ea31d in ?? () #8  …

regular expression — PHP

commandline session <?php $text = “Hello World”; if ( preg_match( “/r.*?d/”, $text, $array ) ) { print “<pre>n”; print_r( $array ); print “</pre>n”; } ?> note: preg_match — Perform a regular expression match source : www.phpcode.net OUTPUT $ 4.2.36 13 513—> php rep.php PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20100525/suhosin.so’ – /usr/lib/php5/20100525/suhosin.so: …

SEARCH AND REPLACE USING SED

commandline session $ 4.2.36 13 513—> cat math.html <html> <body> <msup> <mfenced> <mi>a</mi> <mo>+</mo> <mi>b</mi> </mfenced> <mn>2</mn> </msup> </body> </html> $ 4.2.36 14 514—> $ sed “s/html/HTML/g” math.html > math-new.html bash: $: command not found $ 4.2.36 15 515—> sed “s/html/HTML/g” math.html > math-new.html $ 4.2.36 16 516—> cat math-new.html <HTML> <body> <msup> <mfenced> <mi>a</mi> …