Sharing is Joy

I learned something new today

Archive for the ‘Computers’ Category

Considering Sqlite for Pritlog

After my experiments with flat files and php for Pritlog, when I came to find out that Sqlite would be much more performance effective compared to flat files, I am starting to think if I should move to Sqlite for Pritlog.

As an initial test, I tried using a table with 5000 records. Did all common operations like read, update, search. These operations completed in an instant. Absolutely no performance issues. Users would not even realize that there are 5000 records being accessed. I am impressed.

Sqlite databases are simple files created on the path you specify. Hence, I would think, we can move these around and get the same functionality. Mobility is one thing I would like Pritlog to always have.

I have posted on the Pritlog forum to see the responses from the testers/users about moving to Sqlite.

  • 0 Comments
  • Filed under: Computers
  • Flat file databases in PHP

    After releasing the beta version of Pritlog 0.412, I started doing performance tests on Pritlog using varying number of posts. When I reached over 500 posts, I started noticing performance issues and slow response times. Crossing 1000, it almost was not responding.

    This is when I started searching for a better solution for using flat files in PHP. I came across the following solutions of using flat file databases in PHP. These use SQL to retrieve rows from a flat file. Very interesting. But the performance did not improve any as these were still flat files. Anyway, these are interesting and can be very useful.

    * http://www.txtsql.com/ – (has an admin like phpmyadmin)
    * http://code.google.com/p/phpsimpledb/
    * http://sourceforge.net/projects/ffdb-php/
    * http://lukeplant.me.uk/resources/flatfile/

    Below link has some discussion about flat file db’s.
    http://www.usenet-forums.com/php-language/393159-pure-php-flat-file-databases.html

    In many places, I found that Sqlite is recommended for speed and performance. It is much more superior than flat files and also, it is installed by default on most php installations. Hence no separate server install or software required.

  • 0 Comments
  • Filed under: Computers
  • Htaccess Tricks

    htaccess files are optional configuration files used in Apache web servers that can be used to control the directories they are placed in and also the sub directories.

    If your host allows .htaccess files, you may want to read the below articles and use the powerful techniques explained.

    http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/

    http://www.askapache.com/htaccess/apache-htaccess.html

    Try searching for .htaccess and there are tons of articles you will come across.

    Believe me, you will be surprised at the numerous tricks that can be done using .htaccess files.

  • 0 Comments
  • Filed under: Computers, Web
  • Read apache logs using grep

    Some tips from the below link to read your apache log files using the simple grep command.
    http://immike.net/blog/2007/07/12/grepping-your-web-logs/

    Here are some quotes from the article:

    Here’s what a line from an Apache log file looks like:
    71.206.3.109 – - [12/Jul/2007:09:16:31 -0500] “GET / HTTP/1.1″ 200 33545 “-” “Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3″

    For a quick feel for how many visitors I’ve received for the day I use grep to find all of today’s requests, awk to extract the IP address, then sort and uniq to eliminate duplicate IPs (sort is necessary because uniq only works with sorted input). Piping the result through wc results in the number of unique IP addresses that have made requests:

    # grep “12/Jul” immike.net-access.log | awk ‘{print $1}’ | sort | uniq | wc -l
    1188

    For a bit more detail, the following command will determine the 10 most requested pages (excluding css, js, gif, ico, png, and jpg files) and list them in order:

    # awk ‘{print $7}’ immike.net-access.log |
    > grep -ivE ‘(.gif|.jpg|.png|.ico|.css|.js)’ |
    > sed ’s//$//g’ | sort | uniq -c | sort -rn | head -10

  • 0 Comments
  • Filed under: Computers
  • Bash prompt like Dos prompt

    I read this interesting and very simple tip on how to convert your linux bash prompt to look like a dos prompt.

    Here is the link to the original article.
    http://www.linuxhaxor.net/2008/07/18/make-your-bash-prompt-look-like-dos-prompt/

    Quote from the article:

    Add this line to your .bashrc: PS1=’C:${PWD////}>’
    This basically changes the format of your prompt, to look like a dos prompt.

  • 0 Comments
  • Filed under: Computers
  • Linux/BSD Versions I have tried

    I have tried atleast 40-45 distributions and wanted to write atleast 1 line about the below ones. The list is sorted based on the popularity as mentioned on http://distrowatch.com at the time of writing.

    1. Ubuntu: Very stable and the most popular version. But since it is purely open source, the codecs required to play dvd’s, and some formats need to be additionally installed.
    2. OpenSuse: Is very popular, but on my laptop, did not do a good job.
    3. Fedora: Almost similar as OpenSuse. Codecs need to be installed.
    4. Mint: This is Ubuntu with all required codecs and libraries and it is beautiful with Compiz working by default.
    5. PCLinuxOS: This is based on Mandriva and has excellent hardware recognition.
    6. Madriva: Additional codecs need to be installed. But works pretty well.
    7. Dreamlinux: Had difficulty working on my wireless. Is beautiful though.
    8. FreeBSD: Not Linux, but is very stable and popular as a server.
    9. Puppy: My favorite distribution. Extremely light, Superfast and fully functional. Most friendly linux community.
    10. Zenwalk: Worked okay on my laptop. But wireless did not work.
    11. Slax: Lightweight and easily customizable. This started me off into Linux.
    12. PC-BSD: User friendly version of FreeBSD. Worked well on my laptop.
    13. gOS: Again a beautiful version of Ubuntu. Compiz and AWN is installed by default.
    14. Elive: Most popular distro that uses Enlightenment as the window manager. My wireless did not work. Is a beautiful version.
    15. TinyMe: Very lightweight version of PCLinuxOS.
    16. OpenBSD: Claimed to be the most secure OS. But is not user friendly for the end user.
    17. Kiwi: Ubuntu with all codecs and libraries.
    18. Slitaz: Smallest, beautiful distro (under 30 MB now). Lacks wireless modules, extra codecs etc. Codecs/Flash can be easily installed.

    Last but not least, here is a version I created based on Puppy Linux (my favorite).

    • Macpup: This is a beautiful remaster of Puppy Linux.

    If you would like to try out Linux, here are my recommendations:

    • Macpup or Puppy: Actually, if you want to see the beauty and speed of Linux, try this.
    • Kiwi or Mint: Stability of Ubuntu, with all required codecs, flash and libraries pre-installed.

    One best part about the linux versions are that most of them have Livecd versions. You can boot using this CD into the OS and test it out. There is no need of an installation to test. Also, Puppy Linux (or Macpup), can be run from a livecd always, with your personal settings saved to the hard disk.

  • 0 Comments
  • Filed under: Computers
  • Allway Sync: File synchronization

    I already mentioned this in the last post. But thought of having a separate post for this as I love this application.

    This is a free file synchronization software available from the below link:
    http://allwaysync.com/

    Here is a statement from their website:

    Allway Sync is free file and folder synchronization software for Windows.
    Allway Sync uses innovative synchronization algorithms to synchronize your data between desktop PCs, laptops, USB drives and more. Allway Sync combines bulletproof reliability with an extremely easy-to-use interface.

    There are multiple versions available. If you are using this on a USB or using portable apps version, make sure you download the appropriate version from their website.

    You can create multiple jobs to synchronize multiple directories. This is the easiest way to keep your computers at two different locations in sync.

  • 0 Comments
  • Filed under: Computers
  • Carry your applications with you

    You might have noticed that some USB sticks come with a menu similar to your start menu and also applications. I have a Sandisk U3 cruzer USB drive and this has an application called U3 that enables this kind of menu and many applications can be installed onto this.

    There is another way you can achieve the same. You can download Portable apps from the below link.
    http://portableapps.com/

    Here is a statement from their website:
    Now you can carry your favorite computer programs along with all of your bookmarks, settings, email and more with you. Use them on any Windows computer. All without leaving any personal data behind.

    Once you have installed the portable apps suite, you can select various portable versions of applications like:
    - Mozilla Firefox
    - Opera
    - Filezilla

    There are SSH, Anti virus, directory sync, music players, chat clients etc available as portable apps. This is very interesting and useful.

    One portable app I love is called Alway Sync. This is a free program that can be used to keep directories in sync.

  • 0 Comments
  • Filed under: Computers
  • Software I install on a new PC

    Having done this a few times already, I thought of documenting this.

    As soon as I get a Windows based PC, I usually install the following:

    - Openoffice (alternative to MS Office)

    - Filezilla (FTP client to transfer files to my websites)

    - Mozilla Firefox (free and powerful browser)

    - Yahoo messenger (chat software)

    - Pidgin (Can do yahoo, google and other chats with this)

    - Skype (Voip)

    - Gizmo Project(alternative to skype)

    - Cdrtfe for windows (lightweight cd writing solution)

    - Izarc (alternative to Winzip)

    - Context Editor (very good editor for PHP, HTML and in general)

    - Revo Uninstaller (Powerful uninstaller)

    Most of the above are free and open source. Also, these are proven popular packages.

  • 0 Comments
  • Filed under: Computers
  • Macpup Dingo Screenshot
    If you didnt know already, Puppy Linux is the fastest mini linux distro in the world that is fully functional. This works with most hardware and does all the basic tasks that we do on computers. This was created by Barry Kauler.

    I have been enjoying Puppy linux for the last year or so. Lately I started experimenting with creating a remastered version of Puppy Linux. Doing this is very easy in Puppy Linux as tools are already in place. Based on some requests from the Puppy Forum, I started working on a version called Macpup 2.17.1. This was based on Puppy version 2.17.1. The intent was to create a beautiful looking Puppy version using the Icewm Window manager and Wbar (dockbar application). This was released only in the Puppy community and there was good response.

    After the release of the latest Puppy Linux (version 4.00), there were multiple requests to create a Macpup based on this. Thus, I created the version called Macpup Dingo. This came out much better than the previous version in that there was much learning from the forum. This time, the wbar had a background that made it look much better. This background also gives it a 3-D effect. This is the result of various contributions from the Puppy community:

    • Puppy 4.00 – Barry Kauler
    • icewm package – created by ttuuxxx
    • grub backgrounds – created by CatDude

    Wbar and the icewm theme were external packages.

    If interested, you can download Macpup from the below link

    http://macpup.org

  • 0 Comments
  • Filed under: Computers