full of … these

Save ‘less’ buffer to file

Posted: May 23rd, 2013 | Author: | Filed under: howto, linux | Tags: , | 1 Comment »

The site that originally hosted this useful trick is not accessible any more.

The original was at: http://kerneltrap.org/node/17043

Source of the text below is http://webcache.googleusercontent.com/search?q=cache:http://kerneltrap.org/node/17043&strip=1


to save the buffer that is being displayed by a session of `less’, use its pipe-to-shell-command capability by scrolling to the top of the file and press `|’ followed by `$’ as well as entering `tee DESTINATION_FILE’ when prompted for the shell command.


trac: already updated: Error binding parameter 3 – probably unsupported type

Posted: October 20th, 2010 | Author: | Filed under: howto, linux | Tags: , , , , | No Comments »

I’m sick today, but, here is a short one.

If the user cannot log in into trac after a self password reset and you receive this message:

user.name already updated: Error binding parameter 3 - probably unsupported type.

all you need is to delete the cached users session in the sqlite database.

First make a backup:  cp trac.db trac.db-backup
Now you have to find the sessions stored in the database:
sqlite2 trac.db
select * from session_attribute;

Find the user with the problems and delete his data:
DELETE FROM session_attribute WHERE sid = "user.name";

Now test.
Please do backup the database first.

Trac detected an internal error: AttributeError: ‘NoneType’ object has no attribute ‘replace’

Posted: February 17th, 2010 | Author: | Filed under: howto, linux | Tags: , , , , | No Comments »

I was trying to fix the error from the title for a few months now.

It was about using tracdownloader plugin from: http://trac-hacks.org/wiki/TracDownloaderPlugin

I have applied the patch it worked, but it stopped.
I have tried almost everything, like other linux distro or python2.5 or python2.6.

My mistake was in trac.db, the default sqlite database of trac.

When I finally decided to manually import the tables from the old database into a new one: downloader_category, downloader_downloaded, downloader_downloaded, downloader_release.
When I had to import downloader_release tables rows I have noticed that the last one from the dump is:

INSERT INTO downloader_file VALUES(19,7,NULL,NULL,NULL,NULL,1261067753.63897,NULL);

I have no ideea how that row was added there, but, after removing that one from the original database tracdownloader start to work again.

So, next time you encounter this error verify you code to be correct, and after that, the database.

Trac 0.11 – Fix Clearsilver dependency

Posted: November 20th, 2009 | Author: | Filed under: howto, idiots, linux | Tags: , , , | No Comments »

If you get the following message:

You're using a plugin which requires the Clearsilver template engine
and Clearsilver is not installed. Either disable that plugin or install Clearsilver.

But, you have compiled and installed latest clearsilver from sources and copied neo_cgi.so to site-packages, and still not working, here is what to you have to do.

For this environment was tested: Linux opensuse 11.1 and centos 5.2, Trac 0.11 with python 2.4 or 2.6, TracDownloader and/or TracWikiToPdfPlugin installed.

Search for clearsilver-*.egg in site-packages and move to another directory.

My clearsilver package name was: clearsilver-0.10.1-py2.6-linux-i686.egg
Restart apache.

Enjoy and say thanks if this solved your problem.

RewriteRules for special characters

Posted: November 18th, 2009 | Author: | Filed under: fun, howto, idiots, linux | Tags: , , , | No Comments »

Let’s say you have to write RewriteRules for special characters (East Asian Languages in this example, but, it should work for any other).

Link that you want to work: http://domain.tls/리눅스
Destination http://domain.tld/linux

First you must convert/encode (I used http://people.w3.org/rishida/scripts/uniview/conversion.php)
리눅스 is converted to %EB%A6%AC%EB%88%85%EC%8A%A4
You can get this from your access.log file of your server if you access it.
Now, you have to escape the % to match the regexp. Replace % with \x:

RewriteEngine On #add it in case it was not added above
ewriteCond %{HTTP_HOST} domain.tld
RewriteRule ^/\xEB\xA6\xAC\xEB\x88\x85\xEC\x8A\xA4$ http://http://domain.tld/linux

Restart or reload.
mod_rewrite should be loaded.
Debug: read /var/log/httpd/error.log and access.log (or corresponding error/access log file for the vhost you want the rule to be added.