Multiple images to one paged pdf file

If you want to make one pdf-file that exist of multiple A4 pages with one each page a jpg-image.

Create a directory and drop all jpg images in that directory.
Launch this command in that directory

convert *.jpg -resize 575x823^> -bordercolor '#ddd' -border 5x5 -page A4 -background white -extent 595x842 "FILE NAME.pdf"

Compress PDF files

Compressing PDF file can be don on many different ways. This is how I got the best result. By compressing a 14.4MB file with big HiRes pictures to a 2.7MB file for screen use.

In Ubuntu (Linux) open the PDF in a PDF viewer

Print the PDF to a file with the file -> print -> ps, name the file output_print_to_file.ps ( this makes a large postscript file)

Find a file created on a specific date

Sometimes you're looking for a file on a Linux file system that was created on a specific date without knowing the name or place of the file. This can be very useful if you suspect configuration change by update or a hack.

Best way to accomplish this is using the find command like this:

This commands find all files created or modified om 2014-10-15

Bash script to resize images recursively and place them i a new directory

Running out off disk space on you mobile device like Tabled, Phone of laptop and because of the big file size of your photo files? But you do not want to delete your photos? Resize them to small files.

Rename corrupt file like FILE0000.CHK and FILE0001.CHK to the right extention

Last week a friend of me what in a huge stress because he couldn't read the music and photos anymore from his USB-stick / pen-drive.

First make a copy of all file to you localmachine (you never know). Than place this script in the same directory as the file. chmod and run.
That's all!

Dynamic Copyright message in Drupal footer

If you want a dynamic footer in Drupal footer you can use thsi script.

The first year the messages sais:
Copyright© 2014PBC-techniek

All following years like:
Copyright© 2014-2015 PBC-techniek

The years are automaticly added


<?php
$FROM=2014;
$NOW = date('Y');
if ( $NOW == $FROM ) {
$DATESTRING = $NOW;
} else {

Drupal D7 Ellfinder elfinder-7.x-2.x-dev error "Invalid backend response.Data is empty"

I have a very strange situation with Elfinder. I developed a Drupal D7 website on a development (Ubunt 12.04) server. Everything, including CKEditor and Elfinder works perfect. I migrated the website (file system and mysql database) to a Zpanel Linux Ubuntu 12.4 server and I didn't get elfinder working any more.

Create test files of specific size

Sometimes you need file of an exact site for testing purpose like an email attachment.

Here is how you make them in Linux command line:

dd if=/dev/zero of=file_5Mb.txt bs=1k count=5120
dd if=/dev/zero of=file_7Mb.txt bs=1k count=7168
dd if=/dev/zero of=file_8Mb.txt bs=1k count=8192
dd if=/dev/zero of=file_8.8Mb.txt bs=1k count=9011

Create test files of specific size

dd if=/dev/zero of=file_5Mb.txt bs=1k count=5120
dd if=/dev/zero of=file_7Mb.txt bs=1k count=7168
dd if=/dev/zero of=file_8Mb.txt bs=1k count=8192
dd if=/dev/zero of=file_8.8Mb.txt bs=1k count=9011
dd if=/dev/zero of=file_9Mb.txt bs=1k count=9216

ls ./file_* -lah
-rw-r--r-- 1 rob disk 5,0M feb 20 14:30 ./Desktop/file_5Mb.txt

How-To create company logo on ZPanel and Roundcude log-in page

Case

You're hosting a with server ZPanel for multiple customer and you want a for every customer a company logo on the ZPanel and Roundcube log-in page.

Here is How-To do that

Step 1

Create a company logo