Timur Asaliev

Blog of Timur Asaliev
RSS icon Email icon Home icon
  • Delete recursively lines from files that match a given string

    Posted on November 30th, 2009 Timur Asaliev No comments

    This is just a small snipplet to remind me of how to delete lines recursively that match a string needle

    #!/bin/sh
    grep -rl "needle" . |
    while read filename
    do
    (
    echo $filename
    sed '/needle/d' $filename> $filename.xx
    mv $filename.xx $filename
    )
    done

    References used:
    www.mehtanirav.com
    www.cs.mcgill.ca

  • Wordpress 2.7 Upgrade

    Posted on January 8th, 2009 Timur Asaliev No comments

    I have upgraded to Wordpress 2.7 and I must say that I am speechless about the new dashboard. It looks really fancy!

  • PHP Template Caching

    Posted on January 8th, 2009 Timur Asaliev No comments

    This new year brought some inspiration in respect of coding to me and I have decided to research and possibly implement my own template caching system. I have looked around for some solutions but I wasn’t able to locate a system that could handle partial caching, although this could just be my poor googling skills. By partial caching I mean caching the whole template (for example: the <head> section which might be generated automatically, the body with the news and the comments) but don’t cache blocks of data of my choice. A good example of these blocks could be a box looking like this:

    Welcome back, DummyUser (link to personal profile)
    You have X new messages

    So I have spent two days to put down the list of features I want on paper so here it goes:

    • Easy to integrate with other PHP aplications.
    • An ability to work with <meta> tags, <script> and <link> includes.
    • Per template caching on-demand.
    • Caching of whole pages (based on REQUEST_URI) but with an option for non cached blocks of data (example above).
    • Assignment of template variables.
    • Dynamic generation of page titles.

    Some of the features are already implemented (and are working!), like caching of templates on demand and caching of whole pages with ability to leave non cached blocks of data.

    Hopefully this inspiration will stay for a couple of more days so I accually post a stable version of the class for others to explore and play around with.

  • New PC

    Posted on July 3rd, 2008 Timur Asaliev 2 comments

    I got my new PC yesterday:

    • Intel Core 2 Duo e8400 3Ghz 45nm.
    • XFX 8800GT 512Mb
    • 2Gb ram (for the time being)

    About to install linux now

  • Moved to another host

    Posted on June 30th, 2008 Timur Asaliev No comments

    I’ve just moved to a new host. Things seem to run fine!

  • CakePHP – First impressions

    Posted on June 20th, 2008 Timur Asaliev No comments

    My first framework after developing with PHP for 4-5 years was CodeIgniter, which I’ve been using for a while and have already dugg into it’s core to go on and make a lite version for personal use. For the past year or two I’ve been hearing a lot about CakePHP framework and have finally found some time to play around with it.

    After spending 3 hours last night with the Cake’s online manual (although skipping basic stuff) and reading through the blog tutorial, I have to say I was impressed with CakePHP. Although the convensions could be somewhat difficult for new comers to remember, I have to agree that they are very useful and increase the development speed.

    I have also enjoyed their support for third party classes (with javascript includes too!), very well commented API and plugin support:

    CakePHP allows you to set up a combination of controllers, models, and views and release them as a packaged application plugin that others can use in their CakePHP applications.
    Cookbook

    CakePHP is a very good framework and I will start playing around with CakePHP next week to try and code a small forum and a blog for CodeVision.

  • FreeBSD 7: Having trouble installing mysql without linuxthreads?

    Posted on June 4th, 2008 Timur Asaliev 2 comments

    Believe it or not I was installing mysql on a FreeBSD 7 box for most of the day. After looking at the make options my attention was grabbed by the WITH_LINUXTHREADS parameter. After a bit of googling it seemed the I did not need linuxthreads on FreeBSD7-STABLE. So there I go and add the WITH_LINUXTHREADS=no and… the installation fails at… linuxthreads.

    Well. I’ve spent lots of time googling, passed numerous make errors. Basically at the end of the day I just modified the Makefile of the mysql port to totally bypass the WITH_LINUXTHREADS and just add the standart non-linuxthread configure options.

    Open the Makefile

    # vi /usr/ports/databases/mysqlxx-server/Makefile

    Find these lines (or similar)

    .if defined(WITH_LINUXTHREADS)
    CONFIGURE_ARGS+=--with-named-thread-libs='-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
    CONFIGURE_ARGS+=-D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
    CFLAGS+=        -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE
    CFLAGS+=        -I${LOCALBASE}/include/pthread/linuxthreads
    LIB_DEPENDS+=   lthread.[35]:${PORTSDIR}/devel/linuxthreads
    CONFIGURE_ARGS+=-L${LOCALBASE}/lib -llthread -llgcc_r -llstdc++ -llsupc++'

    Change to

    .if defined(WITH_LINUXTHREADS)
    CONFIGURE_ARGS+=--with-named-thread-libs=${PTHREAD_LIBS}
    CFLAGS+=        ${PTHREAD_CFLAGS}

    Everything compiled and installed afterwards without the linuxthreads (I did not want them anyway).

  • In love with jQuery

    Posted on June 4th, 2008 Timur Asaliev No comments

    jQuery is around for a while already, but only recently I actually sat down and decided to give it a go. jQuery website defines itself as:

    jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.

    After trying it out, going through jQuery wiki pages I have to say it probably is the best Javascript framework I’ve seen. I have tried mootools (not very recent though), scriptaculous, but jQuery just beats them all. It’s lightweight, very easy to use, has a bunch of ready-made plugins and a large community.

    If you’re planning to do some Javascript, try jQuery. Meanwhile I am placing jQuery on my must-use list.

  • Annoying Software

    Posted on June 3rd, 2008 Timur Asaliev 2 comments

    After reading Leonid’s blog entry on annoying software I decided to put down my own list. So here it goes

    • Kwrite
      Lack of tabs
    • Gedit
      Lack of ability to shrink a block of code into a one liner. Kwrite has this feature.
    • Firefox 2.x
      What bothers me most about Firefox 2.x is that box with “Remember your password” popup box. I’m glad they changed it in Firefox 3
    • Firefox 3.x
      This could be only me, but the new URL drop down box looks quite messy and It can take me ages to find the URL I need. The drop down menu seems to put emphasis on the title of the page, rather than the URL itself. I’m just so not used to this.
    • Intel Graphics Linux Drivers
      For just being worse than the Windows ones. (Not really a tool, but I just had to mention it)
    • Pidgin ICQ support
      I don’t use ICQ now a lot, but every now and then I have to login and chat to my dad. I’ve got a huge contact list and don’t want everyone to see me online. I do know that there is an “Invisible” option, but that’s just not enough for me. I really enjoy using QIP for Windows because it has a very good manager for your online statuses (like my favourite “Show as offline for all”)
    • Roundcube
      Roundcube is a web-based e-mail client. I like it for it’s simplicity and looks, but it’s Javascript doesn’t work very well. As one of the things that really annoyes me is when you type a huge letter, hit Send and get a popup message saying “Are you sure you want to send an empty email?“. Not amuzing.
      Update: I’m not using the most recent version as it turned out. Will check it out and hope that this bug is not there.

    This seems to be it as I cannot come up with anything else.

  • Blog update

    Posted on June 2nd, 2008 Timur Asaliev No comments

    Just finished upgrading my really old 2.2.something version of wordpress. Everything went nice and smooth. Good job, wordpress community!

    Edit: I’m still looking for a new style..

  • Keep your teeth clean

    Posted on June 2nd, 2008 Timur Asaliev No comments

    I had an arranged visit to a dentist today. Result – 2 new fillings.

    Keep your teeth clean, people.

  • CodeVision

    Posted on May 31st, 2008 Timur Asaliev No comments

    Recently, I have registered a new domain CodeVision.org. I am planning to open a new website alongside with one of my friends – Vadim. Although we still do not have a clear picture on what exactly we will have there, it will be web and coding oriented in any case.

    More information to be posted soon.

  • FreeBSD: Upgrading mysql40-server to a higher version port

    Posted on November 28th, 2007 Timur Asaliev 1 comment

    Had a need to upgrade MySQL 4.0.27 on one of the productions servers I manage to MySQL 5.0. If anyone has any trouble doing that, I have written a small tutorial on how to accomplish this task without many problems.
    Read the rest of this entry »

  • Firefox 3 Beta 1 is now avaiable

    Posted on November 22nd, 2007 Timur Asaliev No comments

    You can read the review at ZDNet Blogs here.

    Download here (available in 20 languages)

  • Quake 3 scrims

    Posted on November 19th, 2007 Timur Asaliev 2 comments

    Nice to see some more people starting to play Q3 CMPA again. Having some real fun here scrimming with my pal r2k.Term, Mamoth & TVSet. Good game guys!

  • Fedora 8 Released

    Posted on November 8th, 2007 Timur Asaliev No comments

    Fedora 8 has been officially released earlier on today. A quick glance at the release summary leaves me pretty content with the work done. Will try it out on my laptop first (they did promise new and updated wifi drivers, right?). Will write a short review afterwards

  • Back Online

    Posted on November 8th, 2007 Timur Asaliev No comments

    Back online with my blog – updated and configured. Will start populating the blog with loads of useless posts :-)

    Update: still trying to find a suitable wordpress style for my blog.