Skip to content

Instantly share code, notes, and snippets.

@pskpatil
pskpatil / GNU-Make.md
Created September 7, 2022 08:08 — forked from rueycheng/GNU-Make.md
GNU Make cheatsheet
@pskpatil
pskpatil / PingIP.java
Created March 26, 2022 17:23 — forked from madan712/PingIP.java
Java program to ping an IP address
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(
@pskpatil
pskpatil / rapidjson_gen_json.cpp
Created January 2, 2022 00:29 — forked from fclairamb/rapidjson_gen_json.cpp
Write some JSON using a rapidjson library
#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":"[email protected]","FromName":"Sender's name","Subject":"My subject","Recipients":[{"Email":"[email protected]"}],"Text-part":"this is my text"}
@pskpatil
pskpatil / about.md
Created September 14, 2021 06:21 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@pskpatil
pskpatil / encrypt.sh
Created September 14, 2021 06:13 — forked from ppanyukov/encrypt.sh
Noddy script to encrypt/decrypt files using openssl private (ssh) key.
#!/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
@pskpatil
pskpatil / encrypt_openssl.md
Created September 14, 2021 06:10 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

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: