Home / Community / Blog

I've noticed that in one of my old pages, based on ezPublish 4.4 ezcache script does not do anything.

I've found solution. You have to applay patch to kernel/classes/ezcache.php file. Diff looks like this:

--- kernel/classes/ezcache.php-2015-06-10       2012-05-22 18:40:06.000000000 +0200
+++ kernel/classes/ezcache.php  2015-06-11 00:30:00.126363504 +0200
@@ -451,10 +451,12 @@
         $cacheItem['iterationSleep'] = $iterationSleep;
         $cacheItem['iterationMax']   = $iterationMax;
         $cacheItem['expiry']         = $expiry;
-        $functionName = 'function';
+        $functionName = false;
         if ( $purge && isset( $cacheItem['purge-function'] ) )
             $functionName = 'purge-function';
-        if ( isset( $cacheItem[$functionName] ) )
+        else if ( !$purge && isset( $cacheItem['function'] ) )
+            $functionName = 'function';
+        if ( $functionName )
         {
             $function = $cacheItem[$functionName];
             if ( is_callable( $function ) )

Now command

php bin/php/ezcache.php --clear-all --purge

works.

I've got a question: How to add map to Navit - step-by-step.

On Android it's pretty simple. You have to press "Menu" button, then "Download maps" and choose desired region.

Today most of my sites stopped to work. After some time I've noticed that PostgreSQL has some problem with locale:

psql: FATAL:  database locale is incompatible with operating system
DETAIL:  The database was initialized with LC_COLLATE "pl_PL.UTF-8",  which is not recognized by setlocale().
HINT:  Recreate the database with another locale or install the missing locale.

I've found similar symptoms in thread "Problem with locales on Linux with 9.3.4" posted by Hubert "depesz" Lubaczewski.

My databases has collation pl_PL.UTF-8:

                                           List of databases
        Name        |       Owner        | Encoding |  Collation  |    Ctype    |   Access privileges
--------------------+--------------------+----------+-------------+-------------+-----------------------
 eztest-demo        | xxxxxxxx           | UTF8     | pl_PL.UTF-8 | pl_PL.UTF-8 |
 eztest-flow        | xxxxxxxx           | UTF8     | pl_PL.UTF-8 | pl_PL.UTF-8 |
 eztest-web         | xxxxxxxx           | UTF8     | pl_PL.UTF-8 | pl_PL.UTF-8 |

and this locale was installed:

[root@jaqb ~]# locale -a | grep pl
pl_PL
pl_PL.iso88592
pl_PL.utf8

The solution: Restart PostgreSQL ;-)

[root@jaqb ~]# /etc/init.d/postgresql restart
Stopping postgresql service:                               [  OK  ]
Starting postgresql service:                               [  OK  ]
[root@jaqb ~]# psql eztest-web
psql (8.4.20)
Type "help" for help.

eztest-web=>

That's all.

First installation. It's simple

yum install postgrey

Turn on automatic start:

chkconfig postgrey on

Check:

chkconfig --list postgrey
postgrey        0:off   1:off   2:on    3:on    4:on    5:on    6:off

Add

, check_policy_service unix:/var/spool/postfix/postgrey/socket

in main.cf file as last element smtpd_recipient_restrictions option:

Now it looks like this:

smtpd_recipient_restrictions = permit_mynetworks,
 permit_sasl_authenticated,
 reject_unauth_destination,
 reject_unknown_recipient_domain,
 check_policy_service unix:/var/spool/postfix/postgrey/socket

Restart postfix. Done.

You can check in maillog if it works:

grep postgrey /var/log/maillog

This post is copy of an "old" answer from Atmel FAQ - currently unavailable. The link still works, it pints to file AtmelAtfwSetup-6.1.133.msi.

This file needs USB driver to be updated. According to Knowledge Base you should download and install AtmelUSB.

Procedure to downgrade JTAGICE3 firmware in Atmel Studio 6.1 SP2 to maintain compatibility with older versions of Atmel/AVR Studio

Question

My JTAGICE3 no longer gets detected in older versions of Atmel/AVR Studio after getting upgraded in Atmel Studio 6.1 SP2. How do I solve this issue?

Answer

The following procedure needs to be done to downgrade the firmware:

Note: This procedure should not be followed if you need to use SAMD20 with the latest version of Atmel Studio.

1. Download and install “Atmel Firmware downgrade” utility from the below link:

http://gallery.atmel.com/Products/Details/c578bdc7-3f6a-4ff1-b2c1-8419ba25dce7

2. After installing, Go to Start menu --> Atmel --> Downgrade connected JTAGICE3 to Firmware V2. This will downgrade the firmware version of JTAGICE3 which is connected to the PC.

3. After downgrading the JTAGICE3 firmware using “Atmel Firmware downgrade”, to prevent Atmel Studio 6.1 SP2 from upgrading your Jtagice3 again, you will have to replace

[program files]\Atmel\Atmel Studio 6.1\tools\JTAGICE3\jtagice3_fw.zip

with

[program files]\Atmel\AtmelAtfw\jtagice3_fwv2.zip

This should make the JTAGICE3 to work with Atmel Studio 6 SP2 as well as the older versions of Atmel/AVR Studio.

I've tried to install virtual Linux on my second HDD (using optical bay adapter). To add physical drive you have to type command:

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" \
internalcommands createrawvmdk -filename \
"C:\Users\jaqb\SP900.vmdk" -rawdisk "\\.\PhysicalDrive1"


(based on Using a raw disk as a VirtualBox drive in Windows 7 by Dan Fox) In my case I've to add full path to VBoxManage.

Then to install additional packages in CentOS 7 (using minimal installation) you have to manually enter full URL:

http://mirror.centos.org/centos/7/os/x86_64/

(How To Install CentOS 7 Via NetInstall)

If you want be able to download all attachments at once you have to explicitly enable zipdownload plugin in config.inc.php file:

$config['plugins'] = array( ...  , 'zipdownload' ... );

so simple...

I have a very old Lego RCX 1.0 but I couldn't program it. I supposed it was because of incompatibility, virtualized XP, or not supported USB<->RS232. I decided to build "new" tower. First I tried to use project from robotics.sk based on 555 timer, but all these capacitors, potentiometers and oscilloscope to calibrate... hello it's XXI century we have microcontrollers everywhere.

I've used arduino nano (some clone) only to generate 38kHz signal - based on comment in PWM at 38KHZ with Arduino article.

The IR receiver pinout is from TSOP4838 (GND in the middle) not TSOP1238 (Vs in the middle).

The whole program looks like this:

#define IR_CLOCK_RATE    38000L
#define pwmPin      11   // IR Carrier 

void setup()  { 
  // toggle on compare, clk/1
  TCCR2A = _BV(WGM21) | _BV(COM2A0);
  TCCR2B = _BV(CS20);
  // 36kHz carrier/timer
  OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1);
  pinMode(pwmPin, OUTPUT);
} 

void loop()  { 
}

Now I wanted to check if it works with my RCX birck, so I've downloaded Bricx Command Center 3.3 and installed it based on Programming Lego Robots using NQC tutorial.

Next I founded firm0328.lgo file, the RCX firmware version 3.28. It is one version for RCX 1.0, 1.1 and 2.0. You can google for it or check this sites:

This file is need when you lost power (ie. change batteries) - you can do this (based on bricxcc) using Tools -> Download firmware. It takes some time.

Now I was able to program and control my RCX brick again.

If you would like to use F*EX, but you have only one IP and you can't/don't want to use different port there is a solution!

The Morten Minde Neergaard method almost work. In my case I've prepared file (let's say fex.conf) in /etc/httpd/conf.d/:

<VirtualHost 2.3.4.5:80>
    ServerName fex.mydomain.org
    ProxyPass / http://127.0.0.1:88/
    ProxyPreserveHost On
</VirtualHost>

and setup F*EX (/etc/xinetd.d/fex):

service fex
{
        [...]
        bind                    = 127.0.0.1
        port                    = 81
        [...]
}

note I've changed also the port F*EX listen on.

The only thing I had to change in F*EX source code was one line added in lib/fex.pp file:

--- fex.pp-2014-11-01   2013-07-27 01:41:43.000000000 +0200
+++ fex.pp      2014-11-01 00:22:19.384463319 +0100
@@ -137,6 +137,8 @@
     }
   }

+  $port=80;
+
   # use same protocal as uploader for download
   if ($ENV{PROTO} eq 'https' and $port == 443 or $port == 80) {
     $durl = "$ENV{PROTO}://$host/fop";

to fix links to files sent by F*EX to point to port 80 instead of 88. Without this little change links looks like this:

http://fex.mydomain.org:81/fop/NUQLEo5c/testfile.txt

I don't know if there is other method not to sent F*EX port to clients or maybe there are some changes in newest version. I've tested it on, quite old, 20130805 release.

There is "small" difference between

chcon -t some_file_type_t /some/file

and

semanage fcontext -a -t some_file_type_t /some/file
restorecon -v /some/file

The first one only set contex for specified file, but when file id deleted and created again or restored from backup (ie. tar without --selinux attribute) the changed context is not restored.

To permanently change context to file or some files, even created you have to use semanage:

semanage fcontext -a -t fome_file_type_t "/some/dir(/.*)?"

to change context to directory /some/dir and all files in this directory.

Just my blog...

Mon Tue Wed Thu Fri Sat Sun
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30