Month: September 2017

Split large file in smaller files

Split # split -b300M bigfile.zip bigfile.zip. # ls -al total 3110156 drwxr-xr-x 2 root root 4096 Sep 6 21:02 . drwx------ 19 root root 4096 Sep 6 21:01 .. -rw-r--r-- 1 root root 1592381288 Sep 6 21:01 bigfile.zip -rw-r--r-- 1 root root 314572800 Sep 6 21:01 bigfile.zip.aa -rw-r--r-- 1 root root 314572800 Sep 6 21:01

Encrypt or Decrypt files

encrypt.sh #!/bin/bash infile=$1 outfile=${infile}.enc if [ -f ${infile} ]; then if [ -f ${outfile} ]; then echo "target file ${outfile} already exists" exit 1 fi printf "Enter encryption password: " read pass if [ -z ${pass} ]; then echo "No password provided, using default: biscuit" pass=biscuit fi cat ${infile} |openssl enc -base64 -e -aes-256-cbc -nosalt