Skip to content

Instantly share code, notes, and snippets.

@jackdouglas
Last active December 25, 2015 04:58
Show Gist options
  • Save jackdouglas/6920714 to your computer and use it in GitHub Desktop.
Save jackdouglas/6920714 to your computer and use it in GitHub Desktop.
dd if=/dev/zero of=vm.1 count=1 bs=1M
cp vm.1 vm.2
dd if=/dev/urandom of=vm.2 count=1 bs=1K conv=notrunc
dd if=/dev/urandom of=vm.2 count=1 bs=1K seek=4 conv=notrunc
dd if=/dev/urandom of=vm.2 count=1 bs=1K seek=8 conv=notrunc
dd if=/dev/urandom of=vm.2 count=1 bs=1K seek=12 conv=notrunc
jdiff sig <vm.1 >vm.1.sig4k
jdiff1 sig <vm.1 >vm.1.sig1k
jdiff delta vm.1.sig4k /dev/null <vm.2 >vm.delta4k.gz
jdiff1 delta vm.1.sig1k /dev/null <vm.2 >vm.delta1k.gz
ls -l
produces:
[root@shropshire temp]# dd if=/dev/zero count=1 bs=1M > vm.1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00172302 s, 609 MB/s
[root@shropshire temp]# cp vm.1 vm.2
[root@shropshire temp]# dd if=/dev/zero count=1 bs=1M conv=notrunc | tr '\0' '\xff' > vm.2
jdiff1 sig <vm.1 >vm.1.sig1k
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00335342 s, 313 MB/s
[root@shropshire temp]# jdiff sig <vm.1 >vm.1.sig4k
[root@shropshire temp]# jdiff1 sig <vm.1 >vm.1.sig1k
[root@shropshire temp]# jdiff delta vm.1.sig4k /dev/null <vm.1 >vm.delta4k.gz
[root@shropshire temp]# jdiff1 delta vm.1.sig1k /dev/null <vm.1 >vm.delta1k.gz
[root@shropshire temp]# ls -l
total 2068
-rw-r--r-- 1 root root 1048576 Oct 10 16:51 vm.1
-rw-r--r-- 1 root root 6176 Oct 10 16:51 vm.1.sig1k
-rw-r--r-- 1 root root 1568 Oct 10 16:51 vm.1.sig4k
-rw-r--r-- 1 root root 1048576 Oct 10 16:51 vm.2
-rw-r--r-- 1 root root 1025 Oct 10 16:51 vm.delta1k.gz
-rw-r--r-- 1 root root 257 Oct 10 16:51 vm.delta4k.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment