Quantcast
Channel: Recent Gists from itamarhaber
Viewing all articles
Browse latest Browse all 36

Loading a binary value from a file with redis-cli

$
0
0
method-1-binary-file.md

Create the file with the actual bytes, not the '\xnn\ representation. For example, in Python:

f = open('filename', 'w')
f.write('\x01\x02\x03')
f.close()

Load the file with redis-cli -x set keyname < filename

method-2-lua.md

Create a script with the data already in it:

redis.call('SET', 'keyname', '\01\02\03')

Run the script: `redis-cli --eval script.lua


Viewing all articles
Browse latest Browse all 36

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>