Yesterday I was trying to generate some PDFs using CakePHP and awesome CakePDF plugin. After some reading around and testing I concluded WkHtmlToPdf should be the best PDF engine to use.
So I installed it on my Debian system running
sudo apt-get install wkhtmltopdf
It installed successfully and I was able to execute the example code from wkhtmltopdf website Continue reading
If you need to merge couple (or more) different PDF documents into one, pdfresizer.com is a great online tool that can do it (and some other PDF manipulations) perfectly. I prefer this particular site because there are no watermarks and sane file size limits. Continue reading
Very simple script, for regular backup of a specific directory under Linux.
Create file backup.sh
SOURCE=/path/of/data #what should we backup
DESTINATION=/home/user/backups #where to store backups
DELETEAFTER=5 #how many days should we store the backups
mkdir -p $DESTINATION
tar -zcvf latest-backup.tgz $SOURCE
mv latest-backup.tgz $(date +%y%m%d%H)-backup.tgz
find . -name '*-backup.tgz' -mtime +$DELETEAFTER -delete
This is a simple example on how to submit HTML form data and display the response with PHP, without reloading the page (ajax request).
Here is a list of online tools for automated cleaning and beautifying of minified, messy or obfuscated code. Continue reading
Telegram is a great messaging app which supports many different platforms including Linux.
Unfurtunately, it does not run on Debian 7.x, due to unsupported libc6 version. If you are trying to run Telegram desktop client on older Debian Linux, you will likely experience similar error: Continue reading
Show total inode usage on Linux devices:
Easy way to find and list directories containing most of the file system inodes on Linux (only under the current working directory), running this command will take some time on large drives):
sudo find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
Little one liner to find and replace all occurrences of the string in all files of certain type, recursively.
find . -name "*.TYPE_OF_FILE" -print | xargs sed -i 's/SEARCH_PHRASE/REPLACE_PHRASE/g'
If you need the latest version of ImageMagick, it’s quite simple to compile it from source.
First step – install necessary dependencies and build tools. You may already have some of them, if this is not the first time you’re compiling something from source on your system. Continue reading