The Sheriff is an idiot. I've met smarter sandwiches

Latest Stuff

VirtualBox 3.1.2 Out now!

As usual, there is a new version for VirtualBox.

Drupal - imagecache problems with special characters

If you upload an image with an ampersand (&) in the filename, imagecache will refuse to display the image.
After a bit of investigation I found that imagecache has a problem with a number of special characters in the image filenames.

Ubercart 1.9 for Drupal 5 and Ubercart 2.1 for Drupal 6

The current release version is Ubercart 1.9 for Drupal 5 and Ubercart 2.1 for Drupal 6.

Visit the project page on http://drupal.org/project/ubercart

VirtualBox 3.0.12 is out now

The new verison of the famous Virtualisation System is out now.

Download the VBoxGuestAdditions_3.0.12.iso using this url:

How to remove .svn folders and files in linux

This is a very short post about removing the SVN files and folders from your directories.

find ./ -name ".svn" | xargs rm -Rf

VirtualBox 3.0.4 is out

This is just a quick post that a new version of VirtualBox 3 is out.

Download the new version 3.0.4 from http://www.virtualbox.org/wiki/Downloads the VirtualBox website.

Ubercart 2.x Price Handler and Old Price

Ubercart 2.x introduced a new way of handling product prices. It is called price_handler().

This is very nice, and most of the discount and TAX modules are using this new function to override the product price, but what if you need the new price and the old price on the same product?

Let's say you would like to show your visitors the product price before it was discounted.

You obviously should not change the condribution modules or the Ubercart core. You should just simply create your own module or use the general module you have created earlier (You got one, right?) and just paste the following lines at the bottom.

This function will create the price handler. Don't forget to replace 'your_module' with your module name everywhere.

/**
* Implementation of hook_uc_price_handler().
*/
function your_module_uc_price_handler() {
return array(
'alter' => array(
'title' => t('Old price handler'),
'description' => t('Adds old price to product.'),
'callback' => 'your_module_price_handler_alter',
),
);
}

 

This function will save the original Sell Price and put it on the node object for further use.

/**
* This is just a function to save the original sell price and put it on the node.
*/
function your_module_price_handler_alter(&$price_info, &$context, &$options) {
if (isset($context['subject']['node'])
&& $context['subject']['field'] == 'sell_price'
&& !isset($context['subject']['node']->old_price)) {
$node = $context['subject']['node'];
$context['subject']['node']->old_price = $node->sell_price;
}
}

How to embed view into a page in Drupal 6

If you would like to theme you view output (and I mean hard core theming) or would like to add a view into your module generated page or just like to pass in some arguments from you modules into a view, this very quick tutorial is for you.

In Drupal 6 all the views are objects. That means if we load them into a variable, we can do pretty much anything with them. Create your view. This is the first step. If you like, add Arguments to the view, so we can pass in variables when we execute the view.

You can add a page display or a block display if you like. Both has some advantage and disadvantage. If you create a page display, you have to specify a path, but if you will only use this view inside your module, there is no point doing this. If you use the block display, you will have a nice array with two items in it. 'subject' and 'content'. Clearly the subject is the title of the block and the content, well, it is just the content. :)

