Compare commits
No commits in common. "1979b697f396fcb0ddc133fbc8e6f2187d34ed9c" and "8a682ffe6f933c93c6deaf2619b355c02f711b9a" have entirely different histories.
1979b697f3
...
8a682ffe6f
2 changed files with 12 additions and 5 deletions
|
|
@ -3,6 +3,11 @@
|
||||||
|
|
||||||
A collection of easy-to-understand, easy-to-use scripts and functions. Designed to be beginner-friendly but also useful!
|
A collection of easy-to-understand, easy-to-use scripts and functions. Designed to be beginner-friendly but also useful!
|
||||||
|
|
||||||
|
# How to use
|
||||||
|
Simply open your shell's RC-file (.bashrc, .zshrc, etc) and include `source <lackadaisical-folder>/daisy.source` preferably at the bottom of the file. We recommend setting your editor before sourcing `lackadaisical`. For instance, putting `export EDITOR=/usr/bin/nano` near thec\ top of your RC-file. It may later be overridden by `lackadaisical` itself if you use (or have used) `ched`.
|
||||||
|
|
||||||
|
You can also try out the utilities by simply sourcing the file while running your shell. It will automatically include itself into your `PATH` variable.
|
||||||
|
|
||||||
# Contents
|
# Contents
|
||||||
*(taken from `daisy_help`)*
|
*(taken from `daisy_help`)*
|
||||||
|
|
||||||
|
|
|
||||||
12
daisy.source
12
daisy.source
|
|
@ -289,11 +289,12 @@ function daisy_enc()
|
||||||
file_name=$(basename $1)
|
file_name=$(basename $1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
base64_inner=$(cat ${1:-/dev/stdin} | base64 | tr -d '\n')
|
data=$(cat ${1:-/dev/stdin})
|
||||||
|
base64_inner=$(echo -e "$data" | base64 | tr '\n' '-')
|
||||||
|
|
||||||
# Print out our block
|
# Print out our block
|
||||||
echo -e "# File info: $file_info"
|
printf "# File info: $file_info\n"
|
||||||
echo -e "daisy_data_base64_$file_name=\"$base64_inner\""
|
printf "daisy_data_base64_$file_name=\"$base64_inner\""
|
||||||
}
|
}
|
||||||
|
|
||||||
# Will only take input files, always outputs to stdout
|
# Will only take input files, always outputs to stdout
|
||||||
|
|
@ -312,8 +313,9 @@ function daisy_enc_multi()
|
||||||
|
|
||||||
function daisy_dec()
|
function daisy_dec()
|
||||||
{
|
{
|
||||||
data=$(cat ${1:-/dev/stdin} | grep -v "#" )
|
data=$(cat ${1:-/dev/stdin} | sed -e 's/.*=\"//g' | grep -v "#" | tr -d '\"' | tr -d "'" | tr '-' '\n' )
|
||||||
echo -e "$data" | cut -d "=" -f 2 | cut -b 2- | head -c -1 | base64 -d
|
decoded=$(echo -e "$data" | cut -d "=" -f 1 | base64 -d)
|
||||||
|
printf "$decoded"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Will only take a file and directory, sources it to find all encoded data
|
# Will only take a file and directory, sources it to find all encoded data
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue