RSS feed [root] /unix /weblog




login:

password:

title search:




 


Sat Sep 28 10:13:26 GMT 2024

unix



(google search) (amazon search)
second
download zip of files only

Fri Dec 08 04:22:32 GMT 2023 From /weblog/unix

filesystem


Advisory Locking and Mandatory Locking - http://www.thegeekstuff.com/2012/04/linux-file-locking-types/

Basic info of inode - http://www.thegeekstuff.com/2012/01/linux-inodes/

Explanation of /proc filesystem - http://www.redhat.com[..]anual/ref-guide/s1-proc-directories.html

Linux file system structure - http://www.thegeekstuff.com/2010/09/linux-file-system-structure/

File system for archive files - http://linuxtoy.org/archives/avfs.html

BeOS file system, other than discuss about BeOS FS, also discussing about evolution of design of file system - http://arstechnica.com[..]rce/news/2010/06/the-beos-filesystem.ars http://arstechnica.com[..]03/past-present-future-file-systems.ars/

ZFS - http://www.thegeekstuff.com/2015/07/zfs-on-linux-zpool/ https://clusterhq.com/2014/09/11/file-systems-data-loss-zfs/ http://www.linuxjournal.com/content/zfs-linux https://arstechnica.com[..]derstanding-zfs-storage-and-performance/

The file size of command "df" return is compressed data, raw disk usage
If we want compress amount, we need to get the compressratio using /usr/sbin/zfs
We can get more system detail via perl package Sun::Solaris::Kstat , we can google "arc_summary.pl" as an example

Using ZFS as version control - http://zef.me/blog/6023/who-needs-git-when-you-got-zfs

When the Linux single-purpose philosophy fails: NFS - https://raduzaharia.medium.com[..]urpose-philosophy-fails-nfs-512ccd21d98c

(google search) (amazon search)


Sun Jul 30 14:04:42 GMT 2023 From /weblog/unix/script

find


An question about how to remove unused package from MacOSX turn out to be an example of "find" command:

http://forums.osxfaq.com/viewtopic.php?p=57887#57887
http://www.osxfaq.com/tips/unix-tricks/week98/tuesday.ws
http://javarevisited.blogspot.com[..]find-command-in-unix-examples-basic.html

File Search tips in Linux - http://discuss.joelonsoftware.com[..]iscussTopicParent=18272&ixDiscussGroup=3

Another search tip, example of find base on time and size, and how to compare with other files - http://viralpatel.net[..]e-useful-unix-file-finding-commands.html

Like search by name, depth, size - http://www.thegeekstuff.com[..]5-practical-linux-find-command-examples/

use 'find' to delete branch of file: http://keithdevens.com/weblog/archive/2005/Jul/05/find.rm

By time - http://www.thegeekstuff.com[..]unix-linux-find-command-examples-part-2/

Use of empty - http://www.thegeekstuff.com[..]010/03/find-empty-directories-and-files/

Find Anything You Need with fzf - https://medium.com[..]the-linux-fuzzy-finder-tool-f48dfd0092b4

(google search) (amazon search)


Fri May 19 13:22:08 GMT 2023 From /weblog/unix

shell


Sum time in script - http://www.markhneedham.com[..]-summing-the-total-time-from-a-log-file/

Special bash parameters - http://javarevisited.blogspot.com[..]ial-bash-parameters-in-script-linux.html

ls sort by file size - http://www.unix.com[..]ns-answers/6518-sorting-ls-filesize.html

How to use "~" - http://www.thegeekstuff.com/2010/06/bash-tilde-expansion

use rlwrap to enable BASH like editing in SQLplus, and use screen to presist terminal sessions - http://binkley.blogspot.com[..]miracle-utilities-rlwrap-and-screen.html

Ctrl+r searches through history
Use the history command plus !# to run old commands
Shell expansion using {} , e.g. cp foo.sh{,.old} == cp foo.sh foo.sh.old
zsh have good auto complete

http://www.pgrs.net/2007/9/6/useful-unix-tricks

mkdir -p creates nested directories
Use less instead of tail
lsof shows open files
ps will show process trees with the f flag

http://www.pgrs.net/2007/10/8/useful-unix-tricks-part-2

!! is the previous command in the shell history
Use vim -b to show nonprintable characters
** is a recursive wildcard in zsh
cd – will return to the previous folder
Use ctrl+z and kill %1 to kill a process that will not die
pwdx shows the working directory of a process
Use sh -x to debug shell scripts
sysctl replaces /proc on macs

http://pgrs.net/2009/2/20/useful-unix-tricks-part-3

ps -eo pcpu,pid,args | sort -n => check CPU%
grep -sq "" /etc/lsb-release && lsb_release -rd => run command if file exist

More about ps and free - http://www.thegeekstuff.com/2010/07/3-shell-scripts/

HTML tools for commandline - http://www.macdevcenter.com/lpt/a/6343

Bash history - http://www.talug.org/events/20030709/cmdline_history.html

Tips of using shell, like saving all history - http://blog.andrewhays.net/love-your-terminal

Standard Shell completion:

Variablename completion
Username completion
Executable completion
Filename and directory completion
Hostname completion

http://www.thegeekstuff.com/2013/11/bash-standard-completion/

replace
cp long_and_complex_file_name long_and_complex_file_name.backup
with this:
cp long_and_complex_file_name{,.backup}

http://www.jacopretorius.net[..]/2013/12/unix-trick-brace-expansion.html

Use the history - http://www.jacopretorius.net/2013/12/my-favorite-unix-trick.html

How to use xargs - http://www.thegeekstuff.com/2013/12/xargs-examples/

Nice presentation of man page - http://explainshell.com/explain?cmd=+ls+-ltr

Parallel shell - http://www.ubuntugeek.com/pssh-parallel-ssh-tools.html

A Beginner’s Guide to tmux - https://medium.com[..]s/a-beginners-guide-to-tmux-7e6daa5c0154

(google search) (amazon search)


Fri Oct 21 12:30:48 GMT 2022 From /weblog/unix

vim


Web base vim as tutorials - http://www.knowvim.com/ http://www.openvim.com/tutorial.html

History of VIM - http://arstechnica.com[..]f-productivity-vims-20th-anniversary.ars

Guide for editing text object, most already familiar with using 'w' for word editing, this blog discuss more about using 'p' for paragrahy and other related stuff. - http://blog.carbonfive.com[..]7/vim-text-objects-the-definitive-guide/

Seven habits of effective text editing , a lot of nice tip of using vim, like hlsearch , omni-completion

http://www.moolenaar.net/habits.pdf
http://video.google.com/videoplay?docid=2538831956647446078

vimdiff tips - http://blog.objectmentor.com[..]cles/2008/04/30/vim-as-a-diff-merge-tool http://gcody.blog.ccidnet.com[..]9899-uid-36931-do-showone-type-blog.html

How to regex with line number - http://vim.wikia.com/wiki/Insert_line_numbers_2

cheat sheet of jumping around source code - http://www.faqs.org[..]inux-HOWTO/C-editing-with-VIM-HOWTO.html

Nice analysis of good programming environment - http://www.benrady.com[..]why-i-switched-from-textmate-to-vim.html

Creating macros in vim - http://smartic.us/2010/02/03/creating-macros-in-vim

http://www.markhneedham.com/blog/2010/12/27/vim-learnings-so-far/ <- introduction to Command-T and FuzzyFinder

Some VIM tips:

Essential Vim editor navigation commands
Vim search and replace – 12 powerful find and replace examples.
How To add bookmarks inside the Vim editor
How To record and play inside the Vim editor
Correct spelling mistakes automatically inside the Vim Editor
Automatic word completion using Ctrl-X
Enable thesaurus option in the Vim editor
Vim autocommand magic. Add custom header to your files automatically.
Convert Vim editor to a beautiful source code browser.
Use the Vim editor as a bash IDE, or C/C++ IDE, or Perl IDE.

http://www.thegeekstuff.com/2010/04/vim-editor-tutorial/ https://spin.atomicobject.com[..]com/2016/04/19/vim-commands-cheat-sheet/

ctrl+w, ctrl+w , vimdiff switch folder - hack2live.blogspot.com/2009/02/vimdiff-shortcut-keys.html

tutorial - http://javarevisited.blogspot.com[..]editor-in-unix-example-tutorial-and.html https://danielmiessler.com/study/vim/ https://www.reddit.com[..]s/3mfvdg/how_do_i_go_about_learning_vim/ https://towardsdatascience.com/how-to-vim-b1719c67f76a

Compilation plugin - http://www.vim.org/scripts/script.php?script_id=3115#2.9.3

Highlight multiple searches at the same time, each with a different color. - http://www.vim.org/scripts/script.php?script_id=479 http://www.vim.org/scripts/script.php?script_id=2666#2.6.0

C/C++ IDE - http://www.vim.org/scripts/script.php?script_id=213 http://blog.wuwon.id.au[..]10/vim-plugin-for-navigating-c-with.html

Evil, putting vi in emacs - http://spin.atomicobject.com/2013/02/28/emacs-or-vim-evil/

Fixing syntax at solaris, "export TERM=xtermc", ":syntax enable" - http://kdl.nobugware.com/post/2006/12/01/23-xterm-color-on-unix

Graph your Vim undo tree in style. - http://sjl.bitbucket.org/gundo.vim/

Introduction to Selecta and Command-T, tool for fuzzy mapping and open files easier - http://marcovaltas.com/2013/12/27/selecta-on-vim-wildignore.html

http://superuser.com[..]d-the-vimrc-file-be-located-on-windows-7

Open Visual Studio config as XML - https://groups.google.com/forum/#!topic/vim_use/HzVM9tjJP08

Snippert library ( e.g. function template ) - https://www.reddit.com[..]3h7lca/which_snippet_library_do_you_use/

https://www.reddit.com[..]t_are_your_musthave_configs_and_plugins/

https://www.reddit.com[..]mments/2w22gf/edit_google_docs_with_vim/

https://www.reddit.com[..]nts/3ijsi2/original_post_a_vimrc_primer/

https://www.reddit.com[..]an_autocomplete_plugin_if_yes_which_one/

gUU to turn whole line upper case, and guu to turn whole line lower case - https://www.reddit.com[..]_guu_makes_an_entire_line_lowercase_and/

can use :TOhtml to turn a text file to HTML - http://jezenthomas.com/how-i-write-invoices-in-vim/

set encoding=utf-8 - https://www.reddit.com[..]how_to_reliably_switch_to_using_utf8_by/

If you like to test the regex for vi, can refer to this - http://www.virex.org/

http://www.hostingadvice.com[..]/blog/vim-creator-champions-charityware/

Another blog about using vim as IDE - https://spacevim.org/2017/02/11/use-vim-as-a-java-ide

vim cheat sheet - https://i.redd.it/8xu7welujmx41.png http://vimsheet.com https://github.com/ibhagwan/dots/blob/master/README-vim.md

https://blog.antoyo.xyz/vim-tips https://simianwesthighlandterrier.htmlpasta.com/

Write Code Faster in Vim - https://jacobcomer.medium.com[..]om/write-code-faster-in-vim-c564ff9b9f6c

https://www.reddit.com[..]d_using_spacemacsevil_and_made_this_vim/

How Vim works internally? - https://www.reddit.com[..]omments/hpt9l9/how_vim_works_internally/

Sample example of a VIM plugin - https://www.statox.fr/posts/vim/vim_flash_yanked_text/

Vim has a built-in Emoji Picker! - https://www.reddit.com[..]s/ioewb0/vim_has_a_builtin_emoji_picker/

Fast Typing: vi - https://codefaster.substack.com/p/fast-typing-vi

Vim as HTTP client - https://nazarii.bardiuk.com/posts/vim-curl.html

Vim team - https://se.ewi.tudelft.nl/desosa2019/chapters/vim/

How To Password Protect Text Files Using Vim Editor In Linux - https://www.noblevolkswagen.com.au[..]om.au/special-offers/m/passenger-offers/

Learning Vim: What I Wish I Knew - https://hackernoon.com[..]ning-vim-what-i-wish-i-knew-b5dca186bef7

How to format/sort/aggregate text in shell, and also vim - https://vimways.org/2019/vim-and-the-shell/

Inserting incremental numbers for each key in a JSON file? - https://www.reddit.com[..]g_incremental_numbers_for_each_key_in_a/

It’s time to Edit effectively in Vim, a visual article - https://susamn.medium.com[..]ely-in-vim-a-visual-article-76f9d0b45938

Completion tips - https://georgebrock.github.io/talks/vim-completion/

Vim's life-changing c% - https://thepugautomatic.com/2014/03/vims-life-changing-c-percent/

Vim Sessions - https://medium.com/vim-drops/vim-sessions-50756b2c603a

How to set up Vim in 2021? - https://medium.com[..]ng-vim-like-an-ide-1-3-vimrc-d484cc41fc2

(google search) (amazon search)


Wed Jul 20 01:36:17 GMT 2022 From /weblog/unix

security


Built-in checksum tool "cksum" - https://www.freecodecamp.org[..]inux-how-to-check-if-two-files-are-same/

Disable root password - http://www.debianadmin.com[..]le-and-disable-ubuntu-root-password.html

How can we fine tune permission more than chmod - http://man-wiki.net/index.php/3:cap_from_text

1. From a shell account on a Unix box behind the firewalled network do this:

ssh -N -R 3389:localhost:22 [email protected]

2. Leave work and go home. From a shell account on remote-unix-box.net do this:

ssh 127.0.0.1 -p 3389

http://16systems.com/acls.txt

(google search) (amazon search)


Thu Mar 03 23:10:30 GMT 2022 From /weblog/unix/script

display


Make your Bash scripts more interactive and futuristic with these tips. - https://levelup.gitconnected.com[..]only-a-few-programmers-know-4abb58ddadad

(google search) (amazon search)


Sun Feb 06 14:46:59 GMT 2022 From /weblog/unix

startup


systemd, An introduction! - https://dev.to/ethanrodrigo/systemd-an-introduction-lc6

(google search) (amazon search)


Wed Jan 19 00:14:25 GMT 2022 From /weblog/unix

Linux


How to get the system thread version - getconf GNU_LIBPTHREAD_VERSION http://groups.google.com[..]wse_thread/thread/81ff4b5d1ea3372d?hl=en

How to prevent module getting load, by edit /etc/modprobe.d/blacklist.conf : http://www.basshero.org/62/how-to-disable-devices-in-ubuntu/

Standard Linux error code - http://www.thegeekstuff.com/2010/10/linux-error-codes/

http://www.thegeekstuff.com[..]11/03/linux-performance-monitoring-intro

Discussion about why Linux is way faster than Windows for huge number of small file processing - http://stackoverflow.com[..]s-to-go-as-fast-as-linux-for-compiling-c http://games.greggman.com/game/why-is-windows-so-slow/

"sync; sudo echo 3 > /proc/sys/vm/drop_caches" - http://www.ubuntugeek.com[..]ow-to-clear-cached-memory-on-ubuntu.html

Funny linux commands - http://www.pixelstech.net/article/1370744983-Funny-Linux-commands

25 years of linux - https://medium.freecodecamp.com[..]acts-about-linux-c8d8ac30076d#.m6b9wnhni

basic-principle-of-Linux-privilege-control - http://www.infoq.com[..]sic-principle-of-Linux-privilege-control

New approach to save memory - https://code.fb.com[..]ng-oomd-a-new-approach-to-handling-ooms/

a-zoological-guide-to-kernel-data-structures - https://medium.com[..]e-to-kernel-data-structures-4c68207e186b

The Arch Linux Handbook - https://www.freecodecamp.org/news/how-to-install-arch-linux/

(google search) (amazon search)


Wed Nov 03 12:09:14 GMT 2021 From /weblog/unix/script

automation


What is Ansible? A Tool to Automate Parts of Your Job - https://www.freecodecamp.org/news/what-is-ansible

(google search) (amazon search)


Sat Jul 10 13:32:48 GMT 2021 From /weblog/unix

performance


Few config suggestions - http://blog.monitis.com[..]20-linux-server-performance-tips-part-2/

Linux kernel profiling with perf - https://perf.wiki.kernel.org/index.php/Tutorial http://lxr.free-electrons.com/source/tools/perf/design.txt

Intel VTune Amplifier profiler - http://software.intel.com/en-us/intel-vtune-amplifier-xe

Oracle solaris studio - http://www.oracle.com[..]torage/solarisstudio/overview/index.html

