Skip to content

Instantly share code, notes, and snippets.

@louisrawlins
Last active November 27, 2016 23:13
Show Gist options
  • Save louisrawlins/4f1d3a4c25662cb2bdefd7aa8af8333e to your computer and use it in GitHub Desktop.
Save louisrawlins/4f1d3a4c25662cb2bdefd7aa8af8333e to your computer and use it in GitHub Desktop.
Restore cache files from hex generated by Chrome (chrome://cache)
#!/bin/sh
#
# Just run this command (usage notes below):
pbpaste | xxd -r - FILENAME.EXT
# Script: restore_file_from_chrome_cache
# Author: Louis Rawlins (email@louisrawlins.com)
# Date: November 17, 2016 at 4:35:39 PM PST
# Description: Restore cache files from hex generated by Chrome (chrome://cache)
# Requires: macOS
#
# Usage:
# Visit chrome://cache in your Chrome browser
#
# Find the file you want to restore, it will be in hex format
#
# Copy all hex values (stuff that starts with "00000000:") to the end
#
# Run this command in the terminal (you can, and should, run this manually)
#
# Notes:
# Use "xclip -o" in Linux to paste the clipboard
#
# Use "/dev/clipboard" in Cygwin for Windows to paste the clipboard
#
# Read "% man xxd" to understand what's really happening
#
# Resources:
# http://stackoverflow.com/questions/6133490/how-can-i-read-chrome-cache-files
# http://stackoverflow.com/questions/749544/pipe-to-from-the-clipboard
#
# Inspiration:
# https://gist.github.com/andychase/6513075
#
# # #
@krisnova
Copy link

This just saved the day for me! Thank you so much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment