Latest Publications

Restoring data from a non bootable corrupt Windows file system

backtrack In this example, we want to restore client data from a non bootable corrupt Windows file system on a working harddisk. The client want the restored data on compact disc (CD) media.

This procedure can be used with other operating systems and file systems as well.

We attach the harddisk to a computer, that support the harddisk interface, and boot the computer with a Back Track Live CD.

Back Track is a Linux operating system, that can boot from CD. Back Tracks mounts file systems automatically. Back Track comes with a huge amount of tools, ready to use.

We can now access the client data.

ls /mnt/hda1

In order to write the client data to CD, we need to transfer the files to a FreeBSD network file system from which, an Ubuntu computer, that has a CD writer, can access the files. We use secure copy (scp) to transfer the files.

scp -r /mnt/hda1 starnix@starnix:temporary

In order to preserve file names and support multiple CD’s, we archive and split the data using zip.

cd temporary
zip -s 670m -r disk hda1
ls -ld disk.z*

The result is a number of zip archives, that has been split into the necessary number of archives in order to fit each CD media. We can now write the data to CD’s. We do this by inserting an empty CD media into the Ubuntu computer. Brasero disc writer offers to write our data to the CD. We drag the first archive and writes the data to disc. Note, that the first split archive is the z01 and the last is the zip.

The client can now copy the archives from the CD’s, unzip the archives and restore the files as necessary.

Deleting files without using the trash bin on an Ubuntu operating system

ubuntu-logo The trash bin on an Ubuntu operating system, and many other operating systems as well, is a desktop feature, that some users will find usefull upon accidental deletion of files. However, the trash bin uses a number of hidden directories in order to work. These makes a mess and takes up space on file systems. These hidden directories can also be a security problem because they can contain private files.

The solution is to enable the desktop delete feature.

Press Alt and F2. Run gconf-editor. Open apps, nautilus and preferences. Find enable_delete and set it. Close the dialogue. That’s it. We can now right click a file and delete it.

Note, that secure remove (srm) should be used to delete private files.

The delete function in most operating systems simply marks the space occupied by the file as reusable (removes the pointer to the file) without immediately removing any of its contents. At this point the file can be fairly easily recovered by numerous recovery applications. However, once the space is overwritten with other data, there is no known way to recover it.

srm is a secure file removal utility for Unix and Unix-like computer systems, such as Mac OS X or Linux respectively. It is a command line utility which exercises the Gutmann 35-pass algorithm for secure file deletion.

Changing password on the Ubuntu operating system

ubuntu-logo Changing password on a Unix or Linux operating system is normally straight forward. However, changing password on an Ubuntu operating system can be a problem.

Let us test this. In our example, we want to have the password for a non privileged user changed.

We boot up an Ubuntu 9.10 operating system. We log on as a non privileged user. We click System and then click “Users and Groups”. We click our user account. We click “Change password”. We type in our current password and authenticate. We type in our new password. We retype the new password. We click “Change password”. The dialogue confirm, that our password has been changed. This seems good! We click Close. However, now a dialogue appear. It want us to authenticate again. We type in our new password. This fails. We end up with an error message, that say “The configuration could not be saved. An unknown error occured”. We log out and must try a different approach.

It seems, that changing password is an untested feature in Ubuntu.

We log on as a privileged user. Click System. Click “Users and Groups”. We click the keys to make changes and enter our password. We click the user. We click Properties. We enter the new password. We take a look at his privileges. Close. Now, we are back at the “Users and Groups” dialogue. We close that as well. We log out and log on as the non privileged user.

It worked. It seems, that only privileged users can change password for non privileged users.

Splitting and merging PDF documents

pdfsam In this digital age, scanning of documents is an important part of the document handling proces. However, not all document scanners are user friendly – and fail to scan a number of paper documents into a single multipaged Portable Document Format (PDF). Instead, users end up with a number of PDFs. Some might even be multipaged PDFs, that contains one or more pages of garbage. The solution is to split the PDFs and merge them into a single multipaged PDF.

There are a number of online tools, that can do that. However, it can be a security problem to use these as PDFs will have to be transmitted over the internet in unencrypted format. There are also a number of downloadable applications. We recommend PDFsam.

In our test of PDFsam on the Ubuntu 9.10 operating system, we want to split a multipaged PDF into single PDFs and then merge a number of single PDFs into a single PDF.

We install PDFsam from Ubuntu Software Center. When installed, we launch it by clicking Applications, Office and pdfsam.

We open the Split plugin, add our multipaged PDF, choose Burst, choose same destination as source and then run the plugin. The splitted PDFs are written as expected. We open the Merge plugin, add our PDFs, move the pages up or down as necessary, set our destination file and run the plugin. The new multipaged PDF is written as expected.

Automatic rotation, renaming and resizing of pictures

imagemagick Sometimes you need to share a number of raw pictures over the internet.

Raw pictures can have non-efficient file names from the digital camera. This makes them hard to organize and list. Raw pictures can be huge in file size. This is a problem for storage, backup, transfer, upload and download. Raw pictures can contain hidden data from your camera, camera software and picture editing software. The hidden data can include automatic data, such as timestamps, face identification and software details. That can be a security problem.

Therefore, you might want to prepare raw pictures for sharing over the internet.

In the following example, we will prepare a number of raw pictures from a digital camera for sharing over the internet.

The pictures are rotated according to their orientation data in Exchangeable Image File Format (EXIF). The orientation data in EXIF is then reset. The pictures are renamed according to the timestamp in EXIF. The pictures will have their EXIF header removed for security reasons. All this is done using jhead, which a JPEG EXIF header manipulation tool, that is perfect for this task.

jhead -autorot -ft -nf%Y-%m-%d-%H-%M-%S -purejpg *.JPG

The pictures are resized. This makes them smaller in file size and makes them fit the target. In this example, we will prepare pictures for sharing on Facebook, which uses a maximum size of 720 pixels. This is done using mogrify, which is perfect command line processing tool for this task. mogrify is a part of ImageMagick. If the picture is horizontal, the picture is resized to a maximum width of 720 pixels. If the picture is vertical, the picture is resized to a maximum height of 720 pixels. The aspect ratio remains the same.

mogrify -resize 720x720 *.jpg

If needed, we can apply grey scaling and then a blue tint. This effect will make all pictures appear blue.

mogrify -modulate 100,0,100 -fill 'blue' -tint 25 *.jpg

If needed, we can add a watermark. In this example, we will set the font type to the Kompakt TrueType font, the font size to 36, the place to bottom right, the font outline color to white, the transparency to 30% (0.3), the font RGB color code to 200,0,200 (pink), the transparency to 30%, the location to 5,0 (a little more space to the right edge) and our website address as the watermark.

mogrify -font /usr/share/fonts/truetype/opentech/kompakt.ttf -pointsize 36 -draw "gravity southeast stroke rgba(255,255,255,0.3) fill rgba(200,0,200,0.3) text 5,0 'www.opentech.dk'" *.jpg

Open Tech SmbA can help your company automate picture and image processing. Contact Open Tech SmbA by mail at opentech@opentech.dk or call Open Tech SmbA at +45 43 62 22 88.