Skip to content

Instantly share code, notes, and snippets.

View donigian's full-sized avatar

armen donigian donigian

  • Jet Propulsion Labratory
  • Pasadena
View GitHub Profile
@donigian
donigian / gist:3055762
Created July 5, 2012 19:11
Common Linux Commands
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
@donigian
donigian / gist:3094399
Last active October 7, 2015 02:58
Most Useful Grep Command Examples
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.
@donigian
donigian / gist:3134453
Created July 18, 2012 05:46
Java EE notes
ant deploy
ant undeploy
@donigian
donigian / gist:3835055
Created October 4, 2012 17:16
Hadoop File System Commands
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
@donigian
donigian / gist:3845978
Created October 6, 2012 20:16
Amazon EC2 Commonly Used Commands
$ 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
@donigian
donigian / gist:3922505
Created October 20, 2012 07:25
Setting up an EBS volume on an EC2 instance for use with MySQL
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
@donigian
donigian / gist:3951402
Last active October 12, 2015 01:37
VIM Commands
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
@donigian
donigian / blog frequent commands
Last active December 9, 2015 22:09
donigian.github.com blog
Code Highlighting
{% highlight ruby %}
def foo
puts 'foo'
end
{% endhighlight %}
Line number
{% highlight ruby linenos %}
def foo
@donigian
donigian / gist:4577383
Created January 20, 2013 09:01
wordpress work
wget http://wordpress.org/latest.tar.gz
gunzip latest.tar.gz
tar xvf latest.tar
@donigian
donigian / gist:5118864
Last active December 14, 2015 16:59
Most Useful Linux Commands
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