# HG changeset patch # User Oleksandr Gavenko <gavenkoa@gmail.com> # Date 1411146264 -10800 # Node ID c2e5c5c9aebe8f390b63857bc341dae57fedf851 # Parent 41ef0417d899882de9a4261846edc41d8ab21a18# Parent 797a3ba1f9b559aad887e3a869b769bd26535e24 merged diff -r 41ef0417d899 -r c2e5c5c9aebe android.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/android.rst Fri Sep 19 20:04:24 2014 +0300 @@ -0,0 +1,119 @@ + +========== + Android. +========== +.. contents:: + +Official docs. +============== + + http://developer.android.com/sdk/index.html + Get the Android SDK + http://developer.android.com/guide/index.html + Introduction to Android + https://android.googlesource.com/platform/system/core/+/master/init/readme.txt + init.rd file syntax. + +Show screencast from Android. +============================= + + http://droid-at-screen.ribomation.com/ + Easily show the screen of an Android device on a computer/laptop + (PC, Mac, Linux, ...) and then project the desktop using a + LCD-projector. + +Controlling Android from PC. +============================ + + * http://code.google.com/p/androidscreencast/ + * http://code.google.com/p/android-screen-monitor/ + * http://androidwebkey.com/ + +Mods. +===== + + http://xda-university.com/ + How to mod. + http://www.cyanogenmod.org/about + CyanogenMod + https://www.clockworkmod.com/ + ClockworkMod + +Recovery. +========= + +To enter phone to recovery mode press ``VolumeDown``+``Power`` button or:: + + adb reboot recovery + +See: + + http://teamw.in/project/twrp2 + Custom recovery built. + +ADB tips. +========= + +List available devices:: + + $ adb devices + +Install application from ``.apk`` file:: + + $ adb install -r /path/to/application.apk + +List installed package names (with path to ``.apk`` files!):: + + $ adb shell 'pm list packages -f' + +Uninstall application by it name:: + + $ adb uninstall PACKAGE_NAME + +List currently run activities:: + + $ adb shell 'dumpsys activity' + +Find activities from package:: + + $ adb shell 'pm list packages -f' + $ adb pull APK_FROM_LIST + $ aapt dump badging APK_FILE + +Start an activity:: + + $ adb shell am start PACKAGE_NAME/ACTIVITY_IN_PACKAGE + $ adb shell am start PACKAGE_NAME/FULLY_QUALIFIED_ACTIVITY + +List of running processes:: + + $ adb shell ps + +or (supported arguments +``user,group,comm,args,pid,ppid,pgid,etime,nice,rgroup,ruser,time,tty,vsz,stat,rss``):: + + $ adb shell + % ps -o pid,user,group,rss,vsz,args + +To kill process:: + + $ adb shell ps | grep $REGEX + $ adb shell kill $PID + +Take a screenshort:: + + $ adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png + +Power button:: + + $ adb shell input keyevent 26 + +Unlock screen:: + + $ adb shell input keyevent 82 + +Show system log:: + + $ adb logcat + $ adb logcat "*:W" + diff -r 41ef0417d899 -r c2e5c5c9aebe ascii-art.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ascii-art.rst Fri Sep 19 20:04:24 2014 +0300 @@ -0,0 +1,39 @@ +.. -*- coding: utf-8; -*- +.. include:: HEADER.rst + +============ + ASCII art. +============ +.. contents:: + +Make ASCII logo. +================ + +``figlet``:: + + $ sudo apt-get install figlet + + $ figlet "Hello world" + $ figlet -f slant "Hello world" + +With spaces between letters:: + + $ figlet -k -f shadow "Hello world" + +``sysvbanner``:: + + $ sudo apt-get install sysvbanner + + $ banner Hello + +``cowsay``:: + + $ sudo apt-get install cowsay + + $ cowsay Hello + $ cowsay -f duck Hello + +To get list of available cow picture file:: + + $ cowsay -l + diff -r 41ef0417d899 -r c2e5c5c9aebe audio.rst --- a/audio.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/audio.rst Fri Sep 19 20:04:24 2014 +0300 @@ -31,6 +31,8 @@ $ arecord -l $ arecord -L + $ pactl list + Suitable convertors? ==================== :: diff -r 41ef0417d899 -r c2e5c5c9aebe browsers.rst --- a/browsers.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/browsers.rst Fri Sep 19 20:04:24 2014 +0300 @@ -33,4 +33,5 @@ http://arewefastyet.com/ Tracking performance of popular JavaScript engines. - + http://jsperf.com/ + JavaScript libraries performance. diff -r 41ef0417d899 -r c2e5c5c9aebe css.rst --- a/css.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/css.rst Fri Sep 19 20:04:24 2014 +0300 @@ -102,3 +102,30 @@ * http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28CSS%29 * http://www.css3.info/modules/selector-compat/ +CSS compilers. +============== + + http://lesscss.org/ + LESS extends CSS with dynamic behavior such as variables, + mixins, operations and functions. + http://sass-lang.com/ + Sass is the most mature, stable, and powerful professional grade + CSS extension language in the world. + +CSS frameworks. +=============== + + http://getbootstrap.com/ + Sleek, intuitive, and powerful mobile first front-end framework + for faster and easier web development. + http://bootswatch.com/ + Free themes for Bootstrap. + http://960.gs/ + Grid framework. + http://purecss.io/ + A set of small, responsive CSS modules that you can use in every + web project. + http://foundation.zurb.com/ + The most advanced responsive front-end framework in the world. + + diff -r 41ef0417d899 -r c2e5c5c9aebe debian-apt.rst --- a/debian-apt.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/debian-apt.rst Fri Sep 19 20:04:24 2014 +0300 @@ -122,3 +122,9 @@ $ sudo debsums --changed +Search for packages. +==================== +:: + + $ aptitude search '?tag(works-with::logfile)' + diff -r 41ef0417d899 -r c2e5c5c9aebe devel-proj-files.rst --- a/devel-proj-files.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/devel-proj-files.rst Fri Sep 19 20:04:24 2014 +0300 @@ -10,6 +10,7 @@ =================== * http://autotoolset.sourceforge.net/tutorial.html + * https://openide.netbeans.org/tutorial/questions.html Essential project files. ======================== diff -r 41ef0417d899 -r c2e5c5c9aebe display.rst --- a/display.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/display.rst Fri Sep 19 20:04:24 2014 +0300 @@ -17,6 +17,21 @@ 26" 16:10 WUXGA 1920x1200 30" 16:10 WQXGA 2560x1600 +Selecting display. +================== + + http://www.100fps.com/how_many_frames_can_humans_see.htm + How many frames per second can the human eye see? + http://www.tftcentral.co.uk/articles/panel_parts.htm + Panel Part Databases + http://www.tftcentral.co.uk/panelsearch.htm + Panel Search + +ICC Profiles. +============= + + * https://wiki.archlinux.org/index.php/ICC_Profiles + PC display modes. ================= diff -r 41ef0417d899 -r c2e5c5c9aebe firefox-devel.rst --- a/firefox-devel.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/firefox-devel.rst Fri Sep 19 20:04:24 2014 +0300 @@ -137,10 +137,6 @@ Same but with different coloring do 'console.debug', 'console.info', 'console.warn', and 'console.error' functions. -'console.log' can format strings in the great tradition of printf. - -'console.trace()' - to print trace. - http://getfirebug.com/logging logging http://getfirebug.com/wiki/index.php/Console_API diff -r 41ef0417d899 -r c2e5c5c9aebe firefox.rst --- a/firefox.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/firefox.rst Fri Sep 19 20:04:24 2014 +0300 @@ -70,6 +70,15 @@ Path=Profiles/xxxxxxx.default Default=1 +Change user agent. +================== + +:: + + general.useragent.override + +For Debian Icewasel just remove ``Icewasel`` from user agent string. + How to prevent links from opening a new window? =============================================== @@ -482,9 +491,11 @@ Allows you to customize the way a webpage displays using small bits of JavaScript. http://www.greasespot.net - home page + Home page. https://addons.mozilla.org/firefox/748 - download page + Download page. + https://greasyfork.org/scripts/1317-download-youtube-videos-as-mp4 + Download YouTube Videos as MP4. How to disable GZIP compression in Firefox? =========================================== @@ -505,3 +516,26 @@ At URI type some thing like "javascript: 4+5" +Disable safe browsing. +====================== +:: + + user_pref("browser.safebrowsing.enabled", false); + user_pref("browser.safebrowsing.malware.enabled", false); + user_pref("services.sync.prefs.sync.browser.safebrowsing.enabled", false); + user_pref("services.sync.prefs.sync.browser.safebrowsing.malware.enabled;false", false); + +Disable geo location. +===================== +:: + + user_pref("geo.enabled", false); + +You can fake your location by JSON like:: + + {"location":{"latitude":48.861426,2.338929,"longitude":2.338929, "accuracy":20.0}} + +in file pointed by:: + + user_pref("geo.wifi.uri", "file:///home/user/fake-geo.json"); + diff -r 41ef0417d899 -r c2e5c5c9aebe fvwm.rst --- a/fvwm.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/fvwm.rst Fri Sep 19 20:04:24 2014 +0300 @@ -47,3 +47,10 @@ See http://fvwm-themes.sourceforge.net/ + +FVWM configs. +============= + + http://home.gna.org/fvwm-crystal/features.html + Usable for ideas how to do things. + diff -r 41ef0417d899 -r c2e5c5c9aebe html.rst --- a/html.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/html.rst Fri Sep 19 20:04:24 2014 +0300 @@ -20,6 +20,10 @@ <meta http-equiv="Content-Type" content="text/html; charset=CHARSET"> +or in HTML 5:: + + <meta charset="utf-8"> + See: http://www.w3.org/TR/REC-html40/charset.html#h-5.2.2 diff -r 41ef0417d899 -r c2e5c5c9aebe image.rst --- a/image.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/image.rst Fri Sep 19 20:04:24 2014 +0300 @@ -6,19 +6,22 @@ ======== .. contents:: +Viewers. +======== + GraphicsMagick. -=============== +--------------- GraphicsMagick command-line utilities to create, edit, or convert images. ImageMagick. -============ +------------ ImageMagick - is a free software suite for the creation, modification and display of bitmap images. gthumb. -======= +------- gThumb is an advanced image viewer and browser. It has many useful features, such as filesystem browsing, slide show, image catalogs, web album creation, @@ -30,3 +33,16 @@ http://openclipart.org/ home page + +Join icons to sprite. +===================== + +Make one liner:: + + $ convert *.png -append sprites.png # vertically + $ convert *.png +append sprites.png # horizontally + +Make box:: + + $ montage -background transparent --geometry 16x16 *.png sprites.png + diff -r 41ef0417d899 -r c2e5c5c9aebe java.rst --- a/java.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/java.rst Fri Sep 19 20:04:24 2014 +0300 @@ -212,3 +212,8 @@ How to Reference and Use JSTL in your Web Application http://en.wikipedia.org/wiki/Java_EE_version_history Java EE version history + +Java interactive shell. +======================= + +Just use Groovy. ``bsh`` is older alternative without code completion. diff -r 41ef0417d899 -r c2e5c5c9aebe js.rst --- a/js.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/js.rst Fri Sep 19 20:04:24 2014 +0300 @@ -9,11 +9,12 @@ HTML. ===== -<noscript> tag used to render HTML if JavaScript disabled in browser. +``<noscript>`` tag used to render HTML if JavaScript disabled in browser. Including JavaScript in HTML page. ================================== -:: + +In ``head``:: <html> <head> @@ -22,6 +23,14 @@ ... <html> +or alternatively just before closing ``body``:: + + <script src="abc.js"></script> + </body> + <html> + +**NOTE** ``type="text/javascript"`` no longer necessary. + Inlining JavaScript in HTML code. ================================= :: @@ -69,17 +78,35 @@ List of versions per browser. http://en.wikipedia.org/wiki/ECMAScript#Version_correspondence List of versions. - http://kangax.github.com/es5-compat-table/ + http://kangax.github.io/compat-table/es5/ ECMAScript 5 compatibility table. + http://kangax.github.io/compat-table/es6/ + ECMAScript 6 compatibility table. + http://kangax.github.io/compat-table/es7/ + ECMAScript 7 compatibility table. http://caniuse.com/use-strict Can I use ECMAScript 5 Strict Mode? Pretty print from JavaScript. ============================= +:: + + console.debug("%o", obj); + +Logging in JS. +============== To Web Developer console (Firefox/Chrome):: - console.debug ("%o", obj); + console.log("str"); + console.info("str is %s", "str"); + console.warn("this is %o", this); + console.error("int: %i, float: %f, string: %s, object: %o", 2, .333, "str", this); + +To see stack-trace use:: + + console.trace(); + console.log(new Error().stack); // only FF XML from JavaScript. ==================== diff -r 41ef0417d899 -r c2e5c5c9aebe lang-comp.rst --- a/lang-comp.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/lang-comp.rst Fri Sep 19 20:04:24 2014 +0300 @@ -23,14 +23,14 @@ Google trends (history of search request count). http://stackoverflow.com/questions/48997/what-programming-language-is-most-popular-today what-programming-language-is-most-popular-today - http://www.koders.com/ - Search code by lang/licence. -shootout.alioth.debian.org. -=========================== +Performance. +============ http://shootout.alioth.debian.org/ The Computer Language Benchmarks Game + http://www.techempower.com/benchmarks/ + Web Framework Performance Comparison ohloh. ====== @@ -42,8 +42,14 @@ http://www.ohloh.net/languages/compare User selected. +Code examples. +============== + + http://c2.com/cgi/wiki?EveryCombinationInManyProgrammingLanguages + Every Combination In Many Programming Languages + 99 bottles of beer. -=================== +------------------- * Many implementation of one simple task. @@ -51,7 +57,7 @@ Home page. Rosetta Code. -============= +------------- * Solutions to the same task (near 600) in as many different languages as possible. diff -r 41ef0417d899 -r c2e5c5c9aebe linux-wifi.rst --- a/linux-wifi.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/linux-wifi.rst Fri Sep 19 20:04:24 2014 +0300 @@ -11,8 +11,10 @@ :: $ /sbin/iwconfig + $ sudo iwlist wlan0 scanning http://wiki.debian.org/iwconfig - Debian wiki. + Debian wiki. + http://en.wikipedia.org/wiki/Wireless_tools_for_Linux + Wireless tools for Linux. - diff -r 41ef0417d899 -r c2e5c5c9aebe linux.rst --- a/linux.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/linux.rst Fri Sep 19 20:04:24 2014 +0300 @@ -39,3 +39,10 @@ http://www.kernel.org/doc/Documentation/sysrq.txt Linux Magic System Request Key Hacks + +Comunity. +========= + + http://kernelnewbies.org/ + Linux Kernel Newbies + diff -r 41ef0417d899 -r c2e5c5c9aebe maven.rst --- a/maven.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/maven.rst Fri Sep 19 20:04:24 2014 +0300 @@ -22,6 +22,11 @@ * http://maven.apache.org/plugins/ +Maven config location. +====================== + +``~/.m2/settings.xml``. + Generate simple project. ======================== :: @@ -52,7 +57,7 @@ $ mvn dependency:tree -Dverbose=true -What actual code processed by Maven:: +What actual code processed by Maven (dump Maven config):: $ mvn help:effective-settings $ mvn help:effective-pom diff -r 41ef0417d899 -r c2e5c5c9aebe net.rst --- a/net.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/net.rst Fri Sep 19 20:04:24 2014 +0300 @@ -60,7 +60,7 @@ List of open ports under Linux. ------------------------------- --t tcp, -u udp, -l local, -p process:: +``-t`` tcp, ``-u`` udp, ``-l`` local, ``-p`` process:: $ sudo netstat -tulp diff -r 41ef0417d899 -r c2e5c5c9aebe oracle.rst --- a/oracle.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/oracle.rst Fri Sep 19 20:04:24 2014 +0300 @@ -146,3 +146,14 @@ select sysdate from dual; +Working with SQL/Plus. +====================== + +Show error details:: + + show errors; + +Dump how exactly field stored:: + + select dump(date '2009-08-07') from dual; + diff -r 41ef0417d899 -r c2e5c5c9aebe os.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os.rst Fri Sep 19 20:04:24 2014 +0300 @@ -0,0 +1,17 @@ +.. -*- coding: utf-8; -*- +.. include:: HEADER.rst + +=================== + Operation system. +=================== +.. contents:: + +OS Market Share on Desktop. +=========================== + + http://netmarketshare.com/ + Web-based statistic. + http://en.wikipedia.org/wiki/Usage_share_of_operating_systems + Wikipedia. + + diff -r 41ef0417d899 -r c2e5c5c9aebe process-managment.rst --- a/process-managment.rst Fri Sep 19 19:55:16 2014 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ --*- mode: outline; coding: utf-8; fill-column: 78 -*- - -* Process list. - -Warning! ps(1) may not fit column position. To overwrite this set COLUMNS -environment variable or use -w options (use 132 columns to display -information, if the -w option is specified more than once, ps will use as many -columns as necessary without regard for window size). - -** FreeBSD. - -View current user process: - - $ ps - -View all running process: - - $ ps -ax - -** Linux. - -View current user process: - - $ ps - -View all running process: - - $ ps -e - -** Solaris. - -TODO - -** Windows. - -*** Interactive. - - cmd> taskmgr - -*** Static. - - cmd> TaskList -Process Name PID Session Name #Session Memory -========================= ====== ================ ======== ============ -System Idle Process 0 Console 0 28 KB -System 4 Console 0 236 KB -smss.exe 592 Console 0 432 KB -csrss.exe 656 Console 0 4 404 KB -winlogon.exe 680 Console 0 2 792 KB -services.exe 724 Console 0 3 260 KB - -* Killing process. - -** Linux. - -TODO - - $ kill -s <SIGNAL> <pid> - -** Windows. - -TODO which version from which Windows version comes? - - cmd> tskill {<pid>|<name>} - - cmd> taskkill /IM notepad.exe - cmd> taskkill /PID 827 - -* Process info. - -Show user, pid, ppid, pgid, sid, jobc, state, time, command, etc. - -** Linux. - - $ ps -f <id> - -** FreeBSD. - - $ ps -j <id> - -or - - $ ps -l <id> - -* Run as another user. - -** Linux. - - $ su - <user> - $ <command> - -or - - $ sudo -u <user> -i <command> - -** Windows. - - $ runas /u: TODO XXX diff -r 41ef0417d899 -r c2e5c5c9aebe rst.css --- a/rst.css Fri Sep 19 19:55:16 2014 +0300 +++ b/rst.css Fri Sep 19 20:04:24 2014 +0300 @@ -22,3 +22,22 @@ } table { border-collapse:collapse; margin-left:auto; margin-right:auto; } table, tr, td { padding: 3px; border: 1px dotted maroon; background-color: cornsilk; } + +pre.code.keyword, pre.code.tag { + color: blue; +} +pre.code.string, pre.code.preproc { + color: green; +} +pre.code.name.decorator, pre.code.literal { + color: brown; +} +pre.code.comment { + color: magenta; +} +pre.code span.generic.prompt { + color: magenta; +} +pre.code span.generic.output { + color: gray; +} diff -r 41ef0417d899 -r c2e5c5c9aebe security.rst --- a/security.rst Fri Sep 19 19:55:16 2014 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ --*- mode: outline; coding: utf-8 -*- - -* Email encryption. - -* Digital document signing. - -* Security alerts. - - http://www.us-cert.gov/cas/techalerts/index.html - Technical Cyber Security Alerts provide timely information about current security - issues, vulnerabilities, and exploits. - http://www.cert.org/advisories/ - CERT/CC Advisories (1988 - 2004) - http://cve.mitre.org/cve/index.html - CVE® is a publicly available and free to use list or dictionary of standardized - identifiers for common computer vulnerabilities and exposures. - - diff -r 41ef0417d899 -r c2e5c5c9aebe selenium.rst --- a/selenium.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/selenium.rst Fri Sep 19 20:04:24 2014 +0300 @@ -4,7 +4,7 @@ =========== Selenium. =========== -.. content:: +.. contents:: Official docs. ============== @@ -14,7 +14,24 @@ http://docs.seleniumhq.org/docs/03_webdriver.jsp WebDriver https://code.google.com/p/selenium/w/list - Docs on Wiki. + Docs on Wiki about drivers and browser support. + +WebDriver. +---------- + + * http://code.google.com/p/selenium/wiki/FirefoxDriver + * http://code.google.com/p/selenium/wiki/InternetExplorerDriver + * http://code.google.com/p/selenium/wiki/ChromeDriver + * http://selendroid.io/mobileWeb.html - Android. + * http://code.google.com/p/selenium/wiki/OperaDriver + * http://htmlunit.sourceforge.net/ - HtmlUnit. + http://code.google.com/p/selenium/wiki/HtmlUnitDriver + +Tutorials. +========== + + http://selenium2.ru/docs.html + Russian translation of official docs. com.thoughtworks.selenium.Selenium locator syntax. ================================================== @@ -40,3 +57,17 @@ home page https://community.jboss.org/wiki/ArquillianGraphene2 wiki page + +Set language preferences. +========================= + +For FirefoxDriver:: + + FirefoxProfile profile = new FirefoxProfile(); + profile.setPreference( "intl.accept_languages", "no,en-us,en" ); + WebDriver driver = new FirefoxDriver(profile); + +See: + + * http://code.google.com/p/selenium/wiki/TipsAndTricks + diff -r 41ef0417d899 -r c2e5c5c9aebe signal.rst --- a/signal.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/signal.rst Fri Sep 19 20:04:24 2014 +0300 @@ -48,6 +48,8 @@ By default, this causes the process to terminate and produce a memory core dump. +Java dump thread traces to stdout. + ** SIGILL 4. Illegal instruction. Type: exception, can not be handled. diff -r 41ef0417d899 -r c2e5c5c9aebe ssh.rst --- a/ssh.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/ssh.rst Fri Sep 19 20:04:24 2014 +0300 @@ -30,6 +30,8 @@ $ ssh $user@$host cat ">>" "~/.ssh/authorized_keys" <~/.ssh/id_rsa.pub # public pub key on remote host + $ ssh-copy-id $user@$host # alternative to previous command + Shell login. ============ :: diff -r 41ef0417d899 -r c2e5c5c9aebe stat.rst --- a/stat.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/stat.rst Fri Sep 19 20:04:24 2014 +0300 @@ -6,6 +6,107 @@ ========================= .. contents:: +Process list. +============= + +Linux. +------ + +View current user process:: + + $ ps + +View all running process:: + + $ ps -e + +View process commands:: + + $ ps -e -o pid,cmd + +Show processes with same substring in command:: + + $ pgrep -f $SUBSTR + $ pgrep -l -f $SUBSTR + $ pgrep -a -f $SUBSTR + +View detail process info:: + + $ ps -f <id> + +Kill process:: + + $ kill -s $SIG $PID + +Kill processes with same name:: + + $ killall $NAME + +Kill processes with same substring in command:: + + $ pkill -f $SUBSTR + +View processes interactively:: + + $ htop + +Use ``-w`` option for wide output. Use this option twice for unlimited width. + +Run as another user:: + + $ su - $user + $ command + +or:: + + $ sudo -u <user> -i <command> + +FreeBSD. +-------- + +View current user process:: + + $ ps + +View all running process:: + + $ ps -ax + +View detail process info:: + + $ ps -j <id> + $ ps -l <id> + +Windows. +-------- + +View all running process:: + + cmd> TaskList + Process Name PID Session Name #Session Memory + ========================= ====== ================ ======== ============ + System Idle Process 0 Console 0 28 KB + System 4 Console 0 236 KB + smss.exe 592 Console 0 432 KB + csrss.exe 656 Console 0 4 404 KB + winlogon.exe 680 Console 0 2 792 KB + services.exe 724 Console 0 3 260 KB + +View processes interactively:: + + cmd> taskmgr + +Kill process (TODO with which Windows version come?):: + + cmd> tskill {<pid>|<name>} + + cmd> taskkill /IM notepad.exe + cmd> taskkill /PID 827 + +Run as another user:: + + $ runas /u: TODO XXX + CPU consumption. ================ @@ -14,6 +115,7 @@ :: $ top + $ dstat Try press 's' (strace), 'l' (lsof), 'F5' (tree view) in:: @@ -66,11 +168,12 @@ :: $ top + $ dstat Linux static. ------------- -Vitual and resident memory size:: +Vitual and resident memory size per process:: $ ps -eo vsz,rsz,pid,cmd --sort=vsz --width 3000 @@ -88,6 +191,24 @@ r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 0 936804 5460 34936 0 0 21 5 363 29 0 0 99 0 +System memory distribution:: + + $ cat /proc/meminfo + $ cat /proc/iomem + $ cat /proc/pagetypeinfo + $ cat /proc/buddyinfo + $ sudo cat /proc/slabinfo + $ sudo slabtop + +Shared memory segments:: + + $ ipcs -m -p + +Process memory map:: + + $ pmap -x $PID + $ pmap -XX $PID + FreeBSD interactive. -------------------- :: @@ -126,6 +247,28 @@ and add colums TODO. +Power usage. +============ +:: + + $ sudo powertop + +Network activity. +================= +:: + + $ ping $IP + $ traceroute $IP + $ mtr $IP + $ sudo bmon + $ sudo iftop -i wlan0 + +Open ports. +=========== +:: + + $ nmap $IP + Opened file by process. ======================= @@ -172,9 +315,19 @@ :: $ lsof -i[46][protocol][@{hostname|hostaddr}][:{service|port}] + $ netstat -p -l | grep $PORT -46 - IPV4 or IPV6 -protocol - tcp, udp +where ``[46]`` - IPV4 or IPV6, ``protocol`` - tcp, udp. + +:: + + $ fuser $port/tcp + +To kill precess by port number:: + + $ fuser -k $port/tcp # with SIGKILL + $ fuser -k -15 $port/tcp # with SIGTERM + $ fuser -k -TERM $port/tcp # with SIGTERM FreeBSD. -------- diff -r 41ef0417d899 -r c2e5c5c9aebe svn.rst --- a/svn.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/svn.rst Fri Sep 19 20:04:24 2014 +0300 @@ -63,7 +63,7 @@ ===================== :: - $ svnserve.exe -d --pid-file=svnserve.pid --root=/srv/svn/proj # default port: 3690 + $ svnserve -d --pid-file=svnserve.pid --root=/srv/svn/proj # default port: 3690 $ svn ls svn://localhost # check all OK $ kill -l @@ -102,7 +102,7 @@ $ svn merge -c -7 -c -10 FILE -Also you can use long diapason:: +Also you can use ranges:: $ svn merge -r 10:6 FILE diff -r 41ef0417d899 -r c2e5c5c9aebe udev.rst --- a/udev.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/udev.rst Fri Sep 19 20:04:24 2014 +0300 @@ -12,6 +12,15 @@ * http://reactivated.net/writing_udev_rules.html * http://wiki.debian.org/udev * https://wiki.archlinux.org/index.php/Udev + * http://wiki.gentoo.org/wiki/Udev + * http://www.crashcourse.ca/wiki/index.php/Udev + +Record udev events. +=================== + +This dump udev events to console:: + + $ sudo udevadm monitor View device capability with udev compatible format. =================================================== @@ -25,3 +34,10 @@ $ udevinfo -a -p $(udevinfo -q path -n /dev/sdc) +Debugging udev rule. +==================== +:: + + $ sudo udevadm trigger + $ sudo udevadm test $(udevadm info -n /dev/$DEV -q path) + diff -r 41ef0417d899 -r c2e5c5c9aebe video.rst --- a/video.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/video.rst Fri Sep 19 20:04:24 2014 +0300 @@ -61,7 +61,10 @@ Extract audio from video file. ============================== -:: + +``$NO`` - autio strean number:: + + $ ffmpeg -i $IN -c:a:$NO $OUT.mp3 $ mplayer -ao pcm:fast:file=audio.wav -vc null -vo null input.avi diff -r 41ef0417d899 -r c2e5c5c9aebe web-search.rst --- a/web-search.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/web-search.rst Fri Sep 19 20:04:24 2014 +0300 @@ -33,7 +33,6 @@ Image by image search. ====================== - * http://www.gazopa.com/ * http://images.google.com/ * http://www.tineye.com/ diff -r 41ef0417d899 -r c2e5c5c9aebe windows-devel.rst --- a/windows-devel.rst Fri Sep 19 19:55:16 2014 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,287 +0,0 @@ --*- mode: outline -*- - -* Dependency Walker. - -Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows -module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of -all dependent modules. For each module found, it lists all the functions that -are exported by that module, and which of those functions are actually being -called by other modules. Another view displays the minimum set of required -files, along with detailed information about each file including a full path -to the file, base address, version numbers, machine type, debug information, -and more. - -See - - http://www.dependencywalker.com/ - -* Windows 2000 Resource Kit Tools. - - http://support.microsoft.com/kb/927229 - Windows 2000 Resource Kit Tools for administrative tasks - -* Sysinternals. - -TODO - -* Application verifier. - - http://www.microsoft.com/downloads/en/details.aspx?familyid=c4a25ab9-649d-4a1b-b4a7-c9d8b095df18 - download page - http://msdn.microsoft.com/en-us/library/ms220948.aspx - Application Verifier - -* Debugging with windbg. - - http://www.microsoft.com/whdc/devtools/debugging/default.mspx - Download and Install Debugging Tools for Windows - http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx - Debugging Tools for Windows 32-bit Version - download page - http://www.microsoft.com/whdc/devtools/debugging/install64bit.mspx - Debugging Tools for Windows 64-bit Version - download page - -** Break on dll load/unload. - - sxe ld <module> - sxe ud <module> - -** Set breakpoint by pattern and/or on specific module. - - bm <module>!<name> # set breakpoints on 'module' with name 'name' - bm *!<prefix>* # set breakpoints on all names with prefix 'prefix' - bm <module>!* # set breakpoints on all names in module 'module' - -'bp', 'bm' commands sets software breakpoints, debugger replaces the processor instruction with a -break instruction. - -** Clear breakpoints. - - bc * - -** How to set WinDbg as a Default Windows Postmortem Debugger. - - cmd> WinDbg -I - -** How analyse crash. - -When program crash and use enter in WinDbg execute: - - !analyze -v - -** Adding symbols from Symbol Server. - -Execute in WinDbg: - - .sympath SRV*D:\srv\symcache*http://msdl.microsoft.com/download/symbols - -or Ctrl+S and add: - - SRV*D:\srv\symcache*http://msdl.microsoft.com/download/symbols - - http://support.microsoft.com/kb/311503 - Use the Microsoft Symbol Server to obtain debug symbol files - -** Using the SymChk.exe utility to download symbols. - - symchk /r c:\windows\system32 /s SRV*c:\symbols\*http://msdl.microsoft.com/download/symbols - -** Debugging child process. - - .childdbg 1 - -* Running at startup. - - HKCU\Software\Microsoft\Windows\CurrentVersion\Run - Launches a program automatically when a particular user logs - in. This key is used when you always want to launch a program - when a particular user is using a system. - HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce - Launches a program the next time the user logs in and removes - its value entry from the registry. This key is typically used - by installation programs. - HKLM\Software\Microsoft\Windows\CurrentVersion\Run - Launches a program automatically at system startup. This key - is used when you always want to launch a program on a - particular system. - HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce - Launches a program the next time the system starts and removes - its value entry from the registry. This key is typically used - by installation programs. - HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices - Launches a service (a standard NT service or a background - process) automatically at startup. An example of a service is - a Web server such as Microsoft Internet Information Server. - HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce - Launches a service (a standard NT service or a background - process) the next time the system is started, then removes its - value entry from the registry. - -Values to registry on Windows XP can be added by: - - cmd> reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v run.bat /t REG_SZ /d "path\to\run.bat" - cmd> reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Run <-- see what done - -* MFC. - -** Can I link to MFC statically. - -Yes. - - http://msdn.microsoft.com/en-us/library/f22wcbea%28VS.80%29.aspx - -* Microsoft Visual C++ Redistributable Package. - - http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displayLang=en - This package installs runtime components of C Runtime (CRT), - Standard C++, ATL, MFC, OpenMP and MSDIA libraries. - -* Cabinet file (.cab). - -Extract content from .cab file: - - cmd# expand my.cab - - http://support.microsoft.com/kb/198038 - INFO: Useful Tools for Package and Deployment Issues - http://msdn.microsoft.com/en-us/library/aa367841%28VS.85%29.aspx - The Makecab.exe utility is included in the Windows SDK - Components for Windows Installer Developers. - http://web.archive.org/web/20070403215326/http://download.microsoft.com/download/platformsdk/cab/2.0/w98nt42kmexp/en-us/cabsdk.exe - download link from web archive - http://msdn.microsoft.com/en-us/library/aa370834%28v=VS.85%29.aspx - The components of the Windows Installer Software Development - Kit are included in the Microsoft Windows Software Development - Kit (SDK). - http://msdn.microsoft.com/en-us/library/bb417343.aspx - Microsoft Cabinet Format - -* Internet Explorer. - -** Debugging. - -Install IE 8.0 and press 'F12' key. - - http://msdn.microsoft.com/library/dd565626.aspx - Developer Tools User Interface Reference - -* Microsoft technologies. - -** COM. - -The family of COM technologies includes COM+, Distributed COM (DCOM) and ActiveX� Controls. - - http://www.microsoft.com/com/default.mspx - home page - -** OLE. - -OLE (Object Linking and Embedding) allows embedding and linking to documents and other objects. - -OLE 1.0 released in 1990, OLE 2.0 released in 1993, in 1994 OLE custom controls (OCXs) were -introduced. - -OLE objects and containers are implemented on top of the Component Object Model. - -Next release after 2.0 introdused in 1996 and named as ActiveX. - - http://en.wikipedia.org/wiki/Object_Linking_and_Embedding - -** ActiveX. - -Faced with the complexity of OLE 2.0 and with poor support for COM in MFC, Microsoft rationalized -the specifications to make them simpler, and rebranded the technology as ActiveX in 1996. - - http://msdn.microsoft.com/en-us/library/aa751968.aspx - ActiveX Controls - http://en.wikipedia.org/wiki/ActiveX - -** ATL. - -The Active Template Library (ATL) is a set of template-based C++ classes developed by Microsoft, -intended to simplify the programming of Component Object Model (COM) objects. - - http://en.wikipedia.org/wiki/Active_Template_Library - -** MFC. - -MFC (Microsoft Foundation Classes) is a library that wraps portions of the Windows API in C++ -classes, including functionality that enables them to use a default application framework. Classes -are defined for many of the handle-managed Windows objects and also for predefined windows and -common controls. - -A lightweight alternative to MFC is the Windows Template Library (WTL). - - http://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library - http://ru.wikipedia.org/wiki/Microsoft_Foundation_Classes - -** WTL. - -WTL (Windows Template Library) is a free software, object-oriented C++ template library for Win32 -development. - -WTL provides support for implementing various user interface elements, to MDI, standard and common -controls, common dialogs, property sheets and pages, GDI objects, and other common UI elements, such -as scrollable windows, splitter windows, toolbars and command bars. - -Most of the WTL API is a mirror of the standard Win32 calls. - - http://sourceforge.net/projects/wtl - http://en.wikipedia.org/wiki/Windows_Template_Library - -* Windows style variable names. - - Prefix | Data type - ---------+----------------------------------------- - b | boolean - by | byte or unsigned char - c | char - cx / cy | short used as size - dw | DWORD, double word or unsigned long - fn | function - h | handle - i | int (integer) - l | Long - n | short int - p | a pointer variable containing the address of a variable - s | string - sz | ASCIIZ null-terminated string - w | WORD unsigned int - x, y | short used as coordinates - - PrefixCategory | Mean - ----------------+---------------- - CS | Class style - CW | Create window - DT | Draw text - IDC | Cursor ID - IDI | Icon ID - WM | Window message - WS | Window style - - Data type | Meaning - ----------+------------------------------------------------------------------- - FAR | Same as far. Identifies an address that originally used the - | segment:offset addressing schema. Now FAR simply identifies a - | (default) 32-bit address but may be omitted entirely in many cases. - | - PASCAL | Same as Pascal. The Pascal convention demanded by Windows - | defines the order in which arguments are found in the stack when - | passed as calling parameters. - | - WORD | Unsigned integer (16 bits) - | - UINT | Unsigned integer, same as WORD - | - DWORD | Double word, unsigned long int (32 bits) - | - LONG | Signed long integer (32 bits) - | - LPSTR | Long (far) pointer to character string - | - NEAR | Obsolete, previously identified an address value within a 16KB - | memory block. - - http://www.tenouk.com/cnotation.html - C/C++ NOTATION STORY diff -r 41ef0417d899 -r c2e5c5c9aebe windows.rst --- a/windows.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/windows.rst Fri Sep 19 20:04:24 2014 +0300 @@ -26,6 +26,12 @@ cmd> slmgr -dli +Windows history. +================ + + http://windows.microsoft.com/en-us/windows/history + A history of Windows + Windows update. =============== @@ -294,14 +300,16 @@ Life cycle. =========== - http://www.microsoft.com/windows/support/endofsupport.mspx - End of support for Windows 98, Windows Me, and Windows XP Service Pack 1 http://www.microsoft.com/windows/lifecycle/servicepacks.mspx Windows Service Pack Road Map http://www.microsoft.com/windows/lifecycle/default.mspx Windows Life-Cycle Policy http://support.microsoft.com/gp/lifeselect Life-Cycle Policy by product + http://support.microsoft.com/lifecycle/search + Microsoft Product Lifecycle Search. Type product name into + search box (like "Windows 95", "Windows XP", "Windows Server + 2003", etc)! NTFS junction points. ===================== diff -r 41ef0417d899 -r c2e5c5c9aebe x.rst --- a/x.rst Fri Sep 19 19:55:16 2014 +0300 +++ b/x.rst Fri Sep 19 20:04:24 2014 +0300 @@ -395,3 +395,22 @@ ``xdotool`` and ``xautomation`` utilities use ``XText`` for emulating user actions. + +GLX info. +========= + +To determine whether 3D acceleration is working:: + + $ apt-get install mesa-utils + $ glxinfo | grep render + +To see how many frames per second your video card is putting out:: + + $ glxgears -info + +See: + + https://wiki.debian.org/Mesa + Mesa is an open source 3D computer graphics library that + provides a generic OpenGL implementation for rendering + three-dimensional graphics on multiple platforms.