Convert and compress PNG files to JPG in bulk

To compress PNG files to JPG, you can follow steps below: I. Convert all PNG files to JPG: Create a script using your favorite Linux text editor and type in the following lines: for i in $(ls *.png); do convert $i $i.jpg done

II. Convert the JPG quality to 50% compression To compress the JPG . . . → Read More: Convert and compress PNG files to JPG in bulk

No spaces after commas in all WordPress site posts – Atahualpa theme

In the Atahualpa theme on your wordpress blog, you would find that posts do not display a space after commas or special characters. Internally, in the database, the spaces are correctly stored. This is a bug in Atahualpa theme and you can fix it.

To resolve, look for the BUGFIX for it on the bytesforall.com . . . → Read More: No spaces after commas in all WordPress site posts – Atahualpa theme

Mount truecrypt volume in a Linux shell / terminal

Truecrypt has one of the most user-friendly GUIs for mounting encrypted volumes or container files. However, if you do need to use the command line, use it as shown below.

To mount a truecrypt volume using the shell, use following command: # truecrypt -t truecryptfile /media/truecrypt

Enter the password and the contents of the truecryptfile . . . → Read More: Mount truecrypt volume in a Linux shell / terminal

Network variable settings in Linux

Available in /etc/sysctl. Somewhere on the system.

Change /etc to /etc/hostmine

# echo “hostmine” > /proc/sys/kernel/hostname

Looping in Linux Shell Script

for i in *.mp3; do mv “$i” echo $i | tr `’ ‘ ‘_’`; done

In above tr `’ ‘ ‘_’` will replace all blanks in middle of filenames to _ (underscore).

To make all filenames lower case: for i in *[Mm][Pp]3; do mv “$i” `echo $i | tr `[A-Z]’ `[a-z]’`; done

Bulk rename of files in Linux

# for i in *.JPG; do j = `/usr/bin/basename $i.JPG` \ && echo “mv $i $j.jpeg”; done To check out if the command works as intended: # for i in *.JPG; do j = `/usr/bin/basename $i.JPG’ && echo “mv $i $j.jpeg”; done /sh

PHP Subdirectory Configuration

PHP does not recognize or insert include files

Solution is to:

# vi /etc/php.ini

Modify line:

include_path = “./usr/share/php:/home/httpd/php”

:wq

. . . → Read More: PHP Subdirectory Configuration

Convert many jpg files

$ vi conv.sh <enter>

Insert for i in $(ls *.jpg); do convert -geometry 120×120! -compress jpeg -quality 50 $i $i.cjpg -bordercolor blue done :wq

Set the above batch file to executable: $ chmod u+x conv.sh <enter>

To execute the program: $ ./conv.sh <enter>

PHP server side scripts

<? php>

echo “Hello World\n”

<?>

January 2019
M T W T F S S
« Sep    
 123456
78910111213
14151617181920
21222324252627
28293031