Git Product home page Git Product logo

sparsify's Introduction

Sparsify files with contiguous zero regions

There are situations when you have a file with a lot of zeros, and you want to compress it. This is a simple utility that will compress the file by removing the contiguous zero regions.

It is especially useful for core dumps, memory dumps, and other files that contain a lot of zeros.

Usage

$ sparsify --block-size <block_size> --input <input_file> --output <output_file>
  • block_size - the size of the blocks that will be checked for zeros and sparsified
  • input_file - the file that will be sparsified; it can be - for stdin
  • output_file - the file where the sparsified data will be written

Usage for core dumps

In linux you can pipe the core dump through sparsify to avoid writing the zeros to disk by setting the following value in /proc/sys/kernel/core_pattern:

|/path/to/sparsify --block-size 4096 --input - --output /path/to/output_file

Example:

echo "|/usr/local/bin/sparsify --block-size 4096 --input - --output /var/cores/core.%p.%e.%t" > /proc/sys/kernel/core_pattern

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.