bash

How to shuffle slyly a list of file with a bash script

Submitted by Nicola Rainiero on 2017-02-12 (last updated on 2017-02-13)
How to shuffle slyly a list of file with a bash script

I present a little bash script to change the alphabetical order in a specified or working folder of files, simply adding a random prefix and checking that the resulting one differs from a fixed number of previous elements. I wrote it to shuffle a list of songs that I usually listen to my poor car radio, but I think that it could be useful also for presentation of a series of pictures via usb pen and a TV. In addition this script has a clean option that can rename the files to the original version, useful for make another mix.


Locate large files or directories on Linux with bash

Submitted by Nicola Rainiero on 2017-01-16 (last updated on 2017-01-25)
Locate large files or directories on Linux with bash

From a discussion on Super User, I have discovered an awesome tool that helps you to locate the largest files or directories in your computer, just typing a single command line on a bash terminal. I have only added some code to create a text file without the annoying message "Permission denied". In the article there is also a list of the most famous analyzers for linux.


A bash script to convert the color palette of a PDF into CMYK

Submitted by Nicola Rainiero on 2015-06-07 (last updated on 2016-08-11)
A bash script to convert the color palette of a PDF into CMYK

It happens that you have to print for job or personal pleasure, one or more posters in a big format and like me you don't use famous commercial software and you aren't a professional illustrator. But how can the color palette of your document fit the request of the typography? This post tries to show a simple conversion of a PDF from RGB to CMYK, using ghostscript library and imagemagick in a handy bash script.


How to cut and join a MP4 video in four steps using ffmpeg

Submitted by Nicola Rainiero on 2015-04-19 (last updated on 2016-08-11)
How to cut and join a MP4 video in four steps using ffmpeg

How many time we have to fix a video removing the parts that we don’t need? There are a lot of video editing programs that solve this elementary issue, including great open source ones,  but generally they require to process the video and audio streams and so a lot of resources. FFmpeg and the command-line can cut and join the video in four steps copying the same video and audio codec even on a MP4 video encoded in h.264 and AAC.


A bash script multi-tool and easy editable

Submitted by Nicola Rainiero on 2013-05-20 (last updated on 2013-05-23)
A bash script multi-tool and easy editable

I happen very often to convert/resize/rename a directory of files, so sometimes I can fix manually file by file or if there are many of the ones, I can modify an existent bash for accelerating the process. However it is a waste of time the changing the whole file to adapt it at the new commands (hazards are always lurking!).


PDF2CBZ for a better legibility on eReader

Submitted by Nicola Rainiero on 2012-09-04 (last updated on 2015-06-01)
How to convert PDF to CBZ for a better legibility on eReader

I admit it: my ebook reader has many problem in loading some type of PDFs, though I had made various tricks to fix this problem, like my site can testify! In last days I have tried a new approach, the conversion to CBZ, a type of archive file for the purpose of sequential viewing of images especially comic books. And for now, it works!


Script to add bookmarks and toc in PDFs

Submitted by Nicola Rainiero on 2012-08-01 (last updated on 2013-01-30)
Script to add bookmarks and toc in PDFs

In the previous article I explain how to insert toc and/or bookmarks using LaTeX in a PDF document, omitting a very boring aspect: selection and writing of all parts that you want insert in these ones (avoiding errors when the items are very numerous!). In order to automate this procedure, I wrote a small bash script that converts the output made by JPDFBookmarks in a text file pasteable in LaTeX.


Script to adapt the PDF size

Submitted by Nicola Rainiero on 2012-06-18 (last updated on 2013-06-03)
This article explains how to adapt the size of a PDF

A big gap of my eBook reader, the Asus DR900, is the maximum page zoom fixed to 200%. Generally the 200% works fine for most PDF file, but when I try to read PDF that includes double pages or document in A4 with A3 pages, the reading become very difficult. So I wrote a little bash script called set-uniform-pagination.sh that halves the pages exceeding the horizontal dimension of the first.