Boiled brandy aka Kuvana rakija

Posted in category Food & Drink

Kuvana Rakija which exact translation would be ‘boiled brandy’.

1 spoon sugar
200ml brandy
100ml water

- Dissolve sugar
- Add brandy (sljiva)
- Dilute with water
- Wait until boils
- Put on fire
- Enjoy

*add clove for aroma

Move WordPress to a new domain / location

Posted in category Wordpress

How to move WordPress to a new location in few steps.

- move files, addapt .htaccess, wp-config.php if needed

- backup database

- run the following queries (replace old_url.tld, new_url.tld with actual data)

 

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old_url.tld', 'http://www.new_url.tld') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.old_url.tld','http://www.new_url.tld');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old_url.tld', 'http://www.new_url.tld');

- check if everything is working fine

Qmail – Enable/Disable ClamAV

Posted in category Unix/Linux

The ClamAV scanning feature can be disabled in the qmail’s simcontrol configuration file. This will not disable the clamav daemon but will disable active scanning.

edit: /var/qmail/control/simcontrol

there should be text like this:

:clam=yes,spam=yes,spam_passthru=yes,attach=.vbs:.lnk:.scr:.wsh:.hta:.pif

what we need to do is to replace clam=yes with clam=no. If you don’t have this text insert it.

Next we need to run /var/qmail/bin/simscanmk to rebuild the changed configuration.

qmail & vpopmail – how to add domains and users

Posted in category Unix/Linux

Using vpopmail you can easily add domains and users to your qmail configuration.

To add a domain:

$ vadddomain  domainname.tld

To remove a domain and all its mailboxes:

$ vdeldomain domainname.tld

To add a user mailbox on domainname.tld:

$ vadduser username@domainname.tld  userpassword

To remove a mailbox on domainname.tld:

$ vdeluser username@domainnaime.tld:

You can find more information on the Vpopmail Wiki Page.

MySQL – Get the Top N of a Group

Posted in category Database

Getting Top N of a group would be very easy if there just wasn’t that ‘LIMIT & IN/ALL/ANY/SOME subquery’ restriction. But there’s always some way around. Thx to Jon Armstrong from A little Noise for the code hint.

MYSQL table 'measurements'

| Id | Freq | Level | DateM

## Gets the last 2 measurements for each frequency

SELECT t1.* , COUNT(t2.Id) AS cnt FROM measurements AS t1
LEFT JOIN measurements AS t2 ON (t1.DateM, t1.Id) <= (t2.DateM, t2.Id) AND t1.Freq = t2.Freq
GROUP BY t1.Id , t1.DateM, t1.Freq HAVING cnt <= 2 ORDER BY t1.Freq, cnt ;

## Format the result as | Freq | Level1 | Level2

SELECT t1.Freq, MIN(t1.Level) as 'Level1', MAX(t1.Level) as 'Level2'
FROM (SELECT t1.* , COUNT(t2.Id) AS cnt FROM measurements AS t1
LEFT JOIN measurements AS t2 ON (t1.DateM, t1.Id) <= (t2.DateM, t2.Id) AND t1.Freq = t2.Freq
GROUP BY t1.Id , t1.DateM, t1.Freq HAVING cnt <= 2 ORDER BY t1.Freq, cnt) as t1 GROUP BY t1.Freq;

Linux- Recursively change permissions on files or directories only

Posted in category Unix/Linux

If you wondered how to change permissions recursively on files or folders only, here is the how to using the find command.

Change permissions recursively to directories only:

find /path/to/folder    -type d    -exec  chmod 0755   {}   \;

Change permissions recursively to files only:

find /path/to/folder    -type f    -exec  chmod 0644   {}   \;

Apache .htaccess – Allow / Deny access from certain IPs

Posted in category Unix/Linux, Web

If  your website is under contruction and you want to allow access just to certain IP numbers, placing the following code in the .htaccess  file, in the website root directory, you can block access to everyone except the IP numbers you specify.

order deny,allow
deny from all
allow from 76.33.193.98
allow from 84.23.122.204
allow from 93.34.133.203

If you wish to deny access to specific IPs use the following code:

order allow,deny
deny from 192.168.0.1
deny from 192.168.0.2
allow from all

The Fabulous Logic Analyzer – Problems during port initialization

Posted in category Electronics, Microcontroller

“TFLA-01 is a simple logic analyzer for the PC.  This one consists of a simple schematic which is attached on the PCs parallel port (a real parallel port is highly recommended, not a USB adapter) and which can analyse H and L levels of 8 inputs. On the PC, there’s running a graphical program which displays the contents.”

You can get the schematics and read more about it on tfla-01.berlios.de

There is a chance that you might get into problems with the parallel port initialization.  The error message might look like:  “An error occurred while colecting data: There was a problem during port initialization. This could be because another driver has opened the port exclusively, or other reason.”

There is a solution to this and it’s name is giveio.sys Read the rest of this entry »

Expand a Flash movie in height and width by 100%

Posted in category Web

To expand a flash movie (.swf) by 100%  you have to set its height and width to 100%. But that’s not enough. The parent container the movie is sitting in needs to be 100% w/h too. By default all DIVs are 100% wide but they don’t expand 100% in height. To accomplish this set the css property height to 100% for the HTML and BODY tags and the DIV tag the flash movie is residing in. Read the rest of this entry »

My Garmin Forerunner 305 doesn’t power on – It’s just DEAD! The Solutions.

Posted in category Sports

If you experienced the same problem as I did and your Garmin Forerunner 305 just doesn’t turn on then try one of the steps i describe below to bring it back to life. Beside not responding to any buttons the computer doesnt recognize it either when connected through the USB interface.

I’ll present you with a few solutions I found surfing the web that might work for you. Read the rest of this entry »