Skip to content

Instantly share code, notes, and snippets.

@afbio
Last active October 17, 2017 21:13
Show Gist options
  • Save afbio/6405812663a5d6d5f49f321ffc2a2e8a to your computer and use it in GitHub Desktop.
Save afbio/6405812663a5d6d5f49f321ffc2a2e8a to your computer and use it in GitHub Desktop.
Copy/Send files using xxd
# WORKAROUND to use when "scp"/"kubectl cp"/"docker cp" is unvailable
# on local machine
xxd ~/file_aaa.xlsx > /tmp/bin_file_aaa
# md5sum to compare on end
md5sum ~/file_aaa.xlsx
# open and copy full content file
gedit /tmp/bin_file_aaa
# >>>> ctrl+a && ctrl+c
################################
# ON pod/container
vi /tmp/remote_bin_file_aaa
#paste content and save
# reverse convert
xxd -r /tmp/remote_bin_file_aaa > /tmp/remote_file_aaa.xlsx
# compare this md5sum with the generated on start/local machine
md5sum /tmp/remote_file_aaa.xlsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment