ATI Radeon HD6950 2GB on gentoo

ATI HD6950 is a great GPU which is supposed be full supported by opensource radeon drivers. After lot of pain with opensource driver, I have installed closed source ati-drivers and the card works well. During the process I have tried to follow number of ati/radeon/fglrx guides. My goal was to get the card working on two monitors using single screen.

For start tried xf86-video-ati drivers with kernel gentoo-sources-3.0.6. Initially it worked fine. Xorg did all the work by default and I didn’t have to mess with xorg.conf. I only adjusted primary and secondary monitor using kde-4.7.2 system settings. After a few minutes of testing – junk pixels started appearing around open windows and eventually garbage completely took over my two monitors.
Continue reading “ATI Radeon HD6950 2GB on gentoo”

Kate and cleaning Byte Order Mark

Once upon time BOM stole a few hours….

Over the years, Kate editor become my favorite editor and even more. With constant active development kate is more powerful than ever. Initially, I needed a light kde editor for my python projects: kate performed great. Over the time, I used kate more and more, and now it become my primary tool.

Recently, I noticed that somehow my session was set to add Byte Order Mark (BOM) to UTF-8 files. The byte order mark is a Unicode character used to signal the byte order of a text file. More importantly, it might confuse the python templates libraries such as mako, or babel. In kate, you can see if BOM is enabled for a specific file by looking at Tools->Add Byte Order Mark (BOM). As you can suspect, when one opens hundreds of files and accidentally attaches BOM at each one, it would be quite painful to clean BOM manually: uncheck Tools->Add Byte Order Mark (BOM). Here is the solution: find all files with BOM with find and awk


find . -type f -print0 | xargs -0r awk '
/^\xEF\xBB\xBF/ {print FILENAME}
{nextfile}'

And to clean BOM from all *.mako files


find . -type f -iname *.mako -exec sed 's/^\xEF\xBB\xBF//' -i.bak {} \; -exec rm {}.bak \;

and everyone lived happy ever after…

Awstats & virtual hosts

Gentoo has finaly moved away from webapp-config and simplified updating awstats. The example of apache config file setting awstats for apache virtual hosts runnig wsgi application is given bellow. Prerequisites are apache proxy for wsgi app, and awstats visible at www.some_domain.com/awstats.pl using authentication.

    <VirtualHost *:80>
        ServerName www.some_domain.com
        Serveralias some_domain.com
        ServerAdmin admin@some_domain.com

        ErrorLog /var/log/apache2/www.some_domain.com-error.log
        CustomLog /var/log/apache2/www.some_domain.com-access.log combined

        # awstats config
        Alias /awstats/classes "/usr/share/awstats/wwwroot/classes/"
        Alias /awstats/css "/usr/share/awstats/wwwroot/css/"
        Alias /awstats/icon "/usr/share/awstats/wwwroot/icon/"
        ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"
        ScriptAlias /awstats "usr/share/awstats/wwwroot/cgi-bin/awstats.pl”
        ScriptAlias /awstats.pl "usr/share/awstats/wwwroot/cgi-bin/awstats.pl”

        <Directory "/usr/share/awstats/wwwroot">
                AllowOverride None
                Options None
                Order allow,deny
                Allow from all

                AuthType Basic
                AuthName "AWStats authenticated zone"
                AuthUserFile /etc/awstats/.htpasswd
                Require valid-user
        </Directory>
        <Directory "/usr/share/awstats/wwwroot/cgi-bin">
                SetHandler cgi-script
                Options +ExecCGI
        </Directory>

        ProxyPass /awstats !
        ProxyPass /awstats.pl !

        ProxyPass / http://localhost:5005/ retry=5
        ProxyPassReverse / http://localhost:5001/
        ProxyPreserveHost On
        <Proxy *>
            Order deny,allow
            Allow from all
        </Proxy>
    </VirtualHost>

Awstats config file (in /etc/awstats/) with geo-ip (emerge dev-perl/Geo-IP)

LogFile="/var/log/apache2/www.some_domain.com-access.log"

LogType=W
LogFormat=1
LogSeparator=" "
HostAliases="localhost 127.0.0.1 REGEX[myserver\.com$]"
DNSLookup=2
DirCgi="/cgi-bin"
DirIcons="/awstats/icon"
AllowToUpdateStatsFromBrowser=0
AllowFullYearView=2

LevelForFileTypesDetection=1
LevelForWormsDetection=2

SiteDomain="www.some_domain.com"
DirData="/home/some_user/awstats"

LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"

To test configuration run
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=www.some_domain.com -update

If you wish cron to handle update on every hour:
crontab -e -usome_user

0 * * * * cd /etc/awstats/ && /usr/share/awstats/wwwroot/cgi-bin/awstats.pl  -config=www.some_domain.com -update  >/dev/null 2>&1

Error with log file

Error: LogFile parameter is not defined in config/domain file
Setup ('www.dajstadas.com' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

obviously check LogFile and read permissions, however, this might fail if you call awstats update outside /etc/awstats directory. Retry with


cd /etc/awstats/ && /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=www.some_domain.com -update

Here it is

so I stared a blog! Wonderful. I can share my thoughts with anyone on the planet. Hello world. And who the hack cares what I think, what I do, what I eat, what I write, etc… Is this just yet another pathetic blog in the see of junk, or maybe something so popular that people set their home page to it? I have no idea! If in a few years I add my shitter account so anyone can follow what type of literature I go over while heating a toilet seat, you’ll now that I got social. If not, oh, well.

and Motivation

I got this domain as a birthday gift with a primary purpose to create my personal blog. Well, thank you my dear friend for forcing me to spend some time for a creative writing work instead on hacking, playing, surfing…. Dear reader, if you are gifting someone, maybe better put some cache in the envelope instead getting a domain…. Anyway, it took me a year to start, and finally got the last warning

    You better do something with mufljuz.com or I might not extended it for your 3something birthday.

So here I am.