merged
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 20 Nov 2011 23:18:56 +0200
changeset 1093 aa9974c8abeb
parent 1091 675d518897ed (diff)
parent 1092 639665016a27 (current diff)
child 1094 8e7349819364
child 1116 140ed8e4da7f
merged
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bash.rst	Sun Nov 20 23:18:56 2011 +0200
@@ -0,0 +1,55 @@
+.. -*- coding: utf-8; -*-
+
+=======
+ Bash.
+=======
+
+How override PS1, PS2?
+======================
+
+When loading bash read ~/.bash_profile and ~/.bashrc.
+
+Put at end of these files::
+
+  PS1='\u@\H$ '
+
+When xterm start bash - it start as non-login. So ~/.bash_profile and ~/.bashrc
+didn't read. To workaround this use::
+
+  $ xterm -e bash -i -c "mc -x"
+
+That make bash interactive and init file was readed.
+
+Command history.
+================
+
+Bash allow accessing to command that you type previously. There are several
+options to control command history behavior. Set corresponding variables in
+your ~/.bashrc file (which is read by interactive shell)::
+
+  #   ignorespace do not save lines that start with space
+  #   erasedups all previous lines matching the current line to be removed from
+  #             the history list before that line is saved
+  export HISTCONTROL=igrorespace:erasedups
+  export HISTIGNORE=" ?cd *":"e *":"sudo mv *":"sudo rm *":"sudo cp *":"sudo mkdir *":"sudo chmod *":"sudo chown *":ls:pwd:"vlc*"
+
+There are another options, with default values (which satisfy my needs, so
+I don't put they to ~/.bashrc)::
+
+  export HISTFILE=~/.bash_history  # where is command history stored
+  export HISTFILESIZE=500          # how many lines been in $HISTFILE
+  export HISTSIZE=500              # how many lines been stored in bash process
+
+mc (GNU Midnight Commander).
+----------------------------
+
+You can also set special history rules for mc subshell in ~/.mc/bashrc file.
+
+Bash history.
+=============
+
+  http://wiki.bash-hackers.org/scripting/bashchanges
+                This article is an incomplete overview of changes to Bash over
+                the time.
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp.rst	Sun Nov 20 23:18:56 2011 +0200
@@ -0,0 +1,56 @@
+.. -*- coding: utf-8; -*-
+
+=======================
+ cpp (C preprocessor).
+=======================
+
+How to see macros expansion?
+============================
+
+GCC::
+
+  $ cpp <file>.c
+
+MSVC::
+
+  $ cl /E <file>.c
+
+Who to see predefined macros?
+=============================
+
+See:
+
+  http://predef.sourceforge.net/
+  http://en.wikipedia.org/wiki/C_preprocessor#Compiler-specific_predefined_macros
+  http://msdn.microsoft.com/en-us/library/b0084kay.aspx
+                Predefined Macros
+
+GNU C Compiler::
+
+  $ gcc -dM -E - < /dev/null
+
+HP-UX ansi C compiler::
+
+  $ cc -v EMPTY.c
+
+SCO OpenServer C compiler::
+
+  $ cc -## EMPTY.c
+
+Sun Studio C/C++ compiler::
+
+  $ cc -## EMPTY.c
+
+IBM AIX XL C/C++ compiler::
+
+  $ cc -qshowmacros -E EMPTY.c
+
+For Visual Studio compiler there no any possibility get predefined macros from
+command line... But some macros documented:
+
+  _MSC_VER
+                Defines the compiler version. Always defined.
+  _WIN32
+                Defined for applications for Win32. Always defined.
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/html.rst	Sun Nov 20 23:18:56 2011 +0200
@@ -0,0 +1,37 @@
+.. -*- coding: utf-8 -*-
+
+=======
+ HTML.
+=======
+
+Page encoding.
+==============
+
+Place in HEAD tag (CHARSET is one among of defined by
+http://www.iana.org/assignments/character-sets)::
+
+  <meta http-equiv="Content-Type" content="text/html; charset=CHARSET">
+
+See:
+
+  http://www.w3.org/TR/REC-html40/charset.html#h-5.2.2
+
+Center an object.
+=================
+
+To center blog-level element::
+
+  <div style="margin-left: auto; margin-right: auto;">
+    <div>SOME</div>
+  </div>
+
+To center inline element::
+
+  <p style="text-align: center;">TEXT</p>
+
+Browser support.
+================
+
+  * http://htmlbook.ru/
+  * http://www.quirksmode.org/
+