Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

nevada

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

encrypt data with openssl

Encrypt:
openssl des3 -salt -in unencrypted-data.tar -out encrypted-data.tar.des3
enter des-ede3-cbc encryption password:
Verifying - enter des-ede3-cbc encryption password:


That command will encrypt the unencrypted-data.tar file with the password you choose and output the result to encrypted-data.tar.des3. To unlock the encrypted file, use the following command:

Decrypt:
$ openssl des3 -d -salt -in encrypted-data.tar.des3 -out unencrypted-data.tar
enter des-ede3-cbc encryption password:

search with grep in linux


Searching files

grep (r - recursive, s - no messages, n -line number, i - case insensitve, H -with filename)
grep -rsniH your_string

match lines containing the string "I am a cat" or the string "I am a dog".
grep "I am a \(cat\|dog\)" 


Search application

to find PID (process ID) of a certain application or process,
pgrep


find application port
netstat -a | grep ftp

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS