Git Product home page Git Product logo

abc_sco_unix's Introduction

The ABC of SCO Unix

Preface

Some years ago I read a quote by Abraham Lincoln about How a government must be. He said

Government of the people, by the people, for the people, shall not perish from the Earth.

Actually I first read it years ago in University when Studing about Unix in a book. But unfortunaltly I can't remember book name.

Resarch

But fortunate enouth someone in an article write about in Persian here.

gnu planet

So in there express source of quote is Book ABC of SCO Unix.

Text in Persian

After I find book name, the next step is to get book.

Find Book

So how to find ebook version.

General search engine like duckduckgo not provide result. Consulting libgen.is without success.

Next try is Intenet archive project

OK, find it in internet archive. But in there we can only review and borrow.

How to Download

By Installing firefox extention Internet Archive Downloader we can grab pdf file.

$ ls -ltrh
-rw-r--r-- 1 esmaeel esmaeel 175M Feb 28 01:05  abc.pdf

Search for quote in book

To doing search we need convert each book page to plain text

First of all convert image to plain text

In Debian we have tesseract program for this task.

Install tesseract

$ sudo apt install tesseract

Convert picture to text

tesseract eng.png out.txt

One script to do all of these steps

It is simple, just run it with bash

bash run.sh

After works finished we have a good book to read.

Search in book

Search for word in all files with grep

I want to search for "lincoln" word in all of book.

grep -ri "lincoln" out/text -A20 -B 20 -h > ~/lincoln.txt

Explaination

grep for lincoln word in all files inside the out/text directory. doing search in case intensive form i and recursivly r.

Show only 20 lines before and after -A20 -B20

And remove file name from output -h

find_speech_in_book

Lincoln said government should be “of the people, by the peo- ple, for the people.” Thompson and Ritchie designed UNIX to be “of the files, by the files, for the files.”

How to find only filename?

use grep -l

$ grep -ri "lincoln" . -l
./087.txt

This quote appeard in this file 087.txt


After all Initial question is answered well.

And I want to share it with my friends but pdf file is very huge.

$ ls -ltrh
-rw-r--r-- 1 esmaeel esmaeel 175M Feb 28 01:05  abc.pdf

How to reduce scanned pdf files size?

Extract all images from pdf

mkdir images
pdfimages -all abc.pdf images/

How to reduce each image size

By reducing each part of pdf, total size will reduce.

Using convert command and set recution factore to 40%

With try of fail method I find 30% factor is good enough for this ebook.

Combine images to create new book

Append images, create new pdf book.

Create new book

convert out/*.jpg abc_of_unix.pdf

Download the book

The_ABC's_of_Sco_Unix

abc_sco_unix's People

Contributors

esmaeele avatar

Watchers

 avatar

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.