OpenSUSE Blog

Listing Octal Numerical File Permissions in Linux
Last edited on: 29/04/2011 - 10:05

The other day I needed the output of a directory on Linux showing the octal file permissions. It got me thinking - exactly how do I achieve this? The obvious solution would be the ls command, but a quick read of its man page suggested it couldn't be achieved that way.

In fact, the answer is with the stat command. The following syntax is required:

stat -c "%a %n" *

The -c flag says use the following format, whilst the format itself is:
%a Access rights in octal
%n File name.

So, a typical example would be:

»   Read more
Linux openSUSE 11.4 Installation on Dell Latitude D430
Last edited on: 24/04/2011 - 10:48

Before you start you will need a copy of the openSUSE 11.4 distribution; don't forget to verify the download if you have downloaded it - even broadband can scramble a few bits in 700MB. I chose the easy option - I happened to see that openSUSE 11.4 was bundled in the free cover disk in the May 2011 edition of Linux Format magazine (UK publication from Future Publishing), and it had one or two interesting articles to read too - hopefully the in-depth review of mythTV will inspire me to build a Linux-based home theater.

»   Read more
Linux Shell Script to cksum and Compare Local and iPod Disks
Last edited on: 02/01/2011 - 19:09

After being bedeviled with disk problems on my FAT formatted 5th Generation Video iPod I put together a script to checksum (cksum) the drive and compare against the checksum of the music files on my local laptop. In reality, the this script can be used to check any two drives and it is not mandatory one of them needs to be an iPod drive. All the other examples of this sort of script on the Internet I found had one basic problem - they all only checked one directory, whilst I had a tree structure under my ~/Music directory.

»   Read more
Disable Annoying System Beep on OpenSUSE 11.3
Last edited on: 28/11/2010 - 09:17

If you have ever been annoyed or embarrassed by the extremely loud system beep in OpenSUSE then you've probably trawled the Internet for a way of disabling it. There are many solutions out there, most don't seem to work. After a little trial and error I finally have the definitive solution. You need the xset command with the -b flag. So:

badzilla@laptop4:/> xset -b
badzilla@laptop4:/>

»   Read more
Linux Convert YouTube Flash Video (FLV) to MP3
Last edited on: 16/10/2010 - 17:59

Ever wanted to download music videos from YouTube, then extract the music component from the video and convert to MP3? Well here's how to do it!

Firstly, to download the videos from YouTube, you will need to install the Flashgot extension into your Firefox web browser. This will add a small icon at the bottom right of the browser, and when it detects video (such as when you go to YouTube), you will be able to click on the icon and the video is grabbed and (in my instance) saved to the /tmp directory.

»   Read more
Linux Batch Prepend Header File to Series of Files
Last edited on: 30/09/2010 - 11:38

Have you ever been in a position where you need to prepend a header file to a series of other files? Typically, if you have created a series of program files and needed to add a standard copyright notice at the top of every file in the suite, then this would be the case.

Below is a method of achieving exactly this. We are going to use the UNIX tac command line utility (cat backwards!) to achieve this, and use a shell script for statement to loop though each file in the directory.

The basic syntax will be:

tac program_file prepend_file | tac > new_file

»   Read more
Linux Directory Batch .jpg Image Resizing and Watermarking
Last edited on: 08/08/2010 - 14:22

These days whenever I take digital pictures I always make sure the image quality and image size settings are set to maximum. It makes sense since hard disk storage is cheap, and processors have the power to crunch large files under Photoshop or Gimp.

However, the problems arrive when I want to upload the images to Photobucket for my friends to access. The saved images are usually above 6MB which is a ridiculous size to attempt to upload to these free image hosting services.

»   Read more
openSUSE 11.1 to 11.2 Upgrade: Getting MySQL 5.1 to Work
Last edited on: 23/04/2010 - 10:00

A new version of MySQL, version 5.1, is part of the openSUSE 11.2 upgrade. Once you have got the basic openSUSE 11.2 upgrade working, you will discover to your horror that MySQL is not. There are a couple of changes made to MySQL at this release.

Firstly, The MySQL socket is moved to /var/run/mysql. So you will need to edit your /etc/my.cnf file. Open this file and change all occurrences of the socket path to reflect this new path. So, for example:

socket = /var/run/mysql/mysql.sock

This will occur more than once so make sure you change them all!

»   Read more
openSUSE 11.2: Downgrade PHP 5.3 to 5.2
Last edited on: 23/04/2010 - 10:00

PHP 5.3 is bundled with openSUSE 11.2 which, if you are a Drupal developer, is not a good thing. As of PHP 5.3 the function ereg_replace() is deprecated - and this function is used heavily in Drupal 6 core along with many community modules. I performed the openSUSE upgrade to 11.2, and decided to see what the net result would be with respect to my Drupal development. Drupal generates a load of warnings, most of which are more annoyances than problems, but image_cache doesn't work and I have a dependency on that module so decided to downgrade from PHP 5.3 to PHP 5.2.

»   Read more
Installing Drupal GeSHi Filter Module
Last edited on: 23/04/2010 - 09:56

The installation of the Drupal 6 Generic Syntax Highlighter (GeSHi) module is of course trivial and wouldn't be worth further consideration if it wasn't for its dependency on the GeSHi PHP Library. Every time I come to install a new PHP library on my rig I am always faced with remembering (a) where the PHP configuration file is so it can be edited with a new path, and (b) where to stick the new library on my filesystem.

»   Read more