Friday, September 26, 2008

5 searching commands in linux

1. find

2. locate
-uses a database of file location instead of searching the real location, the database only updated everyday

3. whereis [-bsm]
- returns the location for a specific command line command, -b gives the location of the binary, -s gives the location of the source, and -m gives the location of the man pages

4. which
- returns all the location for the specific command. it searches the PATH env variable for locating the binary. great if there are multiple versions of a command in PATH.
- it returns the full path for each version of the command

5. type [-a]
- returns the type of command this console is using for the default, could be a shell built in, a UNIX command, a linux command etc. -a gives this property for all commands that are with the same name

Sunday, September 14, 2008

Cloud Computing Digest

Cloud Computing is a fairly new internet service structure. it provide ways to virtually map physical storage, internet access together with a web based application for a remote user. The advantage of cloud computing is the reduction in the amount of server and energy needed to run a large scale service.
the idea of cloud computing resides in thinking of whole bunch of servers running for different services as a cloud, instead of independently running machines. It virtuallizes all physical machines into several layers: infrastructure service layer, platform service layer, and software service layer.

infrastructure service layer manages web throughput and storage space for remote server, giving each remote client a fixed network power and storage space without having all those service being tied down to one service machine. it also provide ways to run a operating platform on top of the infrastructure layer, limiting the storage and service to specific platforms that uses it.

the platform service layer provide users a selection of applications they could use. an example of platform service is the google application engine

the software service layer contains web applications the user may use, one example would be Google Apps.

information digested from here

Monday, September 8, 2008

some more UNIX tips

1. auto-complete features in all shells:

bash: TAB or double TAB
cash: escape
korn: escape \ or double escape (depends on EDITOR var setting, either vi or emacs)

2. accessing previous command arguments from shell
$! access the last argument of the last command entry
!:1 or another number can access the last command argument at the position starting from 1

3. pushd and popd creates a stack of file locations that can be accessed without using cd command. it can also manipulate the stack, rotating its order with +i or -i where i is the rotation number to rotate, + puts the frontmost to the back, - puts the backmost to the front

4. curl command can be used to retrieve web information, use -s to ignore processing output, use -o to download any file from the internet

5. name matching special characters:
^ -> matching anything to the starting of line as in ^A
? -> matching anything at the end of the line A?
[] -> matching any character within the bracket, use - for indicating range
[^]-> matching any character except for those within the bracket
. -> match a single character of any value except for EOF
* -> match 0 or more preceding characters to expression
\{x,y\} -> match to x to y occurence of the preceding
\{x\} -> match to exactly x occurence of the preceding
\{x,\} -> match to x or more occurence of the preceding

6. some awk example (more examples)

$ cat text
testing the awk command
$ awk '{ i = length($0); print i }' text
23
$ awk '{ i = index($0,”ing”); print i}' text
5
$ awk 'BEGIN { i = 1 } { n = split($0,a," "); while (i <= n) {print a[i]; i++;} }' text

(summarized from here)

Wednesday, September 3, 2008

Google Chrome, so much faster and so much more simple to use

it looks like google's new browser: Chrome is so 5 times faster than firefox and other browsers in general. it is also very small and very simple to use.

you may download it here