Create the page menu hook in your module. This is easy, just use standard Drupal code. (if you need help, look up the hook_menu on http://api.drupal.org/api/6)

Create the page function your hook_menu will call. This is just a function returning some standard HTML code coming for your customised view.

Loading the view is very simple really:

$view = views_get_view('[view name]');

The view name is always the main name of your view. (Not the display name.) Now, depending on which display you have added to the view, use block_1 for Block Display or use page_1 for Page Display. If you have not created a display (yes, you can do this as well.) just simply use default as a display name.

The following code will execute the view's selected Display. This is part of the view object.

$content = $view->execute_display('[display name]', array([arguments]));

The $content variable could be called $block if you used a Block Display or $page if you have used a Page Display. Page will change the Title of the page, Block will eventually have a block title, header, footer, etc. (This depends on how and where you want to show your view. The arguments are more interesting: You always have to pass in an array of arguments. The item(s) inside the array have to be a string. Plus sing means AND and the space means OR between the arguments.

Drupal Cron Job Setup Howto on Linux

Cron is a time-based job scheduler in Unix-like computer operating systems. 'cron' is short for 'chronograph'.

If you would like to set up your Drupal and linux server to use the cron, these steps will help to achieve your goal.

Open up a console and change to the user which will run the cron.
Every user has it's own cron tab (which is the list of jobs cron has to run.)
If you prefer, create a new user for this job.

To access your crontab use the following command:

crontab

This will give you a summary of crontab's commands and switches.

To list your cronlist type:

crontab -l

and to edit the list:

crontab -e

If this is the first time you edit the crontab, it will ask you which editor you would like to use.
If you are unsure, use google to find out which editor is the best for you.

Inside the editor, add the following line to the end of the list:

*/5 * * * * /usr/bin/wget -O - -q -t 1 http://[your server url]/cron.php

This will execure the cron.php in every 5 minutes.

Here is a diagram of the general crontab syntax, for illustration:


*    *    *    *    *  [command to be executed]
|    |    |    |    |
|    |    |    |    +----- day of week (0 - 6) (Sunday=0)
|    |    |    +------- month (1 - 12)
|    |    +--------- day of month (1 - 31)
|    +----------- hour (0 - 23)
+------------- min (0 - 59)

* in the value field above means all legal values as in braces for that column.
The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range).

VirtualBox 3.0.2 is out now

This is a quick bug fix release.
Find more info about VirtualBox 3 here:
http://www.42droids.co.uk/virtualbox-300-out-now

Releasing Neatx, an Open Source NX Server

A free implementation of an NX server based on NoMachine's libraries named FreeNX was published in 2004 by Fabian Franz. FreeNX's primary target is to replace the one closed component and is written in a mix of several thousand lines of BASH, Expect and C, making FreeNX difficult to maintain.

Last week, Google Code released the source code of their own proof-of-concept implementation of an NX server, Neatx. Designed from scratch with flexibility and maintainability in mind, Neatx minimizes the number of involved processes and all code is split into several libraries. It is written in Python, with the exception of very few wrapper scripts in BASH and one program written in C for performance reasons. Neatx was also able to reuse some code from another Google Open Source project, Ganeti. The code still has some issues, but we're confident interested developers will be able to fix them.

Also, Neatx implements features not found in FreeNX, such as the drop-down menu for session control in rootless sessions. At the same time, not all of FreeNX's features are implemented in Neatx.

Find the Development page here: http://code.google.com/p/neatx/
Link to the original article: http://google-opensource.blogspot.com/2009/07/releasing-neatx-open-sourc...

VirtualBox 3.0.0 is out now!

VirtualBox 3.0.0 - This version is a major update.
Find full features list and bug fixes on:

http://www.virtualbox.org/wiki/Changelog

Main features:

Guest SMP with up to 32 virtual CPUs (VT-x and AMD-V only;
Windows guests: ability to use Direct3D 8/9 applications / games
Support for OpenGL 2.0 for Windows, Linux and Solaris guests

As usual, find the VBoxGuestAdditions.iso with us.

Download the VBoxGuestAdditions.iso file from:

http://download.virtualbox.org/virtualbox/3.0.0/VBoxGuestAdditions_3.0.0...

Download the latest version (3.0.0) of VirtualBox from:

http://www.virtualbox.org/wiki/Linux_Downloads

USB setup Howto:

http://www.42droids.co.uk/setting-usb-ubuntu-904

Don't forget to remove any old version before installing VirtualBox 3

VirtualBox 3.0 Beta 2 released

Only one week after the first beta was released, VirtualBox developer Frank Mehnert has announced the availability of the second beta of version 3.0 of the open source desktop virtualisation application for x86 hardware.

Setting up USB on Ubuntu 9.04

Start using VirtualBox 2.x USB support by following these easy steps.
Thanks to virtualbox.org and Ibrahim Ben Faruhn.

42droids blog is now running on Drupal 6

Ok, I have finished this project quicker then I first thought.
The 42droids blog is running on Drupal 6.
The most important feature is that now you can comment the posts.

Drupal 6

It is time to revise my 42droids blog and rewrite it in Drupal 6. I already started this project and expect to finish it next week. (If I can finish off the mercure project early next week.)

mysql update replace

You sometimes run into the problem that you want to replace a substring occurring in a column with a different string, without touching the rest of the string. The solution is surprisingly simple, thanks to MySQL

Ubercart RC2 released and how to hide the Qty. field from cart

This post is not about the new Ubercart release but about hiding the Qty. field on the cart page. ;)

add this code to your new/old module to make the Qty. field go away.


<?php
function mymodule_form_alter(&$form, $form_state, $form_id) {
	if ($form_id == 'uc_cart_view_form') {
		//This line disables qty column
		unset($form['items']['#columns']['qty']);
		//This loop denies access to all qty fields for the form
		foreach($form['items'] as &$item)  {
			if (is_array($item) & isset($item['qty'])) {
				$item['qty']['#access'] = 0;
			}
		}
	}
}
?>

virtualbox 2.2.2 VBoxGuestAdditions.iso

Hello. as the new version of VirtualBox been released you might wonder where you can download the Guest Additions iso from.

VirtualBox version: 2.2.2

linux locale several error

If you got one or more of the following errors try to use the command below:


perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = "en_GB.UTF-8",
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Try to reinstall the local languages: (english pack)


sudo apt-get install --reinstall language-pack-en

How to move all the files from several subdirectories to a single dir?

How to move (or copy) all the selected files from several subdirectories to one single directory?


find [from_dir_name] -iname "[your file names like *.txt]" -exec mv {} [target dir name] \;

Just change mv to cp to copy.
Good luck.

How to change the more link. Drupal Views Blocks

In Drupal 5.x with the Views module we can easily create content listing blocks. There is an option for switching on the "more" link on the Views edit page. If you would like to change the word "more" to something else, you can add the following code to your template.php in the theme folder:


/**
 * Override the more link on view block
 */
function phptemplate_views_more($url){
   return "" . l(t('[Read more]'), $url) . "";
}

Don't forget, that this function will override every "more" link on every block.
If you would like to theme only one "more" link, you have to come up with a better idea. Sorry :)

