For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
| #!/usr/bin/env bash | |
| set -eu | |
| # Noddy script to encrypt/decrypt files using openssl private (ssh) key. | |
| # Works with files and stdin. | |
| # Results are stdout. | |
| # | |
| # Requirements: | |
| # - openssl | |
| # - ssh private key: ~/.ssh/id_rsa |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| #ifdef SHELL | |
| g++ -Wall -Werror -g -I../../cclib/rapidjson/include $0 && ./a.out | |
| exit 0 | |
| #endif | |
| // Output is: | |
| // {"project":"rapidjson","stars":11} | |
| // {"Name":"XYZ","Rollnumer":2,"array":["hello","world"],"Marks":{"Math":"50","Science":"70","English":"50","Social Science":"70"}} | |
| // {"FromEmail":"sender@gmail.com","FromName":"Sender's name","Subject":"My subject","Recipients":[{"Email":"recipient@gmail.com"}],"Text-part":"this is my text"} |
| import java.io.BufferedReader; | |
| import java.io.InputStreamReader; | |
| public class PingIP { | |
| public static void runSystemCommand(String command) { | |
| try { | |
| Process p = Runtime.getRuntime().exec(command); | |
| BufferedReader inputStream = new BufferedReader( |
Based on https://www.gnu.org/software/make/manual/html_node/Quick-Reference.html
| Directive | Description |
|---|---|
define variable define variable = define variable := define variable ::= define variable += define variable ?= endef |
Define multi-line variables. |
undefine variable |
Undefining variables. |