http://www.brendangregg.com/linuxperf.html <- "This page links to various Linux performance material I've created, including the tools maps on the right."

Simple config to kernel can get meaningful performance improvement, if needed - https://blog.acolyer.org[..]nce-evolution-of-linuxs-core-operations/

(google search) (amazon search)


Tue Dec 29 14:03:33 GMT 2020 From /weblog/unix

monitoring


Using unhide to check hidden process - http://www.ubuntugeek.com[..]unhide-the-opensource-forensic-tool.html

fuser, check which user using the file or directory - http://www.thegeekstuff.com/2012/02/linux-fuser-command/

htop, look much better than top - http://nerds-central.blogspot.com[..]ght-no-i-am-loving-htop-it-is-linux.html http://www.thegeekstuff.com/2011/09/linux-htop-examples

Tutorial of both lsof and pstack - http://myhowto.org[..]ternals-with-lsof-and-strace/#strace_run

Tutorial of SAR - http://www.thegeekstuff.com/2011/03/sar-examples . In Solaris, you can check SAR from previous days using "sar -f /var/adm/sa/sa30 " ( last 30th )

If we like to see the detail from "ps" command:
solaris: /usr/ucb/ps -awwx , or, use pargs, but need sudo to that user - http://javarevisited.blogspot.com.au[..]ow-long-argument-of-running-process.html
linux: ps -aef --cols [XXXX]

prstat - use prstat instead of ps in solaris http://developers.sun.com/solaris/articles/prstat.html
How to check physical memory on solaris? /usr/sbin/prtconf | grep Memory http://www.dbapool.com/faqs/Q_116.html

Other forensics tools - http://www.forensicfocus.com[..]om/computer-forensics-software-intro.php

Sun monitoring tools collections - http://blogs.sun.com[..]try/solaris_performance_monitoring_tools http://tech.varghees.com[..]sed-system-monitoring-commands-in-linux/

time, basic unix util - http://www.thegeekstuff.com/2013/10/time-command-format

http://www.baptiste-wicht.com[..]ow-level-discovery-cores-cpus-hard-disk/

10 commands for system monitoring - http://techblog.netflix.com[..]1/linux-performance-analysis-in-60s.html http://www.infoq.com/cn/news/2015/12/linux-performance

https://linuxcommando.blogspot.com[..]nxi-swiss-army-knife-for-displaying.html

Top explain - https://dzone.com/articles/different-cpu-times-unixlinux-top

(google search) (amazon search)


Sun Oct 11 13:30:21 GMT 2020 From /weblog/unix

network


TCP tuning - http://rodrickbrown.com/blog/?p=127

UNIX network performance analysis - http://www.ibm.com[..]works/aix/library/au-networkperfanalysis

Netstat tips - http://www.thegeekstuff.com/2010/03/netstat-command-examples/

Introduction to a lot of difference commands - http://tech.varghees.com[..]work-monitoring-commands-in-linux-part-i

Commandline tools which can do most HTTP message - http://www.thekua.com[..]11/scripting-web-applications-with-curl/

Tools to show contents from network - http://coding.smashingmagazine.com[..]/powerful-command-line-tools-developers/

http://java67.blogspot.com.au[..]nd-to-find-ip-address-from-hostname.html

/proc/sys/net/core/
/rmem_default: The default setting of the socket receive buffer in bytes.
/rmem_max: The maximum receive socket buffer size in bytes.
/wmem_default: The default setting (in bytes) of the socket send buffer.
/wmem_max: The maximum send socket buffer size in bytes.
Only for Linux - http://www.lainoox.com/view-or-set-socket-receive-buffer-size/

Getting IP of the host: http://whatismyipaddress.com/ "wget http://ipecho.net/plain -O - -q ; echo" from - http://ru05team.blogspot.com.au[..]ou-want-to-check-you-current-public.html

Use tcpdump and tshark to monitor network activity - http://jvns.ca/blog/2016/03/16/tcpdump-is-amazing/

一篇文章搞定 Nginx 反向代理与负载均衡 - https://xie.infoq.cn/article/d7ad4d2500d6ce6a4ce3b9c16

(google search) (amazon search)


Sun Aug 06 09:21:16 GMT 2017 From /weblog/unix/script

text


10 awk tips - http://www.catonmat.net/blog/ten-awk-tips-tricks-and-pitfalls/

8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS, NR, NF, FILENAME, FNR - http://www.thegeekstuff.com[..]iables-fs-ofs-rs-ors-nr-nf-filename-fnr/

Tutorial of text editing commands - http://www.ibm.com[..]works/aix/library/au-unixtext/index.html

wc and nl tutorial - http://www.thegeekstuff.com/2013/02/wc-nl-examples/ https://enkipro.com/insight/558ac712249a234c00842b68

tips for uniq, like show only items have duplications - http://www.thegeekstuff.com/2013/05/uniq-command-examples/

Tips of "cat", include display by column and by delimiter - http://www.thegeekstuff.com/2013/06/cut-command-examples/

Using lynx to convert HTML to text - https://enkipro.com/insight/558aaea45800843200bca364

(google search) (amazon search)


Sun Aug 06 09:20:16 GMT 2017 From /weblog/unix/script

file


Various ways to working with file - http://www.catonmat.net/blog/bash-one-liners-explained-part-one/

Use truncate to pad the file size up - http://www.lainoox.com/truncate-shrink-extend-files/

Making a file unalterable with chattr - https://enkipro.com/insight/558ac712249a234c00842b68

(google search) (amazon search)


Wed Jun 14 10:34:19 GMT 2017 From /weblog/unix/script

development


A bash debugger - http://bashdb.sourceforge.net/

Really really good tips - http://fahdshariff.blogspot.com.au[..]3/10/shell-scripting-best-practices.html

Style guide - http://www.kfirlavi.com[..]og/2012/11/14/defensive-bash-programming

Script checker - https://www.shellcheck.net/

How to write a shell - https://indradhanush.github.io/blog/writing-a-unix-shell-part-1 https://indradhanush.github.io/blog/writing-a-unix-shell-part-2

(google search) (amazon search)


Fri Jan 20 03:52:35 GMT 2017 From /weblog/unix

desktop


Some useful tools - https://nicolas.perriault.net/code/2016/from-osx-to-ubuntu/

Tuning - http://www.akitaonrails.com[..]1/17/optimizing-linux-for-slow-computers

(google search) (amazon search)


Wed Nov 30 04:57:15 GMT 2016 From /weblog/unix

bug


25 years old bug - http://www.osnews.com/story/19731/The-25-Year-Old-UNIX-Bug

The problem of copying to other machine and screw up the permission - http://unixhorrorstories.blogspot.hk[..]nix-horror-stories-good-thing-about.html

(google search) (amazon search)


Thu Oct 06 15:23:20 GMT 2016 From /weblog/unix

reference


A very nice sectioned list of unix command - http://en.wikipedia.org/wiki/List_of_Unix_programs

Backup a list of directories - http://linuxintegrators.com/acoliver/code/?permalink=x-0272.html

A quick reference - http://www.cs.usfca.edu/~parrt/course/601/lectures/unix.util.html

Tuning cheat sheet - http://www.performancewiki.com/linux-tuning.html

Common and difference between systems - http://www.thegeekstuff.com/2012/01/linux-unix-kernel/

BSD for linux user - http://www.over-yonder.net/~fullermd/rants/bsd4linux/01

Actually a quick tutorial - https://sanctum.geek.nz/arabesque/series/unix-as-ide/

(google search) (amazon search)


Fri Apr 01 03:29:26 GMT 2016 From /weblog/unix/script

bash


How to use eval, hash, readonly, shift, getopts, set, unset, let and shopt - http://www.thegeekstuff.com/2010/08/bash-shell-builtin-commands

Sample bash completion

SSH_COMPLETE=( $(cut -f1 -d' ' ~/.ssh/known_hosts |\
tr ',' '\n' |\
sort -u |\
grep -e '[:alpha:]') )
complete -o default -W "${SSH_COMPLETE[*]}" ssh

http://kasparov.skife.org/blog/stuff/starting-a-meme.html

Check history statistic - brianm@binky:~$ history | awk {'print $2'} | sort | uniq -c | sort -k1 -rn | head
164 svn
52 cd
42 ssh
32 sudo
22 git
16 ls
16 for
14 echo
13 man
10 curl
brianm@binky:~$

http://bluebones.net/2008/04/history-meme/

easy way to do "[-h|--help][-n|--name ]" - http://binkley.blogspot.com/2016/03/bash-long-options.html

(google search) (amazon search)



Wed Feb 03 13:55:53 GMT 2016 From /weblog/unix/script

locate


http://www.thegeekstuff.com/2012/03/locate-command-examples/

(google search) (amazon search)


Wed Dec 30 07:09:53 GMT 2015 From /weblog/unix

Embedded


Embedded Programming with the GNU Toolchain - http://www.bravegnu.org/gnu-eprog/

(google search) (amazon search)


Mon Nov 09 07:34:36 GMT 2015 From /weblog/unix

tracing


Look like a nice tools provide more information for performance issue - http://oprofile.sourceforge.net/examples/

Check CPU problem with prstat
http://javaeesupportpatterns.blogspot.ca[..]stat-solaris-pinpoint-high-cpu-java.html
http://javaeesupportpatterns.blogspot.ca[..]stat-linux-how-to-pinpoint-high-cpu.html
http://javaeesupportpatterns.blogspot.ca[..]prstat-aix-how-to-pinpoint-high-cpu.html

http://www.thegeekstuff.com/2012/03/reverse-engineering-tools

If we like to trace process detail flow, system call and file opened - http://www.ussg.iu.edu/UAU/advcomm/truss.html http://fuse4bsd.creo.hu/localcgi/man-cgi.cgi?truss+1


-l Includes the id of the responsible lightweight process
(LWP) with each line of trace output. If -f is also
specified, both the process-id and the LWP-id are
included.



If the process hang and we like to check why, can try pstack - http://www.google.com[..]=pstack&sourceid=opera&ie=utf-8&oe=utf-8

Check where is the core dump to - http://groups.google.com[..]s/browse_thread/thread/9f46dfb277c72cc8#

Use gcore to generate coredump for running process - http://www.gsp.com/cgi-bin/man.cgi?section=1&topic=gcore

If we like to check the which process id using which port, we can use lsof or "pfiles /proc/*"
1) save the output of "pfiles /proc/*" to a file
2) grep the file for that port, then find the PID, e.g., say here is the part of the output:

5859: java -Djava.awt.headless=true -DX_R_BRGD -Xms512M -Xmx1024M -Djava.io.
Current rlimit: 1024 file descriptors
0: S_IFCHR mode:0666 dev:85,0 ino:980953 uid:0 gid:3 rdev:13,2
O_RDONLY|O_LARGEFILE

....... ( 125 FD after) ......

125: S_IFSOCK mode:0666 dev:313,0 ino:40404 uid:0 gid:0 size:0
O_RDWR
sockname: AF_INET 10.152.22.22 port: 18075
peername: AF_INET 169.19.21.63 port: 41792

Then PID 5859 is the process working with the port 18075, however, it only work for process which is viewable according to your permission setting

Another probably easier way, and provide more information, is using
lsof -i :[port]
- http://javarevisited.blogspot.com[..]-unix-netstat-lsof-command-examples.html

If we like to check the which process id using which file, we can use fuser - http://linuxcommand.org/man_pages/fuser1.html

Check host and port that any process accessing using lsof - http://www.geekology.co.za[..]-are-accessing-internet-on-unix-machine/

How do I monitor or view the thread count of a certain process - ps -o pid,comm,user,thcount -p - http://superuser.com[..]thread-count-of-a-certain-process-on-aix

Examples of using strace, use -e to trace function call is useful - http://www.thegeekstuff.com/2011/11/strace-examples

The nm commands provides information on the symbols being used in an object file or executable file. - http://www.thegeekstuff.com/2012/03/linux-nm-command/

Use pmap -s -x to look at what's in the virtual address space of yr process and what portion thereof is resident in physical memory.

(google search) (amazon search)



Thu Aug 20 15:40:08 GMT 2015 From /weblog/unix

time


http://juliusdavies.ca/posix_clocks/clock_realtime_linux_faq.html http://efreedom.com/Question/1-6814792/Clock-Gettime-Erratic

Unix timezone - https://www.vmware.com[..]isdk400pubs/ReferenceGuide/timezone.html

(google search) (amazon search)