sudo cp usr/share/grub/*. pf2 /boot/grub
sudo update-grub
My site, devoted primarily to programming with my portfolio, articles, feelings etc.
May 10 2012
sudo cp usr/share/grub/*. pf2 /boot/grub
sudo update-grub
May 09 2012
Recently I installed Ubuntu 12.04 and it’s gEdit doesn’t recognize cyrillic (Windows-1251) encoding correctly. I discovered one-liner to make it do the task:
sudo gsettings set org.gnome.gedit.preferences.encodings auto-detected "['UTF-8', 'CURRENT', 'WINDOWS-1251', 'ISO-8859-15', 'UTF-16']"
Mar 20 2012
A list of php function functions, disabled on the servers I configured:
Continue reading “84 PHP functions for disable_functions directive”
Nov 08 2011
I like PEAR distribution system. It’s simple to use and installed packages are globally available to all your server scripts (of course, this is an advantage only when you mean it to be). But to easily use packages, installed into PEAR, they should follow some conventions, which are rather old these days, when PSR-0 is out there.
I installed Monolog library using PEAR into my system and found, that it hasn’t bundled autoloader. So, I cannot just require() one file in Monolog and start using it, after it has been installed into PEAR. I need to configure my autloader. And to configure my autoloader, I need to know the exact path of PEAR installation.
The best way I found so far to do that is stream_resolve_include_path() function. So, I’ve done that like this:
Continue reading “Autoloading PEAR incompatible classes, installed from PEAR packages”
Oct 30 2011
I was implementing simple menu, that would allow user to change site language. The site uses standard symfony2 localized urls like http://www.example.com/en/contact. The problem was to return user to a page, where he previously was, but rendered in a selected language. I didn’t like to do any find/replace on REFERER.
Let me show you my solution. Continue reading “Symfony2: how to redirect user to a previous page correctly (without using HTTP_REFERER)”
May 02 2011
Some time ago I blogged about creating nice PDO wrapper. Recently I’ve created a repository for my small PDO wrapper on GitHub: https://github.com/FractalizeR/phpSweetPDO
Library is released under Apache License. Feel free to use it!
Apr 23 2011
Jan 25 2011
Today I stumbled upon a good site – http://vbtruth.com/
If you want to know anything about Internet Brands suit against XenForo, you should definitely visit it and read some pages about so-called “idea stealing proofs” of IB.
I enjoyed reading it really.
Nov 17 2010
Hello.
Recently I was upgrading my websites on Joomla and moved them to PHP 5.3. I noticed too many errors from mod_slick_rss extension coming to PHP log. I’ve fixed them and added some new options:
You can download updated version here.
Nov 11 2010
Recently I had a task to split a given string at capitalized characters, having those saved in PHP. I’ve invented the following solution:
<?php
$str = 'TestMyFuncCall';
var_dump(preg_split('/(?=[A-Z])/', $str, null, PREG_SPLIT_NO_EMPTY));The result is:
array(4) {
[0]=>
string(4) "Test"
[1]=>
string(2) "My"
[2]=>
string(4) "Func"
[3]=>
string(4) "Call"
}
I utilize regular expressions assertions here to avoid character loss.
Nov 08 2010
Some evening I was implementing behavorial patterns in my framework’s ORM and I desperately needed something like Ruby mixin or C# extension method or like trait/graft in PHP6+. So I was curious to see how can I implement mixins in PHP. If you don’t know what mixin is, I will tell you at once.
So, I invite you to follow me on paths to implementing mixins in PHP and programming a small library to support them. This article targets beginner and average level programmers. Just be sure you know what OOP is. During the process, I will also make some small mistake about nuances of PHP 5.3 work with classes, will point to it and suggest my solution to it. Good reading!
Continue reading “Practising OOP in PHP5: emulating mixins (Ruby-like)”
Nov 05 2010
To fix this bug, you need to patch a file /usr/share/munin/munin-graph in the following way:
Continue reading “Munin: Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()”
Nov 05 2010
Hello.
Having installed Munin recently on my servers, I started to get emails from cron saying
Fatal error: Could not open "/var/lib/munin/datafile" for writing: Permission denied at /usr/lib/perl5/vendor_perl/5.8.8/Munin.pm line 727. (process:18039): Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
I also got some errors about /var/log/munin/munin-update.log being inaccessible. Somehow these files does not belong to munin:munin, but to rrdcache:rrdcache, so the solution is just to make them chmod 0777 and that should solve the problem.
Oct 07 2010
If you are going to make a decision about purchasing XenForo, I think, it will be useful for you to catch an image of XenForo admin area because it really reveals almost full XenForo potential. No text below. Just images. Have fun!
Continue reading “XenForo 1.0 Beta 1 Admin Control Panel in Pictures”
Oct 04 2010
Today, at the very edge of XenForo sales starting day Internet Brands claimed against XenForo.
Sep 17 2010
For some time I was deeply afraid of installing any new release of VBulletin to the forum I administer. But after 4.0.7 came out with several performance bugs fixed I though, that may be it’s time to install it and hoped that installation will go smooth. I closed the forum for 1 hour, blamed myself for writting “1 hour” in the closed message text because surely simple bugfix forum update cannot take longer than 15 mins, right? NOWAY. I was mistaken.
Jul 15 2010
VBulletin 4.0.5 is released. Among some bug fixes (about 50), we’ve got some new ones to laugh at.
If you install this “maintenance pack”, you will happily look at your forum usernames now contain ARG:5 UNDEFINED message. Nice, eh?
But again, as with the bugs in 4.0.4 nothing of this kind appeared on official VBulletin forum which is running 4.0.5 since yesterday. Do VBulletin developers develop bugs especially for our forums?
VBulletin QA team, congratulations on one next epic fail!
P.S. As any VBulletin user you are welcome to install this great new update with 50 bugfixes. As for me… I’ll better wait….
Jul 06 2010
class_taggablecontent.php of VBulletin 4.0.4 forum engine contains the following code:
//This seems like a terrible place to put this, but I don't know where else it should go.
if ($vbulletin->options['tagmaxlen'] <= 0 OR $vbulletin->options['tagmaxlen'] >= 100)
{
$vbulletin->options['tagmaxlen'] = 100;
}Jun 24 2010
VBulletin 4.0.1 PL 1 is now out. I was going to install it but… It does not fix any of the Known issues.
Why? Who knows…