Archive for the 'Development' Category

You are currently browsing the archives of HidayahTech .

Naïve integer primality calculator in PHP

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, while reading about integers and, subsequently, prime numbers last night, I decided the time had come for me to write a primality calculator in PHP.  The test I use in my implementation is about as a naïve as one can possible get, but it was fun, nonetheless.

Interestingly enough, I discovered that there already exists a primality calculator for *nix-based systems - primes.  It comes with the bsd-games package for Fedora.  I assume the same is true for other distributions.  Mine isn’t quite as fast yet…but it does accept, optionally, one or two arguments. If there are two arguments, then it will calculate all primes starting from the first going until the second. If there is only one argument, it will calculate from PRIME_START (defined to be 2) through to the largest integer PHP can handle on your platform (usually the maximum value of a signed int on your machine).

There are loads of potential optimizations that can be performed, and this was just something written on a whim as a proof of concept. It seems to be accurate, however. The code, released under the GNU GPL v. 3.0, can be found below.
Continue Reading »

Posted by Basil on Aug 24th 2008 | Filed in Development, Fedora, Free Software, Fun, GNU/Linux, PHP | Comments (0)

Audio Islam now running on lighttpd

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, I’ve been able to make some major- and sorely-needed-upgrades to Audio Islam.  Interestingly enough, for the vast majority of people, these changes won’t really be that visible as they are all behind-the scenes.

Continue Reading »

Posted by Basil on Aug 16th 2008 | Filed in Audio Islam, Design, Development, Free Software, GNU/Linux, PHP, Projects, Technology | Comments (5)

Nokia plans to buy Symbian, open OS

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, I just caught the news that Nokia is planning to buy Symbian and subsequently plans to open-source Symbian OS last this year or at the beginning of this year.  If this all plays out and is true, then this is a great boon to world as a high-quality mobile operating system will be free from proprietary encumbrances.

Posted by Basil on Jun 26th 2008 | Filed in Development, Free Software, Technology | Comments (0)

Blog now completely Creative Commons-licensed

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, after finding the wpLicense WordPress plugin on the Creative Commons website, I’ve been able to completely license all my work released through my blog under the Creative Commons Attribution-ShareAlike 3.0 United States license.  This means such world-changing works as my essay on Social Networking & online projects, my tirade against anti-userism, a heart-warming story of love, loss, and & hard disks, the possible (at least, then) merger of Yahoo! & Google, natural sounds recorded with my H4, and many other things.

Continue Reading »

Posted by Basil on Jun 21st 2008 | Filed in Development, Media, Personal, Projects | Comments (0)

ffmpeg from svn

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, I have really been engrossed in using ffmpeg, one of the most amazing a/v command-line tools out there, for my various personal video projects.  However, recently I was experiencing a recurring bug where I could not work with some specific codecs when either the input or the output file was on a particular drive (!).  The drive in question happened to have only one FAT32 partition, so I suspect it may have had something to do with it, as using another drive for both input & output would generally work flawlessly.  The particular action I was trying to perform was to encode a sequence of rather large JPEG files (3072×2304) into a single video file using the outstanding (but still somewhat experimental and/or unstable) FFV1 lossless codec.

So, I visited the ffmpeg website and looked at some of their bugs, but didn’t see anything related to this.  Then, after seeing some of their pre-bug report checklist, I decided to check the version of ffmpeg I had on the system, and found it to be from March.  So, I pulled-down a fresh copy of their trunk via subversion and ran configure & make (I did not run make install).  Running the resulting ffmpeg binary from this compile run worked perfectly, alhamdulillaah.

The lesson is, if you’re running into a bug with either ffmpeg or any other package, then give a shot at running the latest code, if available.  It may seem like common sense, but I had underestimated just how easy it would be.  Surely, other packages may not work as simply, but it really was a piece of cake in this case.  Now I guess I need to learn how to package RPMs so I can help out the Livna project to get this latest code into their repository, which I also understand is not simple task, as many other projects rely on ffmpeg…

Posted by Basil on May 18th 2008 | Filed in Development, Fedora, GNU/Linux, Media, Subversion | Comments (0)

Fedora 9 seeding stats

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, I’m about to head out from work, and I’m going to have to disconnect my torrent seeds that have been running all day - at least until I get home, in shaaʾ Allaah. Here are the graphical bandwidth charts showing the stats of the seeds from all day.

Continue Reading »

Posted by Basil on May 13th 2008 | Filed in Audio Islam, Development, Fedora, GNU/Linux, Hidayah Online, Internet, Media, Technology | Comments (0)

Fedora 9 is gold!

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, Fedora 9 is officially released! At least, the official torrents are available. The main site doesn’t seem to be updated yet, but then again, it’s not 10 AM, either. I’m grabbing the x86_64 DVD build on one server and the i386 on the other, so I hope to be seeding by midday.

Update: The Fedora Project site now reflects the release.  I should really be getting back to work now…

Posted by Basil on May 13th 2008 | Filed in Development, Fedora, GNU/Linux, Internet | Comments (5)

Fedora 9 - Why it’s so awesome

Bismillaahir Rahmaanir Raheem

Okay, I know that title is a pretty pretentious statement by itself, as much of Fedora 9’s awesomeness isn’t unique to it. So, I’ll grant that much of the coming awesomeness is related to Gnome 2.22, which is not limited to Fedora 9, nor is Pulseaudio, Upstart (props to the Ubuntuees for that), or a plethora of other things. So, in reality, Fedora 9’s awesomeness is a celebration of Free & Open-Source software and its universal community.

The following is pretty-much ripped from the wiki. The witty banter is added by me. Also, I know I’m not the first (actually, I hope I’m quite close to the last) to have done one of these things. What follows are the features that I consider to be cool and important, but this list is obviously by no means exhaustive or even appropriately representative of Fedora 9. It’s simply a list of what I think will make Fedora 9 so awesome, in shaaʾ Allaah.

Okay, that should be enough flame retardant for now…onwards!

Continue Reading »

Posted by Basil on May 12th 2008 | Filed in Development, Fedora, Fun, GNOME, GNU/Linux, Internet | Comments (4)

Batch converting images using ImageMagick

Bismillaahir Rahmaanir Raheem

The command you want is mogrify.

Continue Reading »

Posted by Basil on May 7th 2008 | Filed in Development, Fedora, GNU/Linux, Tutorials | Comments (0)

Tapeless HD camcorders

Bismillaahir Rahmaanir Raheem

I’ve been keeping my eye out for tapeless (e.g., hard drive or flash memory instead of tapes) HD camcorders for a while, because of the obvious flexibility of being able to transfer the recorded video directly rather than “recording” it via IEEE 1394 (i.e., “FireWwire”) - while an IEEE 1394 link is definitely fast, any tape-based camcorder usually only transfers the video at regular playing speeds by actually playing the video.

Having said that, here are a few that have caught my eye:

The important issue, of course, is how easy is it to work with the video once it’s recorded.  Most of the video formats are MPEG-4-based, usually the controversial AVCHD.  There are some advantages & disadvantages, of course, but ffmpeg really helps with most of the issues.  I’ve been playing a lot with it (ffmpeg) this past week, and the sheer flexibility of it is astounding.  I think the woes of multimedia flexibility under free operating systems is slowly going away, as even the GUI applications (avidemux, PiTiVi, Kino, etc.) are at a level of refinement I wouldn’t have expected.

Naturally, I am loath to use nonfree versus free solutions, so I am pleased to let you know that there are many free software codecs available through ffmpeg - that is the topic for another article, perhaps.

Obviously, there’s still a lot of work to be done, but I’m really excited to dive into open-source content creation!

Updated with relevant linking and a few spelling fixes.

Posted by Basil on May 6th 2008 | Filed in Development, Fedora, Fun, GNOME, GNU/Linux, Media, Technology | Comments (0)

Hello Fedora Planet & People!

Bismillaahir Rahmaanir Raheem

Hello!  I know I’ve already had a few posts show up on the Planet already, but I wanted to at least acknowledge the fact that I am now, as opposed to having been previously not, a member of Fedora Planet!

I am an avid Fedora user - I have been using Fedora somewhat since FC5 and regularly since FC6.  I run Fedora on my laptop (which I am using to compose this post), on my main PC at home, and also at my workstation at work.  I won’t go into why I love Fedora (and free software in general) too much here, but I guess that fact is obvious given the circumstances under which you are reading this.

I’ve considered joining the Fedora Planet for a while as a decently high percentage of my blog posts are related to Fedora and Free Software in general, with the rest being related somehow to technology, society, community projects, and/or religion.  Only my “Fedora” category is subscribed to on the Planet, but you’re all more than welcome to puruse my blog if any of these other topics interest you at all.

Incidentally, I will do my best to not spam my Fedora category with topics that would not be of general interest to those subscribed to a Fedora blog aggregator.

As for my own involvement with Fedora, I really am best categorized as a user and an advocate, more than anything else.  I am hoping that in the near future my contributions can go beyond mere evangelization and bug reporting into actually bug fixing and contributing.

As for myself, what may interest most of you is the fact that I am a web developer.  I work primarily in the classic LAMP stack, with the majority of my work comprising writing PHP & working with MySQL.  I’m trying to broaden my horizens somewhat, including learning Python so I can start writing some useful GUI applications or even basic scripts that can be rolled out to a large number free software users.  We’ll see how that develops.

Finally, I love comments and constructive discussions.  My blog is ad-free, does not link to google-analytics, and I host it on my own dedicated server, so jumping to my site should be reasonably painless.  I value a quick-loading site as much as the next guy.  Thanks for reading, and here’s to the start a beautiful friendship!

P.S.  If you see any non-English on my site, it’s likely to be Arabic.  I have a terms page that has translations of some of the more common phrases I tend to use in my normal speech.

Posted by Basil on Apr 26th 2008 | Filed in Development, Fedora, GNU/Linux | Comments (1)

Fedora 9 Preview released

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, the Fedora 9 Preview has been released to the torrents! You can grab ‘em here:

http://torrent.fedoraproject.org/

Continue Reading »

Posted by Basil on Apr 18th 2008 | Filed in Development, Fedora, GNOME, GNU/Linux | Comments (1)

Shell History Meme

I got tired of seeing everyone on the planets (Fedora & Gnome) showing-up in Liferea doing this, and I was left out.  So here’s mine from work:

[basil.gohar@escapdv01 ~]$ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
265 ll
210 cd
101 time
86 dbrestore
79 exit
28 su
24 vi
18 ssh
17 ping
16 less

“dbrestore” is an alias for a script I use to…well..restore DBs.  One that is not on here that was the first time I ran the script is my “search” alias, which is a wrapper for find & grep that searches the contents of PHP files (since that’s what I spend all day working on).

I’ve even added a GNOME category.  Maybe after this I’ll start posting more Fedora- & GNOME-related topics, and increase my chances of getting listed in the planets…

I’ll update with my home laptop & PC results after I get home tonight, in shaaʾ Allaah (notice I’m using “ʾ” to mark an Arabic hamzah in my transliteration…more on that later…in shaaʾ Allaah…;) )

Posted by Basil on Apr 10th 2008 | Filed in Development, Fedora, GNOME, GNU/Linux | Comments (0)

Family blog

Bismillaahir Rahmaanir Raheem

Last week my wife & I have decided to start our own family blog to track family’s Islamic development.  As a result, I will most-likely be posting my personal- and family-related musings over there rather than here, allowing HidayahTech to remain more tech-oriented.  That doesn’t mean there will be a complete dearth of such posts here, but I hope you get the picture.

While the family is generally personal and focused on my family, we are aware that it is public (anything with a URL should be considered as such), so feel free to visit, read, and even comment if you are so inclined, as long as you feel there benefit to doing so.

Posted by Basil on Mar 29th 2008 | Filed in Development, Family, Islam, Personal | Comments (0)

WordPress 2.5

Bismillaahir Rahmaanir Raheem

Alhamdulillaah, WordPress 2.5 has been released.  I’ve upgraded my personal blog (this site), the Columbus Dawah blog, and my new family-development blog (more on that later, in shaa Allaah).

WordPress 2.5 (Brecker, apparently), is chock-full of new features that I cannot hope to explain in one short post here, so I’ll invite you to visit the link above to see the new stuff.  Of specific interest to me is the new photo gallery feature, which I hope to be trying out soon, in shaa Allaah.

Coinciding with the upgrade to 2.5, I’m also trying-out a new theme for my blog.  Comments are most welcome!

Posted by Basil on Mar 29th 2008 | Filed in Development, Internet | Comments (0)

Wordpress customization

Bismillaahir Rahmaanir Raheem

Yesterday I had a implement a small, custom template for Wordpress. As a result, I had a chance to see the innards of Wordpress in a way I never really did before. Let me just say that now I’m really excited to actually go through and write my own custom theme for my personal blog - a task I never really seriously contemplated until now.

Posted by Basil on Jan 30th 2008 | Filed in Development | Comments (0)

My projects running on free software (and how to better integrate them)

Bismillaahir Rahmaanir Raheem

Software that is free from proprietary restrictions (a.k.a, free-and-open-source software, which I will refer to as simply “free software” for the rest of this post) has become exceedingly important in my life for both philosophical as well as practical reasons. Not only do I truly believe free software to be inherently better in every way for humanity than proprietary/closed-source software, but I have become increasingly incapable of working with non-free software. Now that free software solutions run the gamut of nearly everything I have a need for, I have all but eliminated non-free software from my essential stack. Having said that, I have a special interest in web-based free software as this particular realm of software has become crucial not only to myself, but to nearly all projects in which I am involved.

Continue Reading »

Posted by Basil on Jan 29th 2008 | Filed in Development, PHP, Projects | Comments (0)

Trying out blog applet in Fedora 8

Bismillaahir Rahmaanir Raheem

I’m trying out the gnome-blog utility again inside of Fedora 8. I had a bit of a challenge at first because when I tried to input my blog URL, it was trying to force the directory to be */wordpress/, which is not how my blog is setup. Alhamdulillaah, once I figured-out I had to append the xmlrpc.php (not xml-rpc.php, like I was trying at first), it stopped trying to force my hand.

Oh, and it seems the word “blog” is still not included in whatever dictionary gnome-blog uses for spell-checking (a nice feature, I might add).

If this works out, then it will be a lot easier to update my blog while I’m at work, where I get most of my bloggy thoughts, rather than waiting until I get home, when I am usually too tired or busy to do anything. This is aside from the fact that there are a lot few formatting options available, but we’ll survive.

As an important note, I tried Drivel after I didn’t succeed at first with gnome-blog, and it didn’t support spaces in usernames. It seems to be related to the fact that it uses the username as part of a key (I guess for GConf?). I guess that’s an example of a poor design choice…

Let’s see what happens…

Posted by Basil on Oct 30th 2007 | Filed in Development, Fedora, GNOME | Comments (0)

Discontinuing with DiscoverULife for now

Bismillaahir Rahmaanir Raheem

Well, my wife & I have decided, both mutually and with the guidance of istikhaarah, that we’re going to discontinue our participation with DiscoverULife for the time being. We both stayed in for exactly one month, which was always intended to be an evaluation period. As it turns out, given our current situation in terms of finances, schedules, and sheer difficulties due to our physical separation, we felt discontinuing for the time-being to be the best option. Alhamdulillaah.

Continue Reading »

Posted by Basil on Sep 10th 2007 | Filed in Development, Islam, Society | Comments (2)

Natural sounds with the H4

As alluded to in a previous post, I needed to find a replacement for my iRiver iHP-120. I ended up splitting my needs into getting two replacements - one device to replace the recording needs, and another to replace the playback needs. After some intense & extensive research, I decided on getting a Zoom H4 Handy. Below are some sample recordings of natural sounds taken from around my parents’ house.

Continue Reading »

Posted by Basil on Aug 27th 2007 | Filed in Development | Comments (0)

Next »

Creative Commons Attribution-ShareAlike 3.0 United States
Creative Commons Attribution-ShareAlike 3.0 United States