Skip to content

Instantly share code, notes, and snippets.

@nicolasramy
Last active August 10, 2021 15:30
Show Gist options
  • Select an option

  • Save nicolasramy/ea8f5b70abc23f136553 to your computer and use it in GitHub Desktop.

Select an option

Save nicolasramy/ea8f5b70abc23f136553 to your computer and use it in GitHub Desktop.

Revisions

  1. nicolasramy revised this gist Jul 21, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion shell.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ To search **word1** and exclude a **word2**

    Remove blank lines in a file

    sed '/^$/d' 2file.input > file.output
    sed '/^$/d' file.input > file.output

    ## OpenSSL

  2. nicolasramy revised this gist Jul 4, 2014. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions shell.md
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,12 @@ To search **word1** and exclude a **word2**

    grep "word1" | grep -v "word2"

    ## Sed

    Remove blank lines in a file

    sed '/^$/d' 2file.input > file.output

    ## OpenSSL

    To generate *.pem* from a RSA key
  3. nicolasramy revised this gist Jul 3, 2014. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    To got to the 21490th byte in the buffer

    :goto 21490

    To go to line 124

    :124

    Replace "search" by "replace" in buffer

    :%s/search/replace/g
  4. nicolasramy revised this gist Jun 27, 2014. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion shell.md
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,14 @@ To kill a program base on its PROCESS_NAME (don't work perfectly and could be da

    To search **word1** and exclude a **word2**

    grep "word1" | grep -v "word2"
    grep "word1" | grep -v "word2"

    ## OpenSSL

    To generate *.pem* from a RSA key

    openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem

    To generate *.pem* from a DSA key

    openssl dsa -in ~/.ssh/id_dsa -outform pem > id_dsa.pem
  5. nicolasramy revised this gist Jun 26, 2014. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion shell.md
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,11 @@ To run command silently

    To kill a program base on its PROCESS_NAME (don't work perfectly and could be dangerous for some PROCESS_NAME)

    ps -ef | grep PROCESS_NAME | grep -v grep | awk '{print $2}' | xargs kill -9
    ps -ef | grep PROCESS_NAME | grep -v grep | awk '{print $2}' | xargs kill -9


    ## Grep

    To search **word1** and exclude a **word2**

    grep "word1" | grep -v "word2"
  6. nicolasramy revised this gist Jun 26, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion shell.md
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,4 @@ To run command silently

    To kill a program base on its PROCESS_NAME (don't work perfectly and could be dangerous for some PROCESS_NAME)

    ps -ef | grep PROCESS_NAME | grep -v grep | awk '{print $2}' | xargs | kill -9
    ps -ef | grep PROCESS_NAME | grep -v grep | awk '{print $2}' | xargs kill -9
  7. nicolasramy renamed this gist Jun 26, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion misc.sh → shell.md
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,6 @@ To run command silently

    ## Kill

    To kill a program base on its PROCESS_NAME (don't work perfectly and could be dangerous for some PROCESS_NAME)
    To kill a program base on its PROCESS_NAME (don't work perfectly and could be dangerous for some PROCESS_NAME)

    ps -ef | grep PROCESS_NAME | grep -v grep | awk '{print $2}' | xargs | kill -9
  8. nicolasramy created this gist Jun 26, 2014.
    12 changes: 12 additions & 0 deletions misc.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # Shell

    ## Nohup

    To run command silently

    nohup command-with-options &


    ## Kill

    To kill a program base on its PROCESS_NAME (don't work perfectly and could be dangerous for some PROCESS_NAME)