openSUSE
Listing Octal Numerical File Permissions in Linux
Submitted by badzilla on Fri, 29/04/2011 - 11:05The 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:
Linux openSUSE 11.4 Installation on Dell Latitude D430
Submitted by badzilla on Sun, 24/04/2011 - 11:46Before 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.
Linux Shell Script to cksum and Compare Local and iPod Disks
Submitted by badzilla on Sun, 02/01/2011 - 20:09After 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.
Disable Annoying System Beep on OpenSUSE 11.3
Submitted by badzilla on Sat, 27/11/2010 - 12:01If 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:/>Linux Convert YouTube Flash Video (FLV) to MP3
Submitted by badzilla on Sat, 16/10/2010 - 14:05Ever 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.
Linux Batch Prepend Header File to Series of Files
Submitted by badzilla on Thu, 30/09/2010 - 12:38Have 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
Linux Directory Batch .jpg Image Resizing and Watermarking
Submitted by badzilla on Mon, 10/05/2010 - 16:00These 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.
Bootable openSUSE Linux 11.2 64bit on a USB Memory Stick
Submitted by badzilla on Mon, 08/02/2010 - 16:29Bootable Linux USB Memory Stick Problem Solving
Submitted by badzilla on Mon, 08/02/2010 - 16:25These notes accompany my Bootable-openSUSE-Linux-11-2-64bit-on-a-USB-Memory-Stick article as a result of the numerous problems I encountered during its authoring. Hopefully this will save you some legwork.
There are three potential areas to investigate if you are having problems with your boot.
- Does your BIOS support the booting of an operating system off a memory stick?
- Can your memory stick actually boot?
- Is the image loaded onto the memory stick capable of booting?
openSUSE 11.2: Downgrade PHP 5.3 to 5.2
Submitted by badzilla on Mon, 07/12/2009 - 16:16PHP 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.