Posts

How to make a floppy file image and mounting it in Linux

To make a file image of a floppy disk in Linux (like Ubuntu), you need (of course) a computer with a floppy drive (/dev/fd0). Insert the floppy you want to copy to an image file and issue the command:

$ sudo dd bs=512 count=2880 if=/dev/fd0 of=floppy.img 

Block size (bs) and count above is for a 1,44 MB 3.5" floppy disk.

The image file can be copied back to another floppy disk with the command: 

$ sudo dd bs=512 count=2880 if=floppy.img of=/dev/fd0

The image file can also be mounted directly from the image file without the need of a physical floppy disk: 

$ sudo mkdir /media/fd
$ sudo mount -o loop floppy.img /media/fd/

I use the above method to move the content from a number of floppy disks to my hard drives. Computers today are rarely seen with a floppy drive and I wanted to secure the content before it is too late 🙂 

 

WordPress Media crop button greyed out

In WordPress Media it is possible to edit the images in some basic ways including cropping. To use the tool you must fist make a selection in the image by clicking and dragging across the image. The selection must be wider than the smallest image setting in WordPress. Otherwise the crop tool will stay greyed out. Once a large enough selection has been made the crop button becomes clickable. This is not always logical to the user who often try to click the crop button first.

Cropping images in WordPress

Ktools PhotoStore batch image regenerate

Ktools PhotoStoreThe Ktools PhotoStore software (www.ktools.net) automatically generates thumbnails, sample and large images with watermarks of the images in the database. If you change the settings regarding the image sizes only newly added images will get the new sizes.

The following simple script regenerates / resizes the thumbnails, sample and large images from the original images. It runs in batch mode, i.e it will work on every image you have in your stock_photos folder. It will overwrite your current i_, s_ and m_-versions of your images without warning. The sizes is set in the script (it does not read the current settings in the manager).

#!/bin/sh
# ps_regenerate.sh for Ktools Photo Store - http://www.ktools.net
# Copyright 2010-12-27 HelTech Communication, Stefan Helander
# http://www.heltech.se
#
# This script may be downloaded from https://nerdia.net and used for free. It is not
# allowed to redistribute this script without written permission.
#
# Requires GraphicsMagick - gm
#
# Regenerates thumbnail, sample and large images for Ktools Photo Store.
# Copy this file to photostoreroot/stock_photos and execute it
# in that folder. If necessary adjust the sizes below.
# !!! WARNING !!! This script overwrites current m_, s_ and i_versons
# of your current images without question.
#
I_SIZE=”150″
S_SIZE=”500″
M_SIZE=”1200″
COMMAND=”gm convert”
FILES=`ls *.jpg | grep -v “^m_” | grep -v “^s_” | grep -v “^i_”`
for FILE in $FILES
do

# Make i_ image
$COMMAND -size $I_SIZE "$FILE" -resize $I_SIZE "i_$FILE"
# Make s_ image
$COMMAND -size $S_SIZE "$FILE" -resize $S_SIZE "s_$FILE"
# Make m_ image
$COMMAND -size $M_SIZE "$FILE" -resize $M_SIZE "m_$FILE"

done

WordPress insert image/video/music problem caused by plugin

When writing a post in WordPress, and you press Upload/Insert buttons to insert images, video, music or other media you can run into a problem where a popup displaying “Are you sure you want to do this?” is showing instead of the normal insert screen. The problem is described here. As mentioned in the posts, it is caused by some plugin. This can be hard to guess as the plugin in question might have nothing to do with writing and posting articles.

I ran into this problem using the latest WordPress 3.0.1. The plugin that was causing trouble for me was WP-ContactForm. By disabling it, it was possible to insert images in the posts again.

If you experience this problem, try disabling all plugins. If inserting images now works, try enabling the plugins one by one to figure out which one is causing the trouble.