GCC COMMANDLINE OPTIONS PART 2

commandline session $gcc -S main.c > main.s $cat main.s .file “main.c” .section .rodata .LC0: .string “n The Geek Stuff [%d]n” .text .globl main .type main, @function main: .LFB0: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 subq $16, %rsp movl -4(%rbp), %eax movl %eax, %esi movl $.LC0, %edi movl $0, …

GCC COMMANDLINE OPTIONS PART 1

commandline session $cat main.c #include<stdio.h> int main(void) { printf(“n The Geek Stuffn”); return 0; } $gcc main.c $./a.out The Geek Stuff $gcc main.c -o main $./main The Geek Stuff $gcc -Wall main.c -o main $./main The Geek Stuff $cat main.c #include<stdio.h> int main(void) { int i; printf(“n The Geek Stuff [%d]n”, i); return 0; } …

FREE COMMAND WITH DIFFERENT UNITS

commandline session $free -b total used free shared buffers cached Mem: 2043490304 1840762880 202727424 0 37040128 823631872 -/+ buffers/cache: 980090880 1063399424 Swap: 5984219136 15114240 5969104896 $free -k total used free shared buffers cached Mem: 1995596 1795388 200208 0 36196 804388 -/+ buffers/cache: 954804 1040792 Swap: 5843964 14760 5829204 $free -m total used free shared buffers …

DEBIAN xrandr The X Resize, Rotate and Reflect Extension (RandR)

$xrandr | grep connected VGA-0 connected 1024×768+0+0 (normal left inverted right x axis y axis) 340mm x 270mm $xrandr –output VGA-0 –brightness 1 $xrandr –output VGA-0 –brightness 0.5 $ Theory Drop The X Resize, Rotate and Reflect Extension (RandR)[2] is an X Window System extension, which allows clients to dynamically change X screens, so as …

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  …