GCC COMMANDLINE OPTIONS PART 3

commandline session $cat main.c #include<stdio.h> int main(void) { int i; printf(“n The Geek Stuff [%d]n”, i); return 0; } $gcc -C main.c $ls -l main main main.c main.i main.s $ls -l main. main.c main.i main.s $ls -l main. ls: cannot access main.: No such file or directory $rm main $rm a.out $gcc -C main.c $ls …

lspci -vmm . Dump PCI device data in a machine readable form for easy parsing by scripts

commandline session $lspci -vmm Slot: 00:00.0 Class: RAM memory Vendor: NVIDIA Corporation Device: MCP61 Memory Controller SVendor: Giga-byte Technology SDevice: Device 5001 Rev: a1 Slot: 00:01.0 Class: ISA bridge Vendor: NVIDIA Corporation Device: MCP61 LPC Bridge SVendor: Giga-byte Technology SDevice: Device 0c11 Rev: a2 Slot: 00:01.1 Class: SMBus Vendor: NVIDIA Corporation Device: MCP61 SMBus SVendor: …

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 …