Super! Ubercart 2.0 beta released for Drupal 6

Ubercart has a beta release for use with Drupal 6, and it's ready to have the snot kicked out of it by some hard-hitting testers. Most of the changes from Ubercart 1 are internal, so experiencing Drupal 6 will probably be the biggest difference.

How to clone a VirtualBox machine

To clone a Virtual Machine in VirtualBox, first go to:

/home/[username]/.VirtualBox/VDI

in the console, use command:
(don't forgot to change the virtual disk name to your existing virtual disk name.)

VBoxManage clonevdi vm1.vdi vm2.vdi

VirtualBox Linux - How to add vboxguestadditions.iso

If you don't have the vboxguestadditions.iso for your virtual machine, you can download it from here:

http://download.virtualbox.org/virtualbox/2.0.4/VBoxGuestAdditions_2.0.4...

wga.dll file information

Description: File wga.dll is located in the folder C:\Windows\System32. The file size on Windows XP is 156160 bytes.
This .dll file is a Browser Helper Object (BHO) that runs automatically every time you start your Internet browser.

Drupal 6.4 and 5.10 released

Drupal 6.4 and Drupal 5.10, maintenance releases fixing problems reported using the bug tracking system, as well as critical security vulnerabilities, are now available for download.

Multi-Touch 3D Hologram Display Is Here

The creative cats and kittens at Obscura Digital have put together a stunning piece of performance art / data manipulation demo which combines their proprietary multi-touch software with Musion's Eyeliner 3D holographic projection system. Like that BMW installation we saw recently, this is one of those odd combinations of technology and art which is best seen in action rather than described -- so check out the video after the break and see the work in all its mind-bending glory.

Ubercart 1.3 Released

Ubercart 1.3 has been released a few days ago.

ubercart.org:

Well, I'm heading out for the day without accomplishing much coding... those days aren't as much fun as the days we get to hack away on core, but we did manage to get other Ubercart related work done.

The Six Dumbest Ideas in Computer Security

There's lots of innovation going on in security - we're inundated with a steady stream of new stuff and it all sounds like it works just great. Every couple of months I'm invited to a new computer security conference, or I'm asked to write a foreword for a new computer security book. And, thanks to the fact that it's a topic of public concern and a "safe issue" for politicians, we can expect a flood of computer security-related legislation from lawmakers. So: computer security is definitely still a "hot topic." But why are we spending all this time and money and still having problems?

MSI VR600 series

Do you have an MSI VR600 laptop? If you plug your headphone in, the speakers are still working? Well, here is a way to fix this problem:

Sketcbook

Sam: So, that £5 gorgeous sketchbook I bought today?

a vendég

- oh, hát te ki vagy? és mit csinálsz itt, a szobámban kora reggel?
- nem tudom. ki vagyok? és mit csinálok itt a szobádban kora reggel?

Juno

Megnéztem a Juno c. filmet, s hát be kell ismernem, a legjobb film volt amit mostanában láttam. A történet nagyon tetszett és a zene is isteni. Csak ajánlani tudom mindenkinek. :)

Drupalcon, Szeged, 2008

Nagyszerû hírt olvashattunk a napokban a drupal.org-on. Szegeden rendezik meg a 2008-as Drupal Konferenciát.

Free Hugs

Free Hugs campaign all around Scotland.

Ubercart 1.0 RC 2

Just a quick news, Ubercart 1.0 RC 2 is out now.
find it on: http://www.ubercart.org/

Ez történt

Szóval, ja. már jó régóta nem jelentkeztem, tudom. De, az életem mindenféle furcsa kanyarokat vett, így aztán nem volt innyemre való blogot írni. Most viszont megteszem. Talán csak pár szóban, talán hosszabban.

Discount module

Az új Discount module jól mûködik együtt az Ubercart Beta 6 verzióval.

Ubercart magyar fordítás

*UPDATE*
* Figyelem! Ez a bejegyzés idejét múlt.
Ubercart: www.ubercart.org
Magyar fordítás: http://l10n.privnet.biz/translate/languages/hu

*1 Legfrissebb Ubercart verzió: 1.6

Nagy csend

Tudom, nagy a csend mostanában, de ez azt hiszem mindig így van nálam. Egyszer írok, aztán meg nem.
Nos, ami eddig történt, dióhéjban: