-
In "gcc," to show all of the macros that are defined for a given platform:
gcc -dM -E test.c
-
In "gas," to show macro expansion listings
gas foo.s -ahlm
-
to spy on officemates:
/usr/sbin/tcpdump -X -s 0 src ip_address | more
-
to spy on net connections machines or processes: nmap or netstat -anp
-
In "emacs," to enable conservative indentation, add this to your .emacs
files
add-hook 'c++-mode-hook
(function (lambda ()
(c-set-style "k&r")
(setq c-basic-offset 2)
)))
for more information, look at
"/usr/uns/share/emacs/19.34/lisp/cc-mode.el"
- In emacs, to show last typed commands: C-h l
-
In "gcc," stringification :
#define WARN_IF(EXP) \
do { if (EXP) \
fprintf (stderr, "Warning:
" #EXP "\n"); }
while (0)
-
In "emacs," to create a macro :
Ctrl-X "(" keys Ctrl-X
")"
Ctrl-X "(" keys Ctrl-X
")"
-
In "emacs," to run the macro :
Ctrl-X e
Ctrl-X e
-
In "emacs," to create a .emacs entry corresponding to a key sequence :
see emacs faq, #116
see emacs faq, #116
-
In "make," to run a command without having it barf on error :
rule:
rule:
-mkdir
blah -mkdir
blah
-
In "gmake," fancy automatic variables.
%.s: %.S
$(RGCC) -E $< -o $@
%.lnk: %.o
$(GEO) link 0 16 0 $^ libarch.a
-o $@
-
To use CVS over ssh:
setenv CVS_RSH ssh
alias cvs cvs -d :ext:user_name@host:cvsroot_path
-
When your terminal gets fucked because you tried to print out binary
stuff, type "reset"
-
ps, so that more does not get screwed up: ps -www -aux | more
- To capture screen in X.
xwd > blah.