Friday, October 13, 2017

imagemagick convert append multi jpg into a big jpg photo

First install the Imagemagick.

convert is a sub command from Imagemagick.

To make a long JPG file:


Vertical connect:
convert _TOP.jpg _MID.jpg _BOT.jpg -append FULL.jpg


Horizontal connect:
convert _LEFT.jpg _CENT.jpg _RIGHT.jpg +append FULL.jpg


4 Panels:
convert \( image_left_up_1 image_left_down_2 -append \) \
\( image_right_up_3 image_right_down_4 -append \) +append FULL.jpg



Again, I love opensource!

All credit goes to https://www.imagemagick.org/

Thursday, October 5, 2017

Configuring Wordpress Automatic Background Updates Plugin

Don't want always login to my WP admin Dashboard just for update the Plugin.

Here is how I do it:

Manually create folder: wp-content/mu-plugins/
Then put auto-update.php in there.

<?php
/*
Plugin Name: Plugin Background Auto-Update
Description: Automatic updates installed plugins and themes.
Author: Lambert@MillionDollarServer.com
*/
// [Configuring Automatic Background Updates] Reference: https://codex.wordpress.org/Configuring_Automatic_Background_Updates
// [Must Use Plugins] Reference: https://codex.wordpress.org/Must_Use_Plugins
// [Writing a Plugin]]Reference: https://codex.wordpress.org/Writing_a_Plugin
// Automatic updates for All plugins:
add_filter( 'auto_update_plugin', '__return_true' );
// Automatic updates for All themes:
add_filter( 'auto_update_theme', '__return_true' );


Make sure the permission:

chown -R www-data:www-data wp-content/mu-plugins/


And enjoy your day!

Monday, October 2, 2017

String matchs for not in the Second File

Try to clean some old files/folders:


sort active.list > active.sort
sort all_dir.list > all_dir.sort

# grep -i -F -x -v -f active.sort all_dir.sort > del_list &


This will find all [ (all_dir.sort) - (active.sort) ] put it into [ del_list ].
Case insensitive.


#!/bin/bash

while read DIR_NAME; do
        echo "Moving $DIR_NAME."
        mv ./$DIR_NAME/   /archive/
done <del_list