- http://donigian.blogspot.com, http://donigian.github.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Print a process tree using ps | |
# ps -ejH | |
# ps axjf | |
# pstree | |
Type the following ps command to display all running process: | |
# ps aux | less | |
See process run by user | |
# ps -u username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking for full words, not for sub-strings using grep -w | |
grep -iw "is" demo_file | |
Match regular expression in files | |
$ grep "lines.*empty" demo_file | |
From documentation of grep: A regular expression may be followed by one of several repetition operators: | |
? The preceding item is optional and matched at most once. | |
* The preceding item will be matched zero or more times. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ant deploy | |
ant undeploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hadoop File System Commands | |
Syntax Overview | |
The basic syntax of HDFS commands is as follows: | |
$ hadoop fs -command [extra arguments] | |
For example: | |
$ hadoop fs -ls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ec2-describe-instances # figure out instance id, eg. i-72eba2a1 | |
$ ec2-stop-instances i-xxx | |
$ ec2-start-instances i-xxx | |
$ ec2-describe-instances | |
$ ec2-associate-address x.x.x.x. -i i-xxxx # set up elastic IP again | |
ec2-authorize default -p 22 | |
ec2-authorize default -p 80 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ec2-run-instances -z us-east-1a --key YOURKEYPAIR ami-1515f67c | |
ec2-describe-instances i-IIII1111 | |
ec2-create-volume -z us-east-1a -s 10 | |
ec2-describe-volumes vol-VVVV1111 | |
ec2-attach-volume -d /dev/sdh -i i-IIII1111 vol-VVVV1111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3j move down 3 lines | |
f{ find next bracket | |
$1, $2, $3 refers to first, second third args | |
$* refers to list of all args | |
open -a application name_of_file | |
cat index.html pbcopy | |
pbpaste |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code Highlighting | |
{% highlight ruby %} | |
def foo | |
puts 'foo' | |
end | |
{% endhighlight %} | |
Line number | |
{% highlight ruby linenos %} | |
def foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://wordpress.org/latest.tar.gz | |
gunzip latest.tar.gz | |
tar xvf latest.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find files using file-name ( case in-sensitve find) | |
# find -iname "MyCProgram.c" | |
Execute commands on files found by the find command | |
$ find -iname "MyCProgram.c" -exec md5sum {} \; | |
ssh command examples | |
ssh -l jsmith remotehost.example.com | |
Debug ssh client |