# HG changeset patch # User Oleksandr Gavenko # Date 1274962719 -10800 # Node ID 8bfad2e06bb66f9776c36979f1849bd180c56096 # Parent 9d19ef0d482a357e370828d789430d628cea81c5# Parent a60329166dcb7063ef9a412207d37b8543307418 merged diff -r a60329166dcb -r 8bfad2e06bb6 audio.rst --- a/audio.rst Thu May 20 12:08:03 2010 +0300 +++ b/audio.rst Thu May 27 15:18:39 2010 +0300 @@ -23,3 +23,17 @@ $ sox in.mp3 out.ogg $ sox in.ogg out.wav ... etc + +* How convert flac to mp3? + + $ flac -c -d $file.flac | lame -m j -q 0 -V 0 -s 44.1 - $file.mp3 + +* How convert wma to mp3? + + $ mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader $file.wma + $ lame -m s audiodump.wav -o "$file.mp3 + $ rm audiodump.wav + +* How convert m4a to mp3? + + $ faad -o - $file.m4a | lame -V 0 - $file.mp3 diff -r a60329166dcb -r 8bfad2e06bb6 color.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/color.rst Thu May 27 15:18:39 2010 +0300 @@ -0,0 +1,8 @@ +-*- mode: outline; coding: utf-8 -*- + +* Color naming schemas. + + http://en.wikipedia.org/wiki/Web_colors + http://en.wikipedia.org/wiki/X11_color_names + + diff -r a60329166dcb -r 8bfad2e06bb6 display.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/display.rst Thu May 27 15:18:39 2010 +0300 @@ -0,0 +1,11 @@ +-*- mode: outline; coding: utf-8 -*- + +* Resolution. + + 19" 4:3 SXGA 1280х1024 + 20" 4:3 UXGA 1600x1200 + 21" 4:3 UXGA 1600x1200 + 22" 16:10 WUXGA 1920x1200 + 24" 16:10 WUXGA 1920x1200 + 26" 16:10 WUXGA 1920x1200 + 30" 16:10 WQXGA 2560x1600 diff -r a60329166dcb -r 8bfad2e06bb6 signal.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/signal.rst Thu May 27 15:18:39 2010 +0300 @@ -0,0 +1,279 @@ +-*- mode: outline; coding: utf-8 -*- + +* Send signal to process. + + $ kill -s NAME PID + +Under C you can use kill(2) system call which will send the specified signal +to the process, if permissions allow, or raise(3) library function, which +sends the specified signal to the current process. + +* List of signals. + + $ kill --list + $ kill -l # short variant + +See + + http://en.wikipedia.org/wiki/Unix_signals + +** SIGHUP 1. + +Hangup. Type: notification, can be handled. + +Sent when assigned to process terminal closed. + +nohup(1) utility used as a wrapper to start a program and make it immune to +SIGHUP. + +The default action on POSIX-compliant systems is an abnormal termination. + +Demon used this signal as commant to reread config file. + +** SIGINT 2 + +Interrupt. Ctrl-C. Type: control, can be handled. + +Signal sent to a process by its controlling terminal when a user wishes to +interrupt the process. + +By default, this causes the process to terminate. + +** SIGQUIT 3. + +Quit. Ctrl-\. Type: control. + +Signal sent to a process by its controlling terminal when the user requests +that the process dump core. + +By default, this causes the process to terminate and produce a memory core dump. + +** SIGILL 4. + +Illegal instruction. Type: exception, can not be handled. + +Signal sent to a process when it attempts to execute a malformed, unknown, or +privileged instruction. + +** SIGTRAP 5. + +Trace trap. Type: debug, can be handled. + +Signal sent to a process when a condition arises that a debugger has requested +to be informed of. + +By default this causes abnormal termination of the process. + +** SIGABRT 6. + +Type: control, can be handled. + +Signal sent to a computer program to tell it to abort, ie terminate. + +SIGABRT is sent by the process to itself when it calls the abort libc +function. It is used when an assertion fails. + +By default this causes abnormal termination of the process. + +** SIGEMT 7. + +Emt instruction. + +** SIGFPE 8. + +Floating point exception. Type: exception, can be handled. + +Signal sent to a process when it performs an erroneous arithmetic operation +(like division by zero). + +By default cause a core dump and a program exit. + +** SIGKILL 9. + +Kill. Type: control, can not be handled. + +Signal sent to a process to cause it to terminate immediately. + +Zombie processes cannot be killed since they are already dead and waiting for +their parent processes to reap them. + +Processes that are in the blocked state will not die until they wake up again. + +** SIGBUS 10. + +Bus error. Type: exception, can not be handled. + +Signal sent to a process when it causes a bus error. + +By default this causes abnormal termination of the process. + +** SIGSEGV 11. + +Segmentation violation. Type: exception. + +Signal sent to a process when it makes an invalid memory reference, or +segmentation fault. + +By default cause a core dump and a program exit. + +** SIGSYS 12. + +Bad argument to system call. Type: exception. + +By default this causes abnormal termination of the process. + +** SIGPIPE 13. + +Write on a pipe with no one to read it. Type: notification. + +Signal sent to a process when it attempts to write to a pipe without a process +connected to the other end. + +This causes the process to terminate, which is convenient when constructing +shell pipelines. + +** SIGALRM 14. + +Alarm clock. Type: notification. + +Signal sent to a process when a time limit has elapsed. + +By default this causes abnormal termination of the process. + +** SIGTERM 15. + +Software termination signal. Type: control. + +Signal sent to a process to request its termination. + +It causes the termination of a process, but unlike the SIGKILL signal, it can +be caught and interpreted (or ignored) by the process. + +SIGTERM is akin to asking a process to terminate nicely, allowing cleanup and +closure of files. For this reason, on many Unix systems during shutdown, init +issues SIGTERM to all processes that are not essential to powering off, waits +a few seconds, and then issues SIGKILL to forcibly terminate any such +processes that remain. + +By default kill(1) send to process SIGTERM signal. + +** SIGURG 16. + +Urgent condition on IO channel. Type: notification. + +By default this signal ignored. + +** SIGSTOP 17. + +Signal sent to a process to stop it for later resumption. Type: control. + +SIGSTOP cannot be caught or ignored. + +Usually SIGSTOP and SIGCONT are used for job control in the Unix shell. + +** SIGTSTP 18. + +Stop signal from tty. Ctrl-Z. Type: control. + +By default, this causes the process to suspend execution. + +** SIGCONT 19. + +Continue a stopped process. Type: control. + +Signal sent to restart a process previously paused by the SIGSTOP or SIGTSTP +signal. + +** SIGCHLD 20. + +To parent on child stop or exit. Type: notification. + +By default the signal is simply ignored. In C: + + signal(SIGCHLD, SIG_IGN); + +Parent can invoke wait(1) otherwise children stay zombie. + +** SIGTTIN 21. + +Signal sent to a process when it attempts to read from the tty while in the +background. + +Daemons do not have controlling terminals and should never receive this +signal. + +By default this causes suspends of the process. + +** SIGTTOU 22. + +Signal sent to a process when it attempts to write to the tty while in the +background. + +Daemons do not have controlling terminals and should never receive this +signal. + +By default this causes suspends of the process. + +** SIGPOLL 23. + +System V name for SIGIO. Type: notification. + +Signal sent to a process when an asynchronous I/O event occurs. + +By default this causes abnormal termination of the process. + +** SIGXCPU 24. + +Exceeded CPU time limit. Type: notification. + +By default this causes abnormal termination of the process. + +** SIGXFSZ 25. + +Exceeded file size limit as determined by the ulimit system call and shell +builtin. Type: notification. + +By default this causes abnormal termination of the process. + +** SIGVTALRM 26. + +Virtual time alarm. Type: notification. + +Signal sent to a process when a time limit has elapsed. + +By default this causes abnormal termination of the process. + +** SIGPROF 27. + +Profiling time alarm. Type: debug. + +Signal sent to a process when the profiling timer expires. + +By default this causes abnormal termination of the process. + +** SIGWINCH 28. + +Window changed. Type: notification. + +Signal sent to a process when its controlling terminal changes size. + +By default this signal ignored. + +** SIGLOST 29. + +Signal sent to process when a file lock is lost. This may occur, for example, +when an NFS server reboots and forgets about a file lock. + +By default this causes abnormal termination of the process. + +** SIGUSR1 30. + +User defined signal 1. Type: user defined. + +By default this causes abnormal termination of the process. + +** SIGUSR2 31. + +User defined signal 2. Type: user defined. + +By default this causes abnormal termination of the process. diff -r a60329166dcb -r 8bfad2e06bb6 svn.rst --- a/svn.rst Thu May 20 12:08:03 2010 +0300 +++ b/svn.rst Thu May 27 15:18:39 2010 +0300 @@ -24,3 +24,68 @@ Write in '$HOME/.subversion/config' interactive-conflicts = no + +* Creating svn repo. + + $ mkdir -p /srv/svn + $ svnadmin create /srv/svn/$repo + $ svn co file:///srv/svn/$repo $repo + $ cd /tmp/$repo + $ mkdir trunk branches features tags + $ svn add * + $ svn st # check all OK + $ svn ci -m "Init repo." + +For multi-project repo do follow: + + $ mkdir -p /srv/svn + $ svnadmin create /srv/svn/$repo + $ svn co file:///srv/svn/$repo $repo + $ cd /tmp/$repo + $ for proj in $proj1 $proj2; do mkdir $proj/trunk $proj/branches $proj/features $proj/tags; done + $ svn add * + $ svn st # check all OK + $ svn ci -m "Init repo." + +* Run local svn server. + + $ svnserve.exe -d --pid-file=svnserve.pid --root=/srv/svn/proj # default port: 3690 + $ svn ls svn://localhost # check all OK + $ kill -l + +* Undo bad commit. + + $ emacs FILE +... + $ svn ci -m "Introduce first bug." +Sending trunk/FILE +Transmitting file data . +Committed revision 7. + $ emacs FILE +... + $ svn ci -m "Make a lot of good changes." +... +Committed revision 8. +... + $ emacs FILE +... + $ svn ci -m "Introduce second bug." +... +Committed revision 10. + $ emacs FILE +... + $ svn ci -m "Make a lot of good changes." +... + +Now you understand that revision 7 and 10 buggy. You decide revert changes: + + $ svn merge -r 7:6 -r 10:9 FILE + $ svn ci -m "Reverted revision 7 and 10." + +For one changeset revert you can use shortly syntax: + + $ svn merge -c -7 -c -10 FILE + +Also you can use long diapason: + + $ svn merge -r 10:6 FILE diff -r a60329166dcb -r 8bfad2e06bb6 video-file.rst --- a/video-file.rst Thu May 20 12:08:03 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ --*- outline -*- - -* Players for linux? - - $ sudo apt-get install vlc -or - $ sudo apt-get install mplayer - -* How convert .3gp to .avi(mpeg)? - -First install convertor: - - $ sudo apt-get install ffmpeg - -Then do: - - $ ffmpeg -i test.3gp -f mpegvideo -ar 44100 -ac 1 -acodec mp3 test.mpg - - $ for i in `ls -1 *.3gp | cut -d. -f1`; do ffmpeg -y -i $i.3gp -sameq -f mpegvideo -s cif -r 25 -ar 32000 -ac 1 mpegs/$i.mpg; done - - $ ffmpeg -i video-in.3gp -b 250 -s 160×120 -r 15 -f avi -an video-out.avi -or - $ mencoder -oac mp3lame -ovc lavc -o video-out.avi -vf pp,2xsai,scale video-in.3gp -or - $ mencoder -o video-in.avi -vf pp,2xsai,scale -ovc lavc video-out.3gp -or - $ mencoder -o video-in.avi -vf rotate=2 -oac pcm -ovc divx4 video-out.3gp - - -You need to compile FFmpeg with AMR support (--enable-amr_nb ---enable-amr_wb) - -AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204 -V5.1.0 from -http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip -and extracted the source to libavcodec/amrwb_float - - -AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104 -REL-5 V5.1.0 from -http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip -and extracted the source to libavcodec/amr_float -and if u try this on an alpha, u may need to change Word32 to int in -amr/typedef.h diff -r a60329166dcb -r 8bfad2e06bb6 video.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/video.rst Thu May 27 15:18:39 2010 +0300 @@ -0,0 +1,44 @@ +-*- outline -*- + +* Players for linux? + + $ sudo apt-get install vlc +or + $ sudo apt-get install mplayer + +* How convert .3gp to .avi(mpeg)? + +First install convertor: + + $ sudo apt-get install ffmpeg + +Then do: + + $ ffmpeg -i test.3gp -f mpegvideo -ar 44100 -ac 1 -acodec mp3 test.mpg + + $ for i in `ls -1 *.3gp | cut -d. -f1`; do ffmpeg -y -i $i.3gp -sameq -f mpegvideo -s cif -r 25 -ar 32000 -ac 1 mpegs/$i.mpg; done + + $ ffmpeg -i video-in.3gp -b 250 -s 160×120 -r 15 -f avi -an video-out.avi +or + $ mencoder -oac mp3lame -ovc lavc -o video-out.avi -vf pp,2xsai,scale video-in.3gp +or + $ mencoder -o video-in.avi -vf pp,2xsai,scale -ovc lavc video-out.3gp +or + $ mencoder -o video-in.avi -vf rotate=2 -oac pcm -ovc divx4 video-out.3gp + + +You need to compile FFmpeg with AMR support (--enable-amr_nb +--enable-amr_wb) + +AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204 +V5.1.0 from +http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip +and extracted the source to libavcodec/amrwb_float + + +AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104 +REL-5 V5.1.0 from +http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip +and extracted the source to libavcodec/amr_float +and if u try this on an alpha, u may need to change Word32 to int in +amr/typedef.h diff -r a60329166dcb -r 8bfad2e06bb6 wget.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wget.rst Thu May 27 15:18:39 2010 +0300 @@ -0,0 +1,28 @@ +-*- mode: outline; coding: utf-8 -*- + +* Get server response header. + + $ wget --server-response http://example.com + $ wget -S http://example.com # short variant + +* View cookies from site. + + $ wget --save-cookies FILE -O - http://google.com >/dev/null + +* Send cookies to site. + + $ wget --load-cookies FILE http://google.com + +* Send specific header line. + + $ wget --header='Accept-Charset: iso-8859-2' --header='Accept-Language: hr' http://fly.srk.fer.hr/ + +* Send POST request. + +Log in to the server. This can be done only once. + + $ wget --save-cookies cookies.txt --post-data 'user=foo&password=bar' http://server.com/auth.php + +Now grab the page or pages we care about. + + $ wget --load-cookies cookies.txt -p http://server.com/interesting/article.php diff -r a60329166dcb -r 8bfad2e06bb6 x.rst --- a/x.rst Thu May 20 12:08:03 2010 +0300 +++ b/x.rst Thu May 27 15:18:39 2010 +0300 @@ -20,25 +20,23 @@ The syntax of an Xdefaults file is as follows: - name.Class.resource: value + [client. | *][{restriction.} | *]resource: value - name + client The name of the application, some program allow change it by - '-name' option. - class - The classification used to group resources together. The names - of classes conventionally start with an upper-case letter. + '-name' option. This element is optional (can be substituated + with wildcard). + restriction + + Class names or name of specific class instance. The classes + names conventionally start with an upper-case letter. + resource The name of the resource whose value is to be changed. Resources are typically lowercase with uppercase concatenation. value - The actual value of the resource. This can be 1 of 3 types: - * Integer (whole numbers). - * Boolean (true/false, yes/no, on/off). - * String, for example word (white), color (#ffffff), font - (-*-fixed-bold-r-*-*-*-100-*-*-*-*-iso8859-1 ) or path - (/usr/bin/firefox). + The actual value of the resource. delimiters A period (.) is used to signify each step down into the hierarchy. A colon (:) is used to separate the resource @@ -56,6 +54,57 @@ $ xrdb -merge ~/.Xdefaults +** Example. + + *foreground: yellow + XClock*foreground: pink + Xman*topBox*foreground: blue + +** Value types. + +*** String. + +This can be path specification like '/usr/bin/firefox'. + +*** Colors. + +For color names see '/usr/lib/X11/rgb.txt'. Also you can use hex +representation #ffffff. + +*** Font. + +You can use either a full name, a wildcarded specification, or a font alias. + + XTerm*Font: -adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1 + XTerm*Font: *courier-bold-r*140* + XTerm*Font: 7x14 + +*** Geometry. + + XCalc*geometry: 120x120-0-0 + XClock*geometry: -50+100 + +*** Cursor names. + +Cursor resources require the name of the file in /usr/include/X11/bitmaps that +contains the cursor you want to use. + + ScoTerm*pointerShape: gumby + +*** Pixmaps. + +Pixmaps are patterns, like bitmaps, that are used to texture or color an area +on your display. Pixmap resources are specified like cursors or bitmaps. + +*** Numebers. + + XLogo*borderWidth: 10 + +*** Boolean. + +Some resources require a boolean value, such as 'true' or 'false', 'yes' or +'no', or 'on' or 'off'. + ** Wildcard matching. The asterisk can be used as a wildcard, making it easy to write a single rule diff -r a60329166dcb -r 8bfad2e06bb6 xml.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml.rst Thu May 27 15:18:39 2010 +0300 @@ -0,0 +1,11 @@ +-*- mode: outline; coding: utf-8 -*- + +* relaxng. + +** relaxng-mode. + + http://www.pantor.com/download.html + RNC Emacs Mode (home page) + http://www.emacswiki.org/emacs/RELAX_NG + http://www.relaxng.org/compact-tutorial-20030326.html + relaxng compact syntax tutorial