The default setup for Munin in Debian seems to miss some packages for the mysql_ plugin.

/usr/share/munin/plugins/mysql_ suggest

will give you

Missing dependency Cache::Cache at /usr/share/munin/plugins/mysql_ line 716.

The solution was easier than excpected:

aptitude install libcache-cache-perl

and done.

 

There is a little difference between tokenize and split in Groovy:

def csv = "1,,3,4,5"

println csv.split(",")
println csv.tokenize(",")

results in

[1, , 3, 4, 5]
[1, 3, 4, 5]

Note that tokenize ignores the empty element.

Edit: I just found this blog-post covering the same topic

 

I’ve poked around the web for while to find some good resource about how to add my own controller to Magento and this turned out very usful:

http://www.about-magento.com/magento-developper-guide-howto-tutorial-5

Thanks to Pierre! =)

 

Short version

Having session/cookie problems with webkit browsers (e.g. Chrome) in Magento? Go to System -> Configuration -> Web -> Session Cookie Management and set “Use HTTP Only” to no. Have fun.

Long version

Recently I’ve to work a lot with Magento, which is indeed a very nice webshop solution once you’ve gotten over this huge API and how themes etc. work.

But there was one problem driving me nuts. It started with me not being able to log into the backend. It worked in Firefox, thus it was a minor problem until today. I needed to store some information in the session using Magentos API

Mage::getSingleton('core/session')->setImageData($imgData);

But no matter what I tried,

Mage::getSingleton('core/session')->getImageData();

always gave me NULL instead of the data I expected. Ok, time is limited and cookies will work for the temporarily stuff too. So, same game, but with cookies instead of session:

Setting stuff:

Mage::getModel('core/cookie')->set('imageData', $imgData);

Reading stuff:

Mage::getModel('core/cookie')->get('imageData');

Same result: NULL

Magento session settings

Magento session cookie settings (german)

This was the moment when I realized that this behaviour was linked to my problem not being able to log into the backend using Chrome. Long story short, yes it was!
Magento has this place where you can set your settings for cookies System -> Configuration -> Web -> Session Cookie Management or in german System -> Konfiguration -> Web -> Sitzungscookie Verwaltung). If you read the settings for this page up, you’ll find that these settings are directly linked to PHPs setcookie-function. And precisely there (screenshot in german) is the setting “Use HTTP Only” which is, for some reason, set to “yes” by default. You already guess it, one browser engine currently doesn’t support this feature, it’s webkit. Thus change this setting to “no” and for some magical reason you’ll be able to login and work with sessions in Chrome.

 

Onliner found here to reset a user password for the OpenVZ Web Panel (admin in this case)

ruby /opt/ovz-web-panel/script/runner -e production 'user = User.find_by_login("admin"); user.password = "admin"; user.save(false)'
 

A new Ubuntu version, a new game.

I guess it is the first time I have my notebook running in optimus-mode!

I’ve not fully checked it, but Ironhide looks promising and seems to work so far.

 

Having problems  installing Ubunut 11.10 via USB “An attempt to configure apt to install additional packages from the CD failed”

Use this:

sudo rm /usr/lib/ubiquity/apt-setup/generators/40cdrom
 

I’ve setup a fresh vServer-environment for a few test and developmentmachines to play around with.

When I tried to install gitolite via aptitude everything fails and the whole system is near an explosion:

root@git:~# aptitude install git-daemon-run runit
The following partially installed packages will be configured:
  runit
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
/bin/sh: /usr/bin/apt-listchanges: not found
Setting up runit (2.1.1-6.2) ...
kill: 49: No such process

dpkg: error processing runit (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      Errors were encountered while processing:
 runit
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up runit (2.1.1-6.2) ...
kill: 49: No such process

dpkg: error processing runit (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 runit

Maybe this can help someone, because below a bunch of mails on the Debian mailinglist there is a bugreport with a workaround:

If you try to install the runit package, and after the failure remove
the SV inittab entry, edit /var/lib/dpkg/info/runit.postinst and remove
the 'kill -S HUP 1', and then run 'dpkg --configure runit', does the
installation succeed, and if yes, is a runsvdir program running?

Yes it does! At least for me.

 

You’ve setup your own Gitorious and lost your password? No, problem!

SSH your way to your box and change into the gitorious-directory (mine is /var/www/gitorious)

Fire up the console

env RAILS_ENV=production ruby script/console

on sudo-systems (like Ubuntu)

sudo env RAILS_ENV=production ruby script/console

and then type in the following commands

@user = User.find_by_login("yourusername")
@user.password = "yournewpassword"
@user.password_confirmation = "yournewpassword"
@user.save

The final output should be “true” and you’ll be able to login into the account with your brand new password. Yay!

 

Holy Moly!

I just had a hard fight with my brand new Thinkpad T420s, trying to get the NVIDIA graphics to work.

After installing the properitary nvidia drivers via ubuntu unity stopped working after the restart and no nvidia driver was active.

The solution, after all, was pretty simple:

  1. Boot your notebook into the BIOS and change the display-value from “Optimus” to “Discrete”.
  2. Install the nvidia-drivers
  3. smile, that’s it

It seems that there is currently no linux-support for nvidias optimus-technology.

© 2011 Galeon's Howlingwolf Suffusion theme by Sayontan Sinha
